<div dir="ltr"><div>Hi David, </div><div><br></div><div>As Alex said, K is a proxy. If you strictly want to use something like K, then I would suggest yo have a look at the rtp_media_server module:<br></div><div><br></div><div><a href="https://www.kamailio.org/docs/modules/devel/modules/rtp_media_server.html" target="_blank">https://www.kamailio.org/docs/modules/devel/modules/rtp_media_server.html</a><br></div><div><br></div><div>Only available in master branch (5.3), but worth giving a try if you ask me... It might simplify and achieve what you need.</div><div><br></div><div>Joel.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 15, 2019 at 12:50 PM Alex Balashov <<a href="mailto:abalashov@evaristesys.com" target="_blank">abalashov@evaristesys.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi David,<br>
<br>
Kamailio is a proxy, so it cannot endogenously originate either requests<br>
or most replies. A 200 OK to an INVITE transaction can only come from a<br>
user agent (endpoint), and Kamailio's sole job is to forward it. So, the<br>
200 OK is going to come from the auto-answering callee. <br>
<br>
To engage RTPEngine in both directions, you need to intercept the 200 OK<br>
that is generated from the callee and call rtpengine_answer() /<br>
rtpengine_manage() on it:<br>
<br>
---<br>
route {<br>
   ...<br>
<br>
   if(is_method("INVITE")) {<br>
      ...<br>
<br>
      rtpengine_offer("...");<br>
<br>
      t_on_reply("REPLY");<br>
<br>
      if(!t_relay())<br>
         sl_reply_error();<br>
<br>
      exit;<br>
   }<br>
<br>
   ...<br>
}<br>
<br>
onreply_route[REPLY] {<br>
   if(is_method("INVITE") && sdp_content()) <br>
      rtpengine_answer("...");<br>
}<br>
---<br>
<br>
-- Alex<br>
<br>
On Mon, Apr 15, 2019 at 07:41:22PM +0000, David Dean wrote:<br>
<br>
> Hi all,<br>
> I'm building an automated load testing system for an rtp media server with TURN that uses Kamailio for SIP.<br>
> When a client sends an INVITE to Kamailio, I need Kamailio to respond with "200 OK" and the SDP generated by rtpengine.<br>
> 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>
> 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>
> How can I get Kamailio to send a "200 OK" and add the rtpengine_answer into the body?<br>
> Appreciate any help, I've been struggling with this for three days.<br>
> Cheers.<br>
> <br>
> rtpengine_offer("SIP-source-address ICE=force-relay RTP");send_reply("200", "OK");<br>
> <br>
<br>
> _______________________________________________<br>
> Kamailio (SER) - Users Mailing List<br>
> <a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
> <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br>
<br>
-- <br>
Alex Balashov | Principal | Evariste Systems LLC<br>
<br>
Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free) <br>
Web: <a href="http://www.evaristesys.com/" rel="noreferrer" target="_blank">http://www.evaristesys.com/</a>, <a href="http://www.csrpswitch.com/" rel="noreferrer" target="_blank">http://www.csrpswitch.com/</a><br>
<br>
_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div>