I am using Freeswitch as an SBC behind Kamailio, and my external calls are routed via freeswitch. In those calls the music on hold works as it is handled by freeswitch. Ideally I would like to somehow redirect when a call is put on hold to the MOH extension. The other option is by using rtpproxy. I could not find any documentation on rtpproxy and would really appreciate it if someone could lead me to it or give me a brief overview on how to go about using rtpproxy_stream2uac to play music whenever a call is put on hold. <br>

<br><div class="gmail_quote">On Wed, Dec 21, 2011 at 4:50 AM, Daniel-Constantin Mierla <span dir="ltr">&lt;<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hello,<div class="im"><br>
<br>
On 12/21/11 7:49 AM, Olle E. Johansson wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
20 dec 2011 kl. 22:40 skrev Gautam Batra:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
Thanks for your replies. Is it possible to play an audio file in the case of a re-invite directly from kamailio instead of freeswitch by using rtpproxy_stream2uac() or something similar?<br>
</blockquote>
Kamailioi is still a proxy and from the endpoint point of view is not involved in the media plane. If you managed to do that many<br>
endpoints would ignore the packets or see them as a DOS attack attempt. Other endpoints might just play them.<br>
In later releases of Asterisk, we lock to the IP address of the peer and would ignore these. Asterisk used to send music-on-hold<br>
like this before, but we considered it a security issue and started reinviting to make Asterisk involved in the call again to play<br>
music on hold. Asterisk can do that, because it&#39;s a b2bua and is an endpoint in the call. Kamailio can&#39;t initiate a reinvite in the<br>
call.<br>
</blockquote></div>
indeed, kamailio cannot initiate re-invites. You can play an audio file via rtpproxy and rtpproxy_stream2uac() if you use rtpproxy relaying from the beginning of the call. Otherwise, use a sip b2bua which does signaling only until you need to play audio and do re-invites so it gets in media path.<br>


<br>
Besides Asterisk or FreeSWITCH, a lightweight b2bua that probably offers such functionality is sems (sip express media server) -- I CC-ed Stefan, he can confirm and even give some leads of how to do it.<br>
<br>
Cheers,<br>
Daniel<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
<br>
/O<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Gautam<br>
<br>
On Mon, Dec 12, 2011 at 4:50 AM, Olle E. Johansson&lt;<a href="mailto:oej@edvina.net" target="_blank">oej@edvina.net</a>&gt;  wrote:<br>
<br>
12 dec 2011 kl. 10:45 skrev Daniel-Constantin Mierla:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello,<br>
<br>
On 12/9/11 9:04 PM, Gautam Batra wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello,<br>
<br>
I have a kamailio sip proxy server with freeswitch acting as SBC. I want to redirect the call to freeswitch when hold is pressed so that i can play music on hold. I tried this by using rewritehostport in case of a re-invite, but the call drops in that case. Could someone please help me with this?<br>


</blockquote>
it is not possible to redirect established calls (it breaks the RFC3261), you have to route the call through freeswitch from its start. Perhaps you can use freeswitch without relaying the media in first place and when you have on hold, you set media patch to go through freeswitch.<br>


</blockquote>
The only solution is having FreeSwitch send an invite with replaces to grab the call. The question is how to get it back.<br>
<br>
/O<br>
<br>
<br>
</blockquote>
---<br>
* Olle E Johansson - <a href="mailto:oej@edvina.net" target="_blank">oej@edvina.net</a><br>
* Cell phone <a href="tel:%2B46%2070%20593%2068%2051" value="+46705936851" target="_blank">+46 70 593 68 51</a>, Office <a href="tel:%2B46%208%2096%2040%2020" value="+468964020" target="_blank">+46 8 96 40 20</a>, Sweden<br>


<br>
<br>
<br>
<br></div>
______________________________<u></u>_________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/<u></u>cgi-bin/mailman/listinfo/sr-<u></u>users</a><br>
</blockquote><div class="HOEnZb"><div class="h5">
<br>
-- <br>
Daniel-Constantin Mierla -- <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a><br>
<a href="http://linkedin.com/in/miconda" target="_blank">http://linkedin.com/in/miconda</a> -- <a href="http://twitter.com/miconda" target="_blank">http://twitter.com/miconda</a><br>
<br>
</div></div></blockquote></div><br>