detecting mediaproxy across multiple opensips instances

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

detecting mediaproxy across multiple opensips instances

Jeff Pyle
Hello,

We'll be facing a scenario soon where a SIP call will traverse at least two
Opensips proxies.  Depending on the conditions at the time, either proxy
could conceivably use an engage_media_proxy().  The circumstances are few
that would cause both to do it, but the possibility still exists.

Is there a way the second Opensips proxy can detect the fact the first one
has already engaged the mediaproxy?

Is it relevant that both Opensips' dispatchers in this case will be talking
to the same relay?  This is the case.

What are the implications if both proxies are permitted to
engage_media_proxy()?



- Jeff
 


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

Re: detecting mediaproxy across multiple opensips instances

Dan Pascu

On 9 Jun 2009, at 02:53, Jeff Pyle wrote:

> Hello,
>
> We'll be facing a scenario soon where a SIP call will traverse at  
> least two
> Opensips proxies.  Depending on the conditions at the time, either  
> proxy
> could conceivably use an engage_media_proxy().  The circumstances  
> are few
> that would cause both to do it, but the possibility still exists.
>
> Is there a way the second Opensips proxy can detect the fact the  
> first one
> has already engaged the mediaproxy?

You could add a SIP header and not start mediaproxy if present. Or use  
some heuristics on the IP addresses from the SDP (origin IP vs c= line  
IP). Or depending on your topology, you can know that a certain proxy  
has a special relationship with the caller/callee and it's the only  
one that should call engage_media_proxy()

>
> Is it relevant that both Opensips' dispatchers in this case will be  
> talking
> to the same relay?  This is the case.
>

No. It works without any issues.

> What are the implications if both proxies are permitted to
> engage_media_proxy()?
>

None. You can chain as many media relays as you want. You can call  
engage_media_proxy() and every proxy in the path if you want, it will  
make no difference other that having the traffic routed trough  
multiple media relays in your network (or not if you only use one  
relay). The only required thing is that they have a public IP so they  
don't deadlock when chained.

--
Dan




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

Re: detecting mediaproxy across multiple opensips instances

Iñaki Baz Castillo
2009/6/9 Dan Pascu <[hidden email]>:
>> Is there a way the second Opensips proxy can detect the fact the
>> first one
>> has already engaged the mediaproxy?
>
> You could add a SIP header and not start mediaproxy if present. Or use
> some heuristics on the IP addresses from the SDP (origin IP vs c= line
> IP). Or depending on your topology, you can know that a certain proxy
> has a special relationship with the caller/callee and it's the only
> one that should call engage_media_proxy()

nathelper module (RtpProxy) adds a SDP line when force_rtpproxy()
success and modifies the message:
  a=nortpproxy:yes

In case other proxy also tries to use RtpProxy for a request already
forzed by other proxy, then "force_rtpproxy()" will return "false"
since it detects the line "a=nortpproxy:yes" in the SDP so the second
Rtpproxy is not used and $rc is false.

However, this is required in RtpProxy since it doesn't allow a
RtpProxy talking with other (dead lock would occur). This doesn't
happen in MediaProxy.


--
Iñaki Baz Castillo
<[hidden email]>

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

Re: detecting mediaproxy across multiple opensips instances

Dan Pascu
On 9 Jun 2009, at 11:58, Iñaki Baz Castillo wrote:

> 2009/6/9 Dan Pascu <[hidden email]>:
>>> Is there a way the second Opensips proxy can detect the fact the
>>> first one
>>> has already engaged the mediaproxy?
>>
>> You could add a SIP header and not start mediaproxy if present. Or  
>> use
>> some heuristics on the IP addresses from the SDP (origin IP vs c=  
>> line
>> IP). Or depending on your topology, you can know that a certain proxy
>> has a special relationship with the caller/callee and it's the only
>> one that should call engage_media_proxy()
>
> nathelper module (RtpProxy) adds a SDP line when force_rtpproxy()
> success and modifies the message:
>  a=nortpproxy:yes
>
> In case other proxy also tries to use RtpProxy for a request already
> forzed by other proxy, then "force_rtpproxy()" will return "false"
> since it detects the line "a=nortpproxy:yes" in the SDP so the second
> Rtpproxy is not used and $rc is false.
>

Having to rely (and depend) on what other proxies do, for your own NAT  
traversal is a bad design decision.

