Thanks Daniel, I wasn&#39;t starting rtpproxy properly. So the initial error is gone. But in my script when the rtpproxy_stream2uac is called i get the following log:<br><br>Dec 22 08:18:44 vps daemon.err /usr/sbin/kamailio[7901]: ERROR: rtpproxy [rtpproxy.c:1581]: script error -no valid set selected<br>

Dec 22 08:18:44 vps daemon.err /usr/sbin/kamailio[7901]: ERROR: rtpproxy [rtpproxy_stream.c:113]: no available proxies<br><br>I have given the following commands at the beginning of the call:<br>set_rtp_proxy_set(&quot;0&quot;);<br>

rtpproxy_manage();<br><br>And when hold is pressed I&#39;ve called stream2uac. Where am I going wrong? Could you also tell if rtpproxy_stream2uac will be able to play .wav files directly?<br><br>Thanks for your help.<br>
<br>
Gautam<br><br><div class="gmail_quote">On Thu, Dec 22, 2011 at 7:38 AM, Daniel-Constantin Mierla <span dir="ltr">&lt;<a href="mailto:miconda@gmail.com" target="_blank">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">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    Can you give the output of:<br>
    <br>
    ps auxw | grep -i rtpproxy<br>
    <br>
    That will show if rtpproxy is running and what is its control
    socket.<br>
    <br>
    Cheers,<br>
    Daniel<div><div><br>
    <br>
    On 12/21/11 11:25 PM, Gautam Batra wrote:
    <blockquote type="cite">I&#39;m not able to set up the rtp proxy module. I have
      entered the following:<br>
      <br>
      loadmodule &quot;rtpproxy.so&quot;<br>
      modparam (&quot;rtpproxy&quot;, &quot;rtpproxy_sock&quot;, &quot;udp:X.Y.Z.W:22222&quot;);<br>
      <br>
      Where X.Y.Z.W is the IP address of my machine (same as that of my
      SIP server). But the log shows the following errors:<br>
      <br>
      Dec 21 13:11:12 abc daemon.err /usr/sbin/kamailio[9984]: ERROR:
      rtpproxy [rtpproxy.c:1503]: can&#39;t send command to a RTP proxy<br>
      Dec 21 13:11:12 abc daemon.err /usr/sbin/kamailio[9984]: ERROR:
      rtpproxy [rtpproxy.c:1538]: proxy &lt;udp:X.Y.Z.W:22222&gt; does
      not respond, disable it<br>
      Dec 21 13:11:12 abc daemon.warn /usr/sbin/kamailio[9984]: WARNING:
      rtpproxy [rtpproxy.c:1395]: can&#39;t get version of the RTP proxy<br>
      Dec 21 13:11:12 abc daemon.warn /usr/sbin/kamailio[9984]: WARNING:
      rtpproxy [rtpproxy.c:1432]: support for RTP proxy
      &lt;udp:X.Y.Z.W:22222&gt; has been disabled temporarily<br>
      <br>
      Could anyone tell what I&#39;m doing wrong? I tried to run rtpproxy
      separately on the given port before starting kamailio (rtpproxy -s
      udp:X.Y.Z.W:22222), but it didn&#39;t work.<br>
      <br>
      <br>
      <br>
      <div class="gmail_quote">On Wed, Dec 21, 2011 at 2:36 PM, Gautam
        Batra <span dir="ltr">&lt;<a href="mailto:gautambatra24@gmail.com" target="_blank">gautambatra24@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">
          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>
          <div>
            <div>
              <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" target="_blank">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><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>
                      <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>
                    _______________________________________________<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/cgi-bin/mailman/listinfo/sr-users</a><br>
                  </blockquote>
                  <div>
                    <div>
                      <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>
            </div>
          </div>
        </blockquote>
      </div>
      <br>
      <br>
      <fieldset></fieldset>
      <br>
      <pre>_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <br>
    <pre cols="72">-- 
Daniel-Constantin Mierla -- <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a>
<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></pre>
  </div></div></div>

</blockquote></div><br>