@@ -132,7 +132,7 @@ route[N5_INIT_REQ] {
132132 $var(sdp_src_port) = $sdp(m0:rtp:port);
133133 $var(sdp_src_rtcp_port) = $sdp(m0:rtcp:port);
134134 $var(sdp_mline_raw) = $sdp(m0:raw);
135-
135+
136136 xlog(" L_INFO" , " SDP Info : Connection IP is $var(sdp_src_ip) Port is $var(sdp_src_port) Mline dump $var(sdp_mline_raw) \n" );
137137
138138 $var(user_id_sdp_ip) = $fU;
@@ -189,13 +189,13 @@ route[N5_INIT_REQ] {
189189 jansson_set(" string" , " afAppId" , " +g.3gpp.icsi-ref=\" urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel\" " , " $var(payload)" ); # adding a note that this could be improved in future to get the value SIP Header
190190 jansson_set(" string" , " dnn" , " ims" , " $var(payload)" );
191191
192- # Set medComponents
192+ # Set medComponents for Audio Flow
193193 jansson_set(" integer" , " medCompN" , 1, " $var(medComp)" );
194194 jansson_set(" string" , " qosReference" , " qosVoNR" , " $var(medComp)" );
195195 jansson_set(" string" , " medType" , " AUDIO" , " $var(medComp)" );
196196 jansson_set(" array" , " codecs" , " [\" downlink\\noffer\\n\" , \" uplink\\nanswer\\n\" ]" , " $var(medComp)" );
197197
198- # RTP
198+ # RTP for Audio Flow
199199 jansson_set(" integer" , " fNum" , 1, " $var(medSubComp1)" );
200200 jansson_set(" array" , " fDescs" , " [\" permit out 17 from any to $var(ue_sdp_ip) $var(ue_sdp_port)\" , \" permit in 17 from $var(ue_sdp_ip) $var(ue_sdp_port) to any\" ]" , " $var(medSubComp1)" );
201201 jansson_set(" string" , " fStatus" , " ENABLED" , " $var(medSubComp1)" );
@@ -204,20 +204,57 @@ route[N5_INIT_REQ] {
204204 jansson_set(" string" , " flowUsage" , " NO_INFO" , " $var(medSubComp1)" );
205205
206206
207- # RTCP
207+ # RTCP for Audio Flow
208208 jansson_set(" integer" , " fNum" , 2, " $var(medSubComp2)" );
209209 jansson_set(" array" , " fDescs" , " [\" permit out 17 from any to $var(ue_sdp_ip) $var(ue_sdp_rtcp_port)\" , \" permit in 17 from $var(ue_sdp_ip) $var(ue_sdp_rtcp_port) to any\" ]" , " $var(medSubComp2)" );
210210 jansson_set(" string" , " fStatus" , " ENABLED" , " $var(medSubComp2)" );
211211 jansson_set(" string" , " marBwDl" , " 5000 Kbps" , " $var(medSubComp2)" );
212212 jansson_set(" string" , " marBwUl" , " 3000 Kbps" , " $var(medSubComp2)" );
213213 jansson_set(" string" , " flowUsage" , " RTCP" , " $var(medSubComp2)" );
214214
215- # Merging the flows under MediaSubComponent
215+ # Merging the flows under MediaSubComponent for Audio Flow
216216 jansson_set(" obj" , " 0" , " $var(medSubComp1)" , " $var(medSubComps)" );
217217 jansson_set(" obj" , " 1" , " $var(medSubComp2)" , " $var(medSubComps)" );
218218 jansson_set(" obj" , " medSubComps" , " $var(medSubComps)" , " $var(medComp)" );
219219
220+ # Now in case of an initial Invite with Video, we need to update the N5 QoS Request with the Video Flow Info
221+ if(sdp_with_media(" video" )) {
222+ xlog(" L_INFO" , " Video Call has been started, adding Video N5 QoS..." );
223+
224+ # Set medComponents for Video Flow
225+ jansson_set(" integer" , " medCompN" , 2, " $var(medComp_vid)" );
226+ jansson_set(" string" , " qosReference" , " qosVoNR" , " $var(medComp_vid)" );
227+ jansson_set(" string" , " medType" , " VIDEO" , " $var(medComp_vid)" );
228+ jansson_set(" array" , " codecs" , " [\" downlink\\noffer\\n\" , \" uplink\\nanswer\\n\" ]" , " $var(medComp_vid)" );
229+
230+ # RTP for Video Flow
231+ jansson_set(" integer" , " fNum" , 1, " $var(medSubComp_vid1)" );
232+ jansson_set(" array" , " fDescs" , " [\" permit out 17 from any to any\" , \" permit in 17 from any to any\" ]" , " $var(medSubComp_vid1)" );
233+ jansson_set(" string" , " fStatus" , " ENABLED" , " $var(medSubComp_vid1)" );
234+ jansson_set(" string" , " marBwDl" , " 5000 Kbps" , " $var(medSubComp_vid1)" );
235+ jansson_set(" string" , " marBwUl" , " 3000 Kbps" , " $var(medSubComp_vid1)" );
236+ jansson_set(" string" , " flowUsage" , " NO_INFO" , " $var(medSubComp_vid1)" );
237+
238+
239+ # RTCP for Video Flow
240+ jansson_set(" integer" , " fNum" , 2, " $var(medSubComp_vid2)" );
241+ jansson_set(" array" , " fDescs" , " [\" permit out 17 from any to any\" , \" permit in 17 from any to any\" ]" , " $var(medSubComp_vid2)" );
242+ jansson_set(" string" , " fStatus" , " ENABLED" , " $var(medSubComp_vid2)" );
243+ jansson_set(" string" , " marBwDl" , " 5000 Kbps" , " $var(medSubComp_vid2)" );
244+ jansson_set(" string" , " marBwUl" , " 3000 Kbps" , " $var(medSubComp_vid2)" );
245+ jansson_set(" string" , " flowUsage" , " RTCP" , " $var(medSubComp_vid2)" );
246+
247+ # Merging the flows under MediaSubComponent for Video
248+ jansson_set(" obj" , " 2" , " $var(medSubComp_vid1)" , " $var(medSubComps_vid)" );
249+ jansson_set(" obj" , " 3" , " $var(medSubComp_vid2)" , " $var(medSubComps_vid)" );
250+ jansson_set(" obj" , " medSubComps" , " $var(medSubComps_vid)" , " $var(medComp_vid)" );
251+ } # End if Video
252+
253+ # Merging all Flows under MediaComponent
220254 jansson_set(" obj" , " 0" , " $var(medComp)" , " $var(medComponents)" );
255+ if(sdp_with_media(" video" )) {
256+ jansson_set(" obj" , " 1" , " $var(medComp_vid)" , " $var(medComponents)" );
257+ }
221258 jansson_set(" obj" , " medComponents" , " $var(medComponents)" , " $var(payload)" );
222259
223260 xlog(" L_INFO" ," Set evSubsc\n" );
@@ -469,8 +506,7 @@ onreply_route[MO_indialog_reply] {
469506 route(NATMANAGE);
470507
471508# !ifdef WITH_RX
472- # Rx AAR for in-dialog requests with SDP or Session refresh via UPDATE
473- if ((t_check_status(" 180|183|200" ) && has_body(" application/sdp" ) && !is_method(" PRACK" )) || (is_method(" UPDATE" ))) {
509+ if (t_check_status(" 180|183|200" ) && has_body(" application/sdp" ) && !is_method(" PRACK" )) {
474510 if (t_is_retr_async_reply()) {
475511 xlog(" L_DBG" , " Dropping retransmitted reply which is still currently suspended\n" );
476512 drop();
@@ -514,7 +550,10 @@ route[MO_indialog_aar_reply]
514550# 5G VoNR N5 Policy Authorization PATCH request
515551route[N5_PATCH_REQ] {
516552 xlog(" L_INFO" , " IMS: Received 183/200 inside orig_initial_reply\n" );
517-
553+ if(sdp_with_media(" video" )) {
554+ xlog(" L_INFO" , " Starting Video Call..." );
555+ }
556+
518557 # Retrieve the IP/Port of UE
519558 $var(orig_id_ue_ip) = $fU;
520559 $var(ue_sip_ip_addr) = $sht(user_sip_ips =>$var(orig_id_ue_ip));
@@ -544,6 +583,15 @@ route[N5_PATCH_REQ] {
544583 $var(sdp_answ_codec) = $(rb{line.sw,a =rtpmap}{s.select,1, });
545584 xlog(" L_INFO" , " SDP Answer connection Info is: $var(sdp_answ_ip), RTP port $var(sdp_answ_port), RTCP Port $var(sdp_answ_rtcp_port) and codec is $var(sdp_answ_codec)\n" );
546585
586+ if(sdp_with_media(" video" )) {
587+ # Retrieve SDP Connection Info from SDP Answer for Video
588+ $var(sdp_answ_port_vid) = $(rb{line.sw,m =video}{s.select,1, });
589+ $var(rtcp_vid_plus) = 1;
590+ $var(sdp_answ_rtcp_port_vid) = $var(rtcp_vid_plus) + $var(sdp_answ_port_vid);
591+ $var(sdp_answ_codec_vid) = $(rb{line.sw,a =rtpmap}{s.select,1, });
592+ xlog(" L_INFO" , " SDP Answer connection Info is: $var(sdp_answ_ip), Video RTP port $var(sdp_answ_port_vid), RTCP Port $var(sdp_answ_rtcp_port_vid) and codec is $var(sdp_answ_codec_vid)\n" );
593+ }
594+
547595 # Retrieve AppSession Id
548596 $var(user_id_inv_rep) = $fU;
549597 $var(user_appsess_inv_rep) = $sht(user_data =>$var(user_id_inv_rep));
@@ -561,13 +609,13 @@ route[N5_PATCH_REQ] {
561609 jansson_set(" string" , " afAppId" , " +g.3gpp.icsi-ref=\" urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel\" " , " $var(payload)" );
562610 jansson_set(" string" , " dnn" , " ims" , " $var(payload)" );
563611
564- # Set media components
612+ # Set media components for Audio
565613 jansson_set(" integer" , " medCompN" , 1, " $var(medComp)" );
566614 jansson_set(" string" , " qosReference" , " qosVoNR" , " $var(medComp)" );
567615 jansson_set(" string" , " medType" , " AUDIO" , " $var(medComp)" );
568616 jansson_set(" array" , " codecs" , " [\" downlink\\n$var(sdp_answ_codec)\\n\" , \" uplink\\n$var(sdp_answ_codec)\\n\" ]" , " $var(medComp)" );
569617
570- # RTP
618+ # RTP Audio
571619 jansson_set(" integer" , " fNum" , 1, " $var(medSubComp1)" );
572620 jansson_set(" array" , " fDescs" , " [\" permit out 17 from $var(sdp_answ_ip) $var(sdp_answ_port) to $var(ue_sdp_ip) $var(ue_sdp_port)\" , \" permit in 17 from $var(ue_sdp_ip) $var(ue_sdp_port) to $var(sdp_answ_ip) $var(sdp_answ_port)\" ]" , " $var(medSubComp1)" );
573621 jansson_set(" string" , " fStatus" , " ENABLED" , " $var(medSubComp1)" );
@@ -576,7 +624,7 @@ route[N5_PATCH_REQ] {
576624 jansson_set(" string" , " flowUsage" , " NO_INFO" , " $var(medSubComp1)" );
577625
578626
579- # RTCP
627+ # RTCP Audio
580628 jansson_set(" integer" , " fNum" , 2, " $var(medSubComp2)" );
581629 jansson_set(" array" , " fDescs" , " [\" permit out 17 from $var(sdp_answ_ip) $var(sdp_answ_rtcp_port) to $var(ue_sdp_ip) $var(ue_sdp_rtcp_port)\" , \" permit in 17 from $var(ue_sdp_ip) $var(ue_sdp_rtcp_port) to $var(sdp_answ_ip) $var(sdp_answ_rtcp_port)\" ]" , " $var(medSubComp2)" );
582630 jansson_set(" string" , " fStatus" , " ENABLED" , " $var(medSubComp2)" );
@@ -589,7 +637,44 @@ route[N5_PATCH_REQ] {
589637 jansson_set(" obj" , " 1" , " $var(medSubComp2)" , " $var(medSubComps)" );
590638 jansson_set(" obj" , " medSubComps" , " $var(medSubComps)" , " $var(medComp)" );
591639
640+ # Now in case of a ReInvite with Video, we need to update the N5 QoS Request with the Video Flow Info
641+ if(sdp_with_media(" video" )) {
642+ xlog(" L_INFO" , " Video Call has been started, adding Video N5 QoS..." );
643+
644+ # Set medComponents for Video
645+ jansson_set(" integer" , " medCompN" , 2, " $var(medComp_vid)" );
646+ jansson_set(" string" , " qosReference" , " qosVoNR" , " $var(medComp_vid)" );
647+ jansson_set(" string" , " medType" , " VIDEO" , " $var(medComp_vid)" );
648+ jansson_set(" array" , " codecs" , " [\" downlink\\noffer\\n\" , \" uplink\\nanswer\\n\" ]" , " $var(medComp_vid)" );
649+
650+ # RTP Video
651+ jansson_set(" integer" , " fNum" , 1, " $var(medSubComp_vid1)" );
652+ jansson_set(" array" , " fDescs" , " [\" permit out 17 from any to any\" , \" permit in 17 from any to any\" ]" , " $var(medSubComp_vid1)" );
653+ jansson_set(" string" , " fStatus" , " ENABLED" , " $var(medSubComp_vid1)" );
654+ jansson_set(" string" , " marBwDl" , " 5000 Kbps" , " $var(medSubComp_vid1)" );
655+ jansson_set(" string" , " marBwUl" , " 3000 Kbps" , " $var(medSubComp_vid1)" );
656+ jansson_set(" string" , " flowUsage" , " NO_INFO" , " $var(medSubComp_vid1)" );
657+
658+
659+ # RTCP Video
660+ jansson_set(" integer" , " fNum" , 2, " $var(medSubComp_vid2)" );
661+ jansson_set(" array" , " fDescs" , " [\" permit out 17 from any to any\" , \" permit in 17 from any to any\" ]" , " $var(medSubComp_vid2)" );
662+ jansson_set(" string" , " fStatus" , " ENABLED" , " $var(medSubComp_vid2)" );
663+ jansson_set(" string" , " marBwDl" , " 5000 Kbps" , " $var(medSubComp_vid2)" );
664+ jansson_set(" string" , " marBwUl" , " 3000 Kbps" , " $var(medSubComp_vid2)" );
665+ jansson_set(" string" , " flowUsage" , " RTCP" , " $var(medSubComp_vid2)" );
666+
667+ # Merging the flows under MediaSubComponent for Video
668+ jansson_set(" obj" , " 2" , " $var(medSubComp_vid1)" , " $var(medSubComps_vid)" );
669+ jansson_set(" obj" , " 3" , " $var(medSubComp_vid2)" , " $var(medSubComps_vid)" );
670+ jansson_set(" obj" , " medSubComps" , " $var(medSubComps_vid)" , " $var(medComp_vid)" );
671+ } # End if Video
672+
673+ # Merging all Flows under MediaComponent
592674 jansson_set(" obj" , " 0" , " $var(medComp)" , " $var(medComponents)" );
675+ if(sdp_with_media(" video" )) {
676+ jansson_set(" obj" , " 1" , " $var(medComp_vid)" , " $var(medComponents)" );
677+ }
593678 jansson_set(" obj" , " medComponents" , " $var(medComponents)" , " $var(payload)" );
594679
595680 xlog(" L_INFO" ," DEBUG: Set evSubsc\n" );
0 commit comments