RTP Proxy and Re-Invites

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

RTP Proxy and Re-Invites

Ali Pey
Hello,

What's the best way of handling rtpproxy with re-invites? 

Should I do unforce and then offer/answer? What if the re-invite gets rejected?

Any help appreciated.

Thanks,
Ali Pey


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: RTP Proxy and Re-Invites

Jeff Pyle
Ali,

This is what I use within loose_route() to handle rtpproxy.  In my particular case I'm bridging between two interfaces.


if (has_body("application/sdp"))  {
         # Begin rtp session update gyrations
         if (method == "INVITE") {
                 # INVITE w/ SDP, so early neg
                 # This is offer, reply is answer
                 rtpproxy_offer("frocl");
                 t_on_reply("1");
         } else if (method == "ACK") {
                 # ACK w/ SDP, so late neg (done now)
                 # This is answer
                 rtpproxy_answer("frocl");
         } 
 } else {
         if (method == "INVITE") {
                 # INVITE w/o SDP, so late neg
                 # This is nothing, reply is offer, ACK is answer (~5 lines up)
                 t_on_reply("2");
         } else {
                 t_on_reply("1");
         }
 }


And then:


onreply_route[1] {      # Manage content as necessary - early negotiation
        if (has_body("application/sdp")) {
                if ($DLG_status) {      # Update
                        rtpproxy_answer("frocl");
                } else {                # New
                        rtpproxy_answer("froc");
                }
        }
}


onreply_route[2] {      # Manage content as necessary - late negotiation - update
        if (has_body("application/sdp")) {
                rtpproxy_offer("frocl");
        }
}



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.


- Jeff



On Thu, Nov 13, 2014 at 5:13 PM, Ali Pey <[hidden email]> wrote:
Hello,

What's the best way of handling rtpproxy with re-invites? 

Should I do unforce and then offer/answer? What if the re-invite gets rejected?

Any help appreciated.

Thanks,
Ali Pey


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: RTP Proxy and Re-Invites

Razvan Crainea-3
Hi, Ali!

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.
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 :).

Best regards,
Răzvan Crainea
OpenSIPS Solutions
www.opensips-solutions.com
On 11/14/2014 03:30 AM, Jeff Pyle wrote:
Ali,

This is what I use within loose_route() to handle rtpproxy.  In my particular case I'm bridging between two interfaces.


if (has_body("application/sdp"))  {
         # Begin rtp session update gyrations
         if (method == "INVITE") {
                 # INVITE w/ SDP, so early neg
                 # This is offer, reply is answer
                 rtpproxy_offer("frocl");
                 t_on_reply("1");
         } else if (method == "ACK") {
                 # ACK w/ SDP, so late neg (done now)
                 # This is answer
                 rtpproxy_answer("frocl");
         } 
 } else {
         if (method == "INVITE") {
                 # INVITE w/o SDP, so late neg
                 # This is nothing, reply is offer, ACK is answer (~5 lines up)
                 t_on_reply("2");
         } else {
                 t_on_reply("1");
         }
 }


And then:


onreply_route[1] {      # Manage content as necessary - early negotiation
        if (has_body("application/sdp")) {
                if ($DLG_status) {      # Update
                        rtpproxy_answer("frocl");
                } else {                # New
                        rtpproxy_answer("froc");
                }
        }
}


onreply_route[2] {      # Manage content as necessary - late negotiation - update
        if (has_body("application/sdp")) {
                rtpproxy_offer("frocl");
        }
}



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.


- Jeff



On Thu, Nov 13, 2014 at 5:13 PM, Ali Pey <[hidden email]> wrote:
Hello,

What's the best way of handling rtpproxy with re-invites? 

Should I do unforce and then offer/answer? What if the re-invite gets rejected?

Any help appreciated.

Thanks,
Ali Pey


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users




_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: RTP Proxy and Re-Invites

Ali Pey
In reply to this post by Jeff Pyle
Thank you Jeff.

