<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix"><tt>Hi, Ali!<br>
        <br>
        The reINVITES should be handled similar to INVITEs, with an
        offer for the request and an answer for the reply. But indeed,
        there's no way to recover from a rejected reINVITE.<br>
        Actually the problem is a bit deeper and I don't really know how
        this should be handled. It depends on whether the client sends
        the re-invite to create a new media stream, or update the old
        one. In the first case, RTPProxy should create a new media
        stream and if that one fails, only delete the latter one - this
        is not supported by RTPProxy. In the second case, the entire
        media should be seized, and this is how it works now :).<br>
        <br>
        Best regards,<br>
      </tt>
      <pre class="moz-signature" cols="72">Răzvan Crainea
OpenSIPS Solutions
<a class="moz-txt-link-abbreviated" href="http://www.opensips-solutions.com">www.opensips-solutions.com</a></pre>
      On 11/14/2014 03:30 AM, Jeff Pyle wrote:<br>
    </div>
    <blockquote
cite="mid:CACYJG3LDeqJKmHCr36TVP-wgxzEsoC80j+H=Ucw3b18ynjOz6Q@mail.gmail.com"
      type="cite">
      <div dir="ltr">Ali,
        <div><br>
        </div>
        <div>This is what I use within loose_route() to handle
          rtpproxy.  In my particular case I'm bridging between two
          interfaces.</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <blockquote style="margin:0 0 0 40px;border:none;padding:0px">
          <div>
            <div>
              <div>
                <div><font face="monospace">if
                    (has_body("application/sdp"))  {</font></div>
              </div>
            </div>
          </div>
          <div>
            <div><font face="monospace">         # Begin rtp session
                update gyrations</font></div>
          </div>
          <div>
            <div><font face="monospace">         if (method == "INVITE")
                {</font></div>
          </div>
          <div>
            <div><font face="monospace">                 # INVITE w/
                SDP, so early neg</font></div>
          </div>
          <div>
            <div><font face="monospace">                 # This is
                offer, reply is answer</font></div>
          </div>
          <div>
            <div><font face="monospace">               
                 rtpproxy_offer("frocl");</font></div>
          </div>
          <div>
            <div><font face="monospace">               
                 t_on_reply("1");</font></div>
          </div>
          <div>
            <div><font face="monospace">         } else if (method ==
                "ACK") {</font></div>
          </div>
          <div>
            <div><font face="monospace">                 # ACK w/ SDP,
                so late neg (done now)</font></div>
          </div>
          <div>
            <div><font face="monospace">                 # This is
                answer</font></div>
          </div>
          <div>
            <div><font face="monospace">               
                 rtpproxy_answer("frocl");</font></div>
          </div>
          <div>
            <div><font face="monospace">         } </font></div>
          </div>
          <div>
            <div><font face="monospace"> } else {</font></div>
          </div>
          <div>
            <div><font face="monospace">         if (method == "INVITE")
                {</font></div>
          </div>
          <div>
            <div><font face="monospace">                 # INVITE w/o
                SDP, so late neg</font></div>
          </div>
          <div>
            <div><font face="monospace">                 # This is
                nothing, reply is offer, ACK is answer (~5 lines up)</font></div>
          </div>
          <div>
            <div><font face="monospace">               
                 t_on_reply("2");</font></div>
          </div>
          <div>
            <div><font face="monospace">         } else {</font></div>
          </div>
          <div>
            <div><font face="monospace">               
                 t_on_reply("1");</font></div>
          </div>
          <div>
            <div><font face="monospace">         }</font></div>
          </div>
          <div>
            <div><font face="monospace"> }</font></div>
          </div>
        </blockquote>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>And then:</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <blockquote style="margin:0 0 0 40px;border:none;padding:0px">
          <div>
            <div><font face="monospace">onreply_route[1] {      # Manage
                content as necessary - early negotiation</font></div>
          </div>
          <div>
            <div><font face="monospace">        if
                (has_body("application/sdp")) {</font></div>
          </div>
          <div>
            <div><font face="monospace">                if ($DLG_status)
                {      # Update</font></div>
          </div>
          <div>
            <div><font face="monospace">                       
                rtpproxy_answer("frocl");</font></div>
          </div>
          <div>
            <div><font face="monospace">                } else {        
                       # New</font></div>
          </div>
          <div>
            <div><font face="monospace">                       
                rtpproxy_answer("froc");</font></div>
          </div>
          <div>
            <div><font face="monospace">                }</font></div>
          </div>
          <div>
            <div><font face="monospace">        }</font></div>
          </div>
          <div>
            <div><font face="monospace">}</font></div>
          </div>
          <div>
            <div><br>
            </div>
          </div>
          <div>
            <div><br>
            </div>
          </div>
          <div>
            <div><font face="monospace">onreply_route[2] {      # Manage
                content as necessary - late negotiation - update</font></div>
          </div>
          <div>
            <div><font face="monospace">        if
                (has_body("application/sdp")) {</font></div>
          </div>
          <div>
            <div><font face="monospace">               
                rtpproxy_offer("frocl");</font></div>
          </div>
          <div>
            <div><font face="monospace">        }</font></div>
          </div>
          <div>
            <div><font face="monospace">}</font></div>
          </div>
        </blockquote>
        <div><br>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>This does not handle rejected reinvites.  I don't know how
          to solve that one.  Otherwise, it works well, although in some
          spots it may be overkill.</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>- Jeff</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div class="gmail_extra"><br>
          <div class="gmail_quote">On Thu, Nov 13, 2014 at 5:13 PM, Ali
            Pey <span dir="ltr">&lt;<a moz-do-not-send="true"
                href="mailto:alipey@gmail.com" target="_blank">alipey@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 dir="ltr">Hello,
                <div><br>
                </div>
                <div>What's the best way of handling rtpproxy with
                  re-invites? </div>
                <div><br>
                </div>
                <div>Should I do unforce and then offer/answer? What if
                  the re-invite gets rejected?</div>
                <div><br>
                </div>
                <div>Any help appreciated.</div>
                <div><br>
                </div>
                <div>Thanks,</div>
                <div>Ali Pey</div>
                <div><br>
                </div>
              </div>
              <br>
              _______________________________________________<br>
              Users mailing list<br>
              <a moz-do-not-send="true"
                href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
              <a moz-do-not-send="true"
                href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
                target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
              <br>
            </blockquote>
          </div>
          <br>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>