<html><head></head><body><div class="ydp4eedb6eayahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div></div>
        <div>Hi Alex,</div><div><br></div><div>Thanks for the tip re: rtpengine routing, that's really useful.</div><div><br></div><div>The flow I'm trying to create is like this:</div><div><br></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></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></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></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></span></div><div><span>Thanks.</span></div><div><span><br></span></div><div><span><span style="color: rgb(0, 0, 0); font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><br></span></span></div><div><br></div>
        
        </div><div id="yahoo_quoted_5920208827" class="yahoo_quoted">
            <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 <abalashov@evaristesys.com> wrote:
                </div>
                <div><br></div>
                <div><br></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="yqt3180297776" id="yqtfd90709"><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 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"><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 shape="rect" href="http://www.evaristesys.com/, " target="_blank">http://www.evaristesys.com/, </a><a shape="rect" href="http://www.csrpswitch.com/" target="_blank">http://www.csrpswitch.com/</a><br clear="none"><br clear="none">_______________________________________________<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><div class="yqt3180297776" id="yqtfd68785"><br clear="none"></div></div>
            </div>
        </div></body></html>