Don't I need to do unforce before doing a new offer? Why?

Regards,
Ali Pey


On Thu, Nov 13, 2014 at 8:30 PM, Jeff Pyle <[hidden email]> wrote:
Ali,

This is what I use within loose_route() to handle rtpproxy.  In my particular case I'm bridging between two interfaces.


if (has_body("application/sdp"))  {
         # Begin rtp session update gyrations
         if (method == "INVITE") {
                 # INVITE w/ SDP, so early neg
                 # This is offer, reply is answer
                 rtpproxy_offer("frocl");
                 t_on_reply("1");
         } else if (method == "ACK") {
                 # ACK w/ SDP, so late neg (done now)
                 # This is answer
                 rtpproxy_answer("frocl");
         } 
 } else {
         if (method == "INVITE") {
                 # INVITE w/o SDP, so late neg
                 # This is nothing, reply is offer, ACK is answer (~5 lines up)
                 t_on_reply("2");
         } else {
                 t_on_reply("1");
         }
 }


And then:


onreply_route[1] {      # Manage content as necessary - early negotiation
        if (has_body("application/sdp")) {
                if ($DLG_status) {      # Update
                        rtpproxy_answer("frocl");
                } else {                # New
                        rtpproxy_answer("froc");
                }
        }
}


onreply_route[2] {      # Manage content as necessary - late negotiation - update
        if (has_body("application/sdp")) {
                rtpproxy_offer("frocl");
        }
}



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.


- Jeff



On Thu, Nov 13, 2014 at 5:13 PM, Ali Pey <[hidden email]> wrote:
Hello,

What's the best way of handling rtpproxy with re-invites? 

Should I do unforce and then offer/answer? What if the re-invite gets rejected?

Any help appreciated.

Thanks,
Ali Pey


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: RTP Proxy and Re-Invites

Ali Pey
In reply to this post by Razvan Crainea-3
Hi Razvan,

Thank you for your response and it makes sense. 

I will search for a work around for media re-negotiation rejection and will post my results here.

Best regards,
Ali Pey


On Fri, Nov 14, 2014 at 4:45 AM, Răzvan Crainea <[hidden email]> wrote:
Hi, Ali!

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.
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 :).

Best regards,
Răzvan Crainea
OpenSIPS Solutions
www.opensips-solutions.com
On 11/14/2014 03:30 AM, Jeff Pyle wrote:
Ali,

This is what I use within loose_route() to handle rtpproxy.  In my particular case I'm bridging between two interfaces.


if (has_body("application/sdp"))  {
         # Begin rtp session update gyrations
         if (method == "INVITE") {
                 # INVITE w/ SDP, so early neg
                 # This is offer, reply is answer
                 rtpproxy_offer("frocl");
                 t_on_reply("1");
         } else if (method == "ACK") {
                 # ACK w/ SDP, so late neg (done now)
                 # This is answer
                 rtpproxy_answer("frocl");
         } 
 } else {
         if (method == "INVITE") {
                 # INVITE w/o SDP, so late neg
                 # This is nothing, reply is offer, ACK is answer (~5 lines up)
                 t_on_reply("2");
         } else {
                 t_on_reply("1");
         }
 }


And then:


onreply_route[1] {      # Manage content as necessary - early negotiation
        if (has_body("application/sdp")) {
                if ($DLG_status) {      # Update
                        rtpproxy_answer("frocl");
                } else {                # New
                        rtpproxy_answer("froc");
                }
        }
}


onreply_route[2] {      # Manage content as necessary - late negotiation - update
        if (has_body("application/sdp")) {
                rtpproxy_offer("frocl");
        }
}



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.


- Jeff



On Thu, Nov 13, 2014 at 5:13 PM, Ali Pey <[hidden email]> wrote:
Hello,

What's the best way of handling rtpproxy with re-invites? 

Should I do unforce and then offer/answer? What if the re-invite gets rejected?

Any help appreciated.

Thanks,
Ali Pey


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users




_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users