Looks like if I put t_newtran(); in the main route this created the transaction and allowed the ACK to be recognized. Now How do I force Opensips to send a BYE.
Thank you. On Fri, Nov 10, 2023 at 11:44 AM Kevin Kennedy <[email protected]> wrote: > > > >>>>>>>> I was able to get audio, The problem I was having is the >>>>>>>> Originator string in the SDP. However, I am still having the same >>>>>>>> issue >>>>>>>> with accepting the ACK from the Originator and not resending the 200OK. >>>>>>>> Can someone please help with this issue? >>>>>>>> >>>>>>>> Thank you >>>>>>>> >>>>>>>> *Code snippet for the Late Media route* >>>>>>>> route["LateMedia3"]{ >>>>>>>> if (has_body("application/sdp")) { >>>>>>>> xlog("######## Entered route LateMedia3 with Fake SDP from >>>>>>>> Originator ########\r\n"); >>>>>>>> rtpengine_offer(); >>>>>>>> $json(reply) := $rtpquery; >>>>>>>> >>>>>>>> $var(port)=$json_pretty(reply/tags/$ft/medias[0]/streams[0]/local >>>>>>>> port); >>>>>>>> >>>>>>>> $var(addr)=$json_pretty(reply/tags/$ft/medias[0]/streams[0]/local >>>>>>>> address); >>>>>>>> remove_body_part(); >>>>>>>> append_to_reply("Contact:<sip:$rU@ >>>>>>>> $socket_in(ip):$socket_in(port);user=phone>\r\n"); >>>>>>>> append_to_reply("Content-Type: application/sdp\r\n"); >>>>>>>> $var(body) = $(rb{re.subst,/(IP4.).*/\1$var(addr)/g}); >>>>>>>> $var(body) = >>>>>>>> $(var(body){re.subst,/(audio.)...../\1$var(port)/g}); >>>>>>>> t_reply_with_body(200, "OK", $var(body)); >>>>>>>> rtpengine_play_media("call-id=$ci from-tag=$ft >>>>>>>> file=/etc/rtpengine/unk_num.wav"); >>>>>>>> async(sleep(10), after_media); >>>>>>>> } else { >>>>>>>> xlog("######## Entered route LateMedia3 No SDP received, >>>>>>>> Create one from variable ########\r\n"); >>>>>>>> $var(newbody) = ("v=0\r\no=Opensips " + $Ts + " 0 IN IP4 >>>>>>>> 10.255.100.147\r\ns=-\r\nc=IN IP4 10.255.100.147\r\nt=0 0\r\nm=audio >>>>>>>> 3140 >>>>>>>> RTP/AVP 0 101\r\na >>>>>>>> =sendrecv\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:101 >>>>>>>> telephone-event/8000\r\na=fmtp:101 0-15\r\n"); >>>>>>>> xlog("######################### Body to RTPENGINE is >>>>>>>> ###########################\r\n$var(newbody)\r\n"); >>>>>>>> rtpengine_offer("from-tag=$ft replace-session-connection >>>>>>>> trust-address replace-origin >>>>>>>> codec-strip-g729",,$var(body),$var(newbody)); >>>>>>>> xlog("######################### Body from RTPENGINE is >>>>>>>> ###########################\r\n$var(body)\r\n"); >>>>>>>> $json(reply) := $rtpquery; >>>>>>>> >>>>>>>> $var(port)=$json_pretty(reply/tags/$ft/medias[0]/streams[0]/local >>>>>>>> port); >>>>>>>> >>>>>>>> $var(addr)=$json_pretty(reply/tags/$ft/medias[0]/streams[0]/local >>>>>>>> address); >>>>>>>> append_to_reply("Contact:<sip:$rU@ >>>>>>>> $socket_in(ip):$socket_in(port);transport=udp>\r\n"); >>>>>>>> append_to_reply("Content-Type: application/sdp\r\n"); >>>>>>>> $var(body) = >>>>>>>> $(var(body){re.subst,/(IP4.).*/\1$var(addr)/g}); >>>>>>>> $var(body) = >>>>>>>> $(var(body){re.subst,/(audio.)...../\1$var(port)/g}); >>>>>>>> xlog("######################### Body being sent in Reply is >>>>>>>> ######################\r\n$var(body)\r\n"); >>>>>>>> t_reply_with_body(200, "OK", $var(body)); >>>>>>>> rtpengine_play_media("call-id=$ci from-tag=$ft >>>>>>>> file=/etc/rtpengine/unk_num.wav"); >>>>>>>> async(sleep(10), after_media); >>>>>>>> } >>>>>>>> } >>>>>>>> >>>>>>>> route[after_media] >>>>>>>> { if (t_was_cancelled()) { >>>>>>>> rtpengine_delete(); >>>>>>>> exit; >>>>>>>> } else { >>>>>>>> rtpengine_delete(); >>>>>>>> sl_send_reply(486,"Busy here"); >>>>>>>> exit; >>>>>>>> } >>>>>>>> } >>>>>>>> >>>>>>>
_______________________________________________ Users mailing list [email protected] http://lists.opensips.org/cgi-bin/mailman/listinfo/users
