Module: sip-router
Branch: master
Commit: b4e8f3f4c09b57ce6f60f542963a80b79fc0205b
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b4e8f3f…
Author: Richard Good <richard.good(a)smilecoms.com>
Committer: Richard Good <richard.good(a)smilecoms.com>
Date: Thu Aug 14 10:48:16 2014 +0200
modules/ims_qos: Do not add MCD AVP to AAR if src or dst ports are 0
Check if src or dst ports in SDP are 0 and if so do not add an MCD AVP for this
---
modules/ims_qos/rx_aar.c | 17 +++++++++++------
1 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/modules/ims_qos/rx_aar.c b/modules/ims_qos/rx_aar.c
index 5196d99..463845a 100644
--- a/modules/ims_qos/rx_aar.c
+++ b/modules/ims_qos/rx_aar.c
@@ -380,12 +380,17 @@ int add_media_components(AAAMessage* aar, struct sip_msg *req,
//is this a stream to add to AAR.
if (req_sdp_stream->is_rtp) {
- rx_add_media_component_description_avp(aar, sdp_stream_num + 1,
- &req_sdp_stream->media, &req_sdp_session->ip_addr,
- &req_sdp_stream->port, &rpl_sdp_session->ip_addr,
- &rpl_sdp_stream->port, &rpl_sdp_stream->transport,
- &req_sdp_stream->raw_stream,
- &rpl_sdp_stream->raw_stream, direction);
+ //check if the src or dst port is 0 and if so then don't add to rx
+ int intportA = atoi(req_sdp_stream->port.s);
+ int intportB = atoi(rpl_sdp_stream->port.s);
+ if(intportA != 0 && intportB != 0){
+ rx_add_media_component_description_avp(aar, sdp_stream_num + 1,
+ &req_sdp_stream->media,
&req_sdp_session->ip_addr,
+ &req_sdp_stream->port, &rpl_sdp_session->ip_addr,
+ &rpl_sdp_stream->port,
&rpl_sdp_stream->transport,
+ &req_sdp_stream->raw_stream,
+ &rpl_sdp_stream->raw_stream, direction);
+ }
}
sdp_stream_num++;
}