Module: kamailio
Branch: master
Commit: 587ec84cea23e891d31151e13eb1d86a0638f8bd
URL:
https://github.com/kamailio/kamailio/commit/587ec84cea23e891d31151e13eb1d86…
Author: jaybeepee <jason.penton(a)gmail.com>
Committer: jaybeepee <jason.penton(a)gmail.com>
Date: 2016-09-26T13:20:40+02:00
modules/ims_qos: add media subcomponent option for RTP/AVPF as well as prevent crash on
unknown subcomponent
---
Modified: modules/ims_qos/rx_avp.c
---
Diff:
https://github.com/kamailio/kamailio/commit/587ec84cea23e891d31151e13eb1d86…
Patch:
https://github.com/kamailio/kamailio/commit/587ec84cea23e891d31151e13eb1d86…
---
diff --git a/modules/ims_qos/rx_avp.c b/modules/ims_qos/rx_avp.c
index 5a42136..58f7e2e 100644
--- a/modules/ims_qos/rx_avp.c
+++ b/modules/ims_qos/rx_avp.c
@@ -426,10 +426,12 @@ inline int rx_add_media_component_description_avp(AAAMessage *msg,
int number, s
/*media-sub-component*/
if (dlg_direction != DLG_MOBILE_ORIGINATING) {
media_sub_component[media_sub_component_number] =
rx_create_media_subcomponent_avp(number, transport, ipA, portA, ipB, portB,
flow_usage_type);
- cdpb.AAAAddAVPToList(&list, media_sub_component[media_sub_component_number]);
+ if (media_sub_component[media_sub_component_number])
+ cdpb.AAAAddAVPToList(&list, media_sub_component[media_sub_component_number]);
} else {
media_sub_component[media_sub_component_number] =
rx_create_media_subcomponent_avp(number, transport, ipB, portB, ipA, portA,
flow_usage_type);
- cdpb.AAAAddAVPToList(&list, media_sub_component[media_sub_component_number]);
+ if (media_sub_component[media_sub_component_number])
+ cdpb.AAAAddAVPToList(&list, media_sub_component[media_sub_component_number]);
}
@@ -692,6 +694,8 @@ AAA_AVP *rx_create_media_subcomponent_avp(int number, str* proto,
proto_nr = "17"; /* for now we just use UDP for all RTP */
} else if (proto->len == 8 && strncasecmp(proto->s,"RTP/SAVP",
proto->len) == 0) {
proto_nr = "17"; /* for now we just use UDP for all RTP */
+ } else if (proto->len == 8 && strncasecmp(proto->s,"RTP/AVPF",
proto->len) == 0) {
+ proto_nr = "17"; /* for now we just use UDP for all RTP */
} else {
LOG(L_ERR, "Not yet implemented for protocol %.*s\n", proto->len,
proto->s);
return 0;