11# RTPProxy control
22route[ENC_SRTP] {
33 add_rr_param(" ;rm=1" );
4- $avp(rtpproxy_offer_flags) = " flags=loop-protect replace-origin replace-session-connection ICE=force SRTP AVP" ;
5- $avp(rtpproxy_answer_flags) = " flags=loop-protect replace-origin replace-session-connection ICE=remove RTP AVP" ;
4+ $avp(rtpproxy_offer_flags) = " replace-origin replace-session-connection ICE=force SRTP AVP" ;
5+ $avp(rtpproxy_answer_flags) = " replace-origin replace-session-connection ICE=remove RTP AVP" ;
66}
77
88route[DEC_SRTP] {
99 add_rr_param(" ;rm=2" );
10- $avp(rtpproxy_offer_flags) = " flags=loop-protect replace-origin replace-session-connection ICE=remove RTP AVP" ;
11- $avp(rtpproxy_answer_flags) = " flags=loop-protect replace-origin replace-session-connection ICE=force SRTP AVP" ;
10+ $avp(rtpproxy_offer_flags) = " replace-origin replace-session-connection ICE=remove RTP AVP" ;
11+ $avp(rtpproxy_answer_flags) = " replace-origin replace-session-connection ICE=force SRTP AVP" ;
1212}
1313
1414route[ENC_WS_RTP] {
1515 add_rr_param(" ;rm=3" );
16- $avp(rtpproxy_offer_flags) = " flags=loop-protect replace-origin replace-session-connection ICE=force RTP AVPF" ;
17- $avp(rtpproxy_answer_flags) = " flags=loop-protect replace-origin replace-session-connection ICE=remove RTP AVP" ;
16+ $avp(rtpproxy_offer_flags) = " replace-origin replace-session-connection ICE=force RTP AVPF" ;
17+ $avp(rtpproxy_answer_flags) = " replace-origin replace-session-connection ICE=remove RTP AVP" ;
1818}
1919
2020route[DEC_WS_RTP] {
2121 add_rr_param(" ;rm=4" );
22- $avp(rtpproxy_offer_flags) = " flags=loop-protect replace-origin replace-session-connection ICE=remove RTP AVP" ;
23- $avp(rtpproxy_answer_flags) = " flags=loop-protect replace-origin replace-session-connection ICE=force RTP AVPF" ;
22+ $avp(rtpproxy_offer_flags) = " replace-origin replace-session-connection ICE=remove RTP AVP" ;
23+ $avp(rtpproxy_answer_flags) = " replace-origin replace-session-connection ICE=force RTP AVPF" ;
2424}
2525
2626route[ENC_WSS_RTP] {
2727 add_rr_param(" ;rm=5" );
28- $avp(rtpproxy_offer_flags) = " flags=loop-protect replace-origin replace-session-connection ICE=force SRTP AVPF DTLS=passive" ;
29- $avp(rtpproxy_answer_flags) = " flags=loop-protect replace-origin replace-session-connection ICE=remove RTP AVP" ;
28+ $avp(rtpproxy_offer_flags) = " replace-origin replace-session-connection ICE=force SRTP AVPF DTLS=passive" ;
29+ $avp(rtpproxy_answer_flags) = " replace-origin replace-session-connection ICE=remove RTP AVP" ;
3030}
3131
3232route[DEC_WSS_RTP] {
3333 add_rr_param(" ;rm=6" );
34- $avp(rtpproxy_offer_flags) = " flags=loop-protect replace-origin replace-session-connection ICE=remove RTP AVP" ;
35- $avp(rtpproxy_answer_flags) = " flags=loop-protect replace-origin replace-session-connection ICE=force SRTP AVPF DTLS=passive" ;
34+ $avp(rtpproxy_offer_flags) = " replace-origin replace-session-connection ICE=remove RTP AVP" ;
35+ $avp(rtpproxy_answer_flags) = " replace-origin replace-session-connection ICE=force SRTP AVPF DTLS=passive" ;
3636}
3737
3838route[ENC_RTP] {
3939 add_rr_param(" ;rm=7" );
40- $avp(rtpproxy_offer_flags) = " flags=loop-protect replace-origin replace-session-connection ICE=force RTP AVP" ;
41- $avp(rtpproxy_answer_flags) = " flags=loop-protect replace-origin replace-session-connection ICE=remove RTP AVP" ;
40+ $avp(rtpproxy_offer_flags) = " replace-origin replace-session-connection ICE=force RTP AVP" ;
41+ $avp(rtpproxy_answer_flags) = " replace-origin replace-session-connection ICE=remove RTP AVP" ;
4242}
4343
4444route[DEC_RTP] {
4545 add_rr_param(" ;rm=8" );
46- $avp(rtpproxy_offer_flags) = " flags=loop-protect replace-origin replace-session-connection ICE=remove RTP AVP" ;
47- $avp(rtpproxy_answer_flags) = " flags=loop-protect replace-origin replace-session-connection ICE=force RTP AVP" ;
46+ $avp(rtpproxy_offer_flags) = " replace-origin replace-session-connection ICE=remove RTP AVP" ;
47+ $avp(rtpproxy_answer_flags) = " replace-origin replace-session-connection ICE=force RTP AVP" ;
4848}
4949
5050# RTPProxy control
5151route[NATMANAGE] {
52- # !ifdef WITH_DEBUG
5352 if (is_request())
54- xlog (" REQUEST: $rm $ru ($si:$sp, $ci)\n" );
53+ xnotice (" REQUEST: $rm $ru ($si:$sp, $ci)\n" );
5554 else
56- xlog (" REPLY: $rs $rr ($rm, $si:$sp, $ci)\n" );
55+ xnotice (" REPLY: $rs $rr ($rm, $si:$sp, $ci)\n" );
5756
5857 if (is_direction(" downstream" ))
59- xlog (" downstream\n" );
58+ xnotice (" downstream\n" );
6059 else
61- xlog (" upstream\n" );
60+ xnotice (" upstream\n" );
6261
63- xlog (" Offer: $avp(rtpproxy_offer_flags)\n" );
64- xlog (" Answer: $avp(rtpproxy_answer_flags)\n" );
62+ xnotice (" Offer: $avp(rtpproxy_offer_flags)\n" );
63+ xnotice (" Answer: $avp(rtpproxy_answer_flags)\n" );
6564 if (isflagset(FLT_MOBILE_ORIG)) {
66- xlog (" mo\n" );
65+ xnotice (" mo\n" );
6766 } else {
68- xlog (" mt\n" );
67+ xnotice (" mt\n" );
6968 }
70- # !endif
7169 if ((is_reply() && ($T_req($tt) != $null)) || (is_request() && has_totag())) {
72- xlog(" L_DBG" , " Request had ToTag." );
7370 # if((is_request() && !check_route_param("rm=")) || (is_reply() && !isflagset(FLT_RTP))) {
7471 if(!check_route_param(" rm=" ) && !isflagset(FLT_RTP)) {
75- xlog( " L_DBG " , " No RM Param\n" );
72+ xnotice( " No RM Param\n" );
7673 return;
7774 }
7875 if (($fU != $null && is_in_profile(" caller" , " $fU" )) ||
@@ -118,8 +115,10 @@ route[NATMANAGE] {
118115
119116 setflag(FLT_RTP);
120117
121- if (!has_body(" application/sdp" ))
118+ if (!has_body(" application/sdp" )) {
119+ xnotice(" No SDP body, skipping RTP handling\n" );
122120 return;
121+ }
123122
124123# !ifdef REMOVE_BITALIGNED_AMR
125124 route(REMOVE_BITALIGNED);
@@ -132,7 +131,7 @@ route[NATMANAGE] {
132131
133132 # Fix for calling between UEs not supporting preconditioning
134133 if(sdp_get_line_startswith(" $avp(mline)" , " a=inactive" )) {
135- xlog (" m-line: $avp(mline)\n" );
134+ xnotice (" m-line: $avp(mline)\n" );
136135 sdp_remove_line_by_prefix(" a=inactive" );
137136 $sdp(body) = $sdp(body) + " a=sendrecv\r\n" ;
138137 msg_apply_changes();
@@ -164,16 +163,19 @@ route[NATMANAGE] {
164163 return;
165164
166165 if (is_request() && isflagset(FLT_MOBILE_ORIG)) {
166+ xnotice(" Handling RTP for initial request from $fU on mo side\n" );
167167 set_dlg_profile(" caller" , " $fU" );
168168 rtpengine_manage($avp(rtpproxy_offer_flags));
169169 } else if (is_reply() && !isflagset(FLT_MOBILE_ORIG)) {
170+ xnotice(" Handling RTP for initial reply from $tU on mt side\n" );
170171 set_dlg_profile(" callee" , " $tU" );
171172 rtpengine_manage($avp(rtpproxy_answer_flags));
172- } else if (is_reply() && isflagset(FLT_MOBILE_ORIG) && ($sdp(c:ip) != " RTPENGINE_IP" )) {
173+ } else if (is_reply() && isflagset(FLT_MOBILE_ORIG) && ($sdp(c:ip) != " RTPENGINE_IP" ) && !($ct =~ " .*g.3gpp.*" )) {
174+ # TODO: Handle calling between a SIP client and VoLTE/VoNR UE
175+ xlog(" L_INFO" , " RTPEngine engaged for Application Server\n" );
173176 set_dlg_profile(" callee" , " $fU" );
174177 rtpengine_manage($avp(rtpproxy_offer_flags));
175178 msg_apply_changes();
176- xlog(" L_INFO" , " RTPEngine engaged for Application Server with flags ($avp(rtpproxy_offer_flags))\n" );
177179 }
178180 }
179181}
0 commit comments