<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">Again, the SIP standards forbid this, because proxies just don’t do that!<br><br><div id="AppleMailSignature" dir="ltr">—<div>Sent from mobile, with due apologies for brevity and errors.</div></div><div dir="ltr"><br>On Apr 16, 2019, at 3:57 AM, David Dean <<a href="mailto:just_bytesize@yahoo.co.uk">just_bytesize@yahoo.co.uk</a>> wrote:<br><br></div><blockquote type="cite"><div dir="ltr"><div class="ydpd788dcbayahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div></div>
        <div>As you say, the rtpengine SDP mangling is turn-key with rtpengine_answer(). It's working perfectly.</div><div><br></div><div>But I'm surprised to find I cannot generate a 200 OK and attach the SDP inside Kamailio.</div><div><br></div><div><span>sl_send_reply() would be perfect but it doesn't allow a body to be attached (unless I missed something in the docs?)</span><br></div><div><span><br></span></div><div><span><span>uac_req() allows the headers and body to be created but doesn't allow a status code to be set (as far as I know?)</span><br></span></div><div><span><span><br></span></span></div><div><span><span>So frustrating because I've been able to script everything else I need within Kamailio. The missing piece is being able to create this response then everything works.</span></span></div><div><span><span><br></span></span></div><div><span><span>Dave.</span></span></div><div><span><span><br></span></span></div><div><span><span><br></span></span></div><div><span><span><br></span></span></div><div><span><span><br></span></span></div><div><br></div>
        
        </div><div id="yahoo_quoted_6393483419" class="yahoo_quoted">
            <div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
                
                <div>
                    On Tuesday, 16 April 2019, 00:21:07 BST, Alex Balashov <<a href="mailto:abalashov@evaristesys.com">abalashov@evaristesys.com</a>> wrote:
                </div>
                <div><br></div>
                <div><br></div>
                <div><div id="yiv4393254985"><div>Kamailio will substitute RTPEngine-mangled SDP upon your invocation of rtpengine_answer(). You’re working about a thousand times too hard on this issue; it’s already turn-key. :-)<br clear="none"><br clear="none"><div dir="ltr" id="yiv4393254985AppleMailSignature">—<div>Sent from mobile, with due apologies for brevity and errors.</div></div><div class="yiv4393254985yqt3774541541" id="yiv4393254985yqt95442"><div dir="ltr"><br clear="none">On Apr 15, 2019, at 6:03 PM, David Dean <<a rel="nofollow" shape="rect" ymailto="mailto:just_bytesize@yahoo.co.uk" target="_blank" href="mailto:just_bytesize@yahoo.co.uk">just_bytesize@yahoo.co.uk</a>> wrote:<br clear="none"><br clear="none"></div><blockquote type="cite"><div dir="ltr"><div class="yiv4393254985ydp4eedb6eayahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div></div>
        <div>Hi Alex,</div><div><br clear="none"></div><div>Thanks for the tip re: rtpengine routing, that's really useful.</div><div><br clear="none"></div><div>The flow I'm trying to create is like this:</div><div><br clear="none"></div><div>[ Test Client ] ------> INVITE <span><span style="color:rgb(0, 0, 0);font-family:Helvetica Neue, Helvetica, Arial, sans-serif;">------> [ Kamailio ]</span></span></div><div><span><span style="color:rgb(0, 0, 0);font-family:Helvetica Neue, Helvetica, Arial, sans-serif;">          ^                                                   |</span></span></div><div><span><span style="color:rgb(0, 0, 0);font-family:Helvetica Neue, Helvetica, Arial, sans-serif;">          |-------------- 200 OK + SDP --------|</span></span></div><div><span><span style="color:rgb(0, 0, 0);font-family:Helvetica Neue, Helvetica, Arial, sans-serif;"><br clear="none"></span></span></div><div>The goal is for the test client to think a remote client accepted the call, when actually it's just Kamailio faking the 200 response.</div><div><br clear="none"></div><div>There must be some way (even if it's hacky!) to get a 200 response back to the client with the rtpengine SDP included?</div><div><br clear="none"></div><div>I got very close with <span>$uac_req but it doesn't seem to be able to set the "200" status so the Test Client thought it was a brand new call. If I could set the 200 status with $uac_req (or something similar) then this will be working.</span></div><div><span><br clear="none"></span></div><div><span>Thanks.</span></div><div><span><br clear="none"></span></div><div><span><span style="color:rgb(0, 0, 0);font-family:Helvetica Neue, Helvetica, Arial, sans-serif;"><br clear="none"></span></span></div><div><br clear="none"></div>
        
        </div><div class="yiv4393254985yahoo_quoted" id="yiv4393254985yahoo_quoted_5920208827">
            <div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
                
                <div>
                    On Monday, 15 April 2019, 20:50:18 BST, Alex Balashov <<a rel="nofollow" shape="rect" ymailto="mailto:abalashov@evaristesys.com" target="_blank" href="mailto:abalashov@evaristesys.com">abalashov@evaristesys.com</a>> wrote:
                </div>
                <div><br clear="none"></div>
                <div><br clear="none"></div>
                <div>Hi David,<br clear="none"><br clear="none">Kamailio is a proxy, so it cannot endogenously originate either requests<br clear="none">or most replies. A 200 OK to an INVITE transaction can only come from a<br clear="none">user agent (endpoint), and Kamailio's sole job is to forward it. So, the<br clear="none">200 OK is going to come from the auto-answering callee. <br clear="none"><br clear="none">To engage RTPEngine in both directions, you need to intercept the 200 OK<br clear="none">that is generated from the callee and call rtpengine_answer() /<br clear="none">rtpengine_manage() on it:<br clear="none"><br clear="none">---<br clear="none">route {<br clear="none">   ...<br clear="none"><br clear="none">   if(is_method("INVITE")) {<br clear="none">      ...<br clear="none"><br clear="none">      rtpengine_offer("...");<br clear="none"><br clear="none">      t_on_reply("REPLY");<br clear="none"><br clear="none">      if(!t_relay())<br clear="none">         sl_reply_error();<br clear="none"><br clear="none">      exit;<br clear="none">   }<br clear="none"><br clear="none">   ...<br clear="none">}<br clear="none"><br clear="none">onreply_route[REPLY] {<br clear="none">   if(is_method("INVITE") && sdp_content()) <br clear="none">      rtpengine_answer("...");<br clear="none">}<br clear="none">---<br clear="none"><br clear="none">-- Alex<br clear="none"><div class="yiv4393254985yqt3180297776" id="yiv4393254985yqtfd90709"><br clear="none">On Mon, Apr 15, 2019 at 07:41:22PM +0000, David Dean wrote:<br clear="none"><br clear="none">> Hi all,<br clear="none">> I'm building an automated load testing system for an rtp media server with TURN that uses Kamailio for SIP.<br clear="none">> When a client sends an INVITE to Kamailio, I need Kamailio to respond with "200 OK" and the SDP generated by rtpengine.<br clear="none">> I've enabled auto-answer in the client, so as soon as it receives the response from Kamailio it will start sending RTP packets.<br clear="none">> Right now I'm using send_reply("200", "OK"); which is sending the right 200 response back to the client, but it doesn't include any body.<br clear="none">> How can I get Kamailio to send a "200 OK" and add the rtpengine_answer into the body?<br clear="none">> Appreciate any help, I've been struggling with this for three days.<br clear="none">> Cheers.<br clear="none">> <br clear="none">> rtpengine_offer("SIP-source-address ICE=force-relay RTP");send_reply("200", "OK");</div><br clear="none">> <br clear="none"><br clear="none">> _______________________________________________<br clear="none">> Kamailio (SER) - Users Mailing List<br clear="none">> <a rel="nofollow" shape="rect" ymailto="mailto:sr-users@lists.kamailio.org" target="_blank" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a><br clear="none">> <a rel="nofollow" shape="rect" target="_blank" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br clear="none"><br clear="none"><br clear="none">-- <br clear="none">Alex Balashov | Principal | Evariste Systems LLC<br clear="none"><br clear="none">Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free) <br clear="none">Web: <a rel="nofollow" shape="rect" target="_blank" href="http://www.evaristesys.com/, ">http://www.evaristesys.com/, </a><a rel="nofollow" shape="rect" target="_blank" href="http://www.csrpswitch.com/">http://www.csrpswitch.com/</a><br clear="none"><br clear="none">_______________________________________________<br clear="none">Kamailio (SER) - Users Mailing List<br clear="none"><a rel="nofollow" shape="rect" ymailto="mailto:sr-users@lists.kamailio.org" target="_blank" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a><br clear="none"><a rel="nofollow" shape="rect" target="_blank" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><div class="yiv4393254985yqt3180297776" id="yiv4393254985yqtfd68785"><br clear="none"></div></div>
            </div>
        </div></div></blockquote></div><blockquote type="cite"><div dir="ltr"><span>_______________________________________________</span><br clear="none"><span>Kamailio (SER) - Users Mailing List</span><br clear="none"><span><a rel="nofollow" shape="rect" ymailto="mailto:sr-users@lists.kamailio.org" target="_blank" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a></span><br clear="none"><span><a rel="nofollow" shape="rect" target="_blank" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a></span><br clear="none"></div></blockquote></div></div><div class="yqt3774541541" id="yqt24981">_______________________________________________<br clear="none">Kamailio (SER) - Users Mailing List<br clear="none"><a shape="rect" ymailto="mailto:sr-users@lists.kamailio.org" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a><br clear="none"><a shape="rect" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br clear="none"></div></div>
            </div>
        </div></div></blockquote><blockquote type="cite"><div dir="ltr"><span>_______________________________________________</span><br><span>Kamailio (SER) - Users Mailing List</span><br><span><a href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a></span><br><span><a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a></span><br></div></blockquote></body></html>