> However, this is required in RtpProxy since it doesn't allow a
> RtpProxy talking with other (dead lock would occur). This doesn't
> happen in MediaProxy.
>
>
> --
> Iñaki Baz Castillo
> <[hidden email]>
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users


--
Dan




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

Re: detecting mediaproxy across multiple opensips instances

Iñaki Baz Castillo
2009/6/9 Dan Pascu <[hidden email]>:
>> In case other proxy also tries to use RtpProxy for a request already
>> forzed by other proxy, then "force_rtpproxy()" will return "false"
>> since it detects the line "a=nortpproxy:yes" in the SDP so the second
>> Rtpproxy is not used and $rc is false.
>>
>
> Having to rely (and depend) on what other proxies do, for your own NAT
> traversal is a bad design decision.

If we consider the hypothetical case in which a a VoIP platform is
designed not just for PSTN or local-users-to-local-users calls, but
also for real outbound calls to other domains managed by other
proxies, then we cannot have control of how the NAT is handled in
those remote proxies. The only we can do is "fix" our side, which
involves "fixing" signaling and media when our user is behind NAT
(with no STUN and so).
This is: I would *never* rely on external proxies to handle my *own*
NAT issues (my users behind NAT), I fix NAT in my platform so when the
request leaves it, it seems to arrive from public IP (signaling and
media).

Of course, considering SIP just for a closed environments
(provider2clients and clients2provider) is a limited vision (even if
nowadays it's the real usage of SIP when involving end-users). This
scenario simplifies a lot the use case so handling two media proxies
for the same call is just *prohibited* by design :)

Regards.


--
Iñaki Baz Castillo
<[hidden email]>

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

Re: detecting mediaproxy across multiple opensips instances

Jeff Pyle
In reply to this post by Dan Pascu
Any thoughts on how one might load the c= IP into an AVP, or something
similar?  I'd love to do exactly what you say, use the c= line to determine
whether a mediaproxy should be used or not, but I don't see a way to load it
into a variable from the SDP.

Certain IP networks I want to proxy, everything else should be left alone.
Once I know the connectio IP the next step will be to figure out how to
evaluate whether it's in a certain block or not.


- Jeff



On 6/9/09 4:39 AM, "Dan Pascu" <[hidden email]> wrote:


> You could add a SIP header and not start mediaproxy if present. Or use
> some heuristics on the IP addresses from the SDP (origin IP vs c= line
> IP). Or depending on your topology, you can know that a certain proxy
> has a special relationship with the caller/callee and it's the only
> one that should call engage_media_proxy()


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

Re: detecting mediaproxy across multiple opensips instances

Iñaki Baz Castillo
2009/6/9 Jeff Pyle <[hidden email]>:
> Any thoughts on how one might load the c= IP into an AVP, or something
> similar?  I'd love to do exactly what you say, use the c= line to determine
> whether a mediaproxy should be used or not, but I don't see a way to load it
> into a variable from the SDP.

For this you can use nat_uac_test(8) (nathelper module) so SDP is
searched for occurrence of RFC1918 addresses, and in that case returns
"true".
No need to get the SDP media IP (also note that a SDP can contain
various media addresses).




--
Iñaki Baz Castillo
<[hidden email]>

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

Re: detecting mediaproxy across multiple opensips instances

Jeff Pyle
Iñaki,

I mixed two different purposes here.  The first is NAT detection, obviously.
But I also wish to mediaproxy non-NAT hosts if their connection IP is on my
ISP network.  In this case none of the addresses are RFC1918.


- Jeff



On 6/9/09 8:48 AM, "Iñaki Baz Castillo" <[hidden email]> wrote:

> 2009/6/9 Jeff Pyle <[hidden email]>:
> Any thoughts on how one might
> load the c= IP into an AVP, or something
> similar?  I'd love to do exactly
> what you say, use the c= line to determine
> whether a mediaproxy should be
> used or not, but I don't see a way to load it
> into a variable from the
> SDP.

For this you can use nat_uac_test(8) (nathelper module) so SDP
> is
searched for occurrence of RFC1918 addresses, and in that case
> returns
"true".
No need to get the SDP media IP (also note that a SDP can
> contain
various media addresses).




--
Iñaki Baz
> Castillo
<[hidden email]>

_______________________________________________
User
> s mailing
> list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listin
> fo/users



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