[OpenSIPS-Users] RTPProxy bridge mode issue

Yuri Kirsanov y.kirsanov at gmail.com
Wed Aug 17 07:45:52 CEST 2011


Hi Andrew,
Yes, I've tried that, and it seems to be working, but the problem is
following. I have clients who connect both from LAN and from WAN. So, on
incoming INVITE request I can do nat_uac_test("4") to check if request's
latest VIA is from Internet. Then I do a lookup on clients to find out where
is that client connected from. But how do I check if that's an Internet IP
address or not? I will have something like "sip:9999999 at 10.65.1.1:5060" in
there in case of LAN, but it can be ANY private or Internet IP address.
Right now on my test server I'm doing ugly thing like this:

        if (is_method("INVITE"))
        {
            if (has_body("application/sdp"))
            {
                if (nat_uac_test("4"))
                {
                    xlog("Call from LAN");
                    if (!$ru=~"10.65.\d{1,3}\.\d{1,3}")
                    {
                        xlog("PROXY: $fU->$tU, LAN to WAN, $ci\n");
                        if (!rtpproxy_offer("fieoc"))
                        {
                            xlog("ERROR: Unable to offer RTP Proxy, $ci\n");
                            sl_send_reply("500","Internal Server Error
RTP");
                            exit;
                        }
                    }
                    else
                    {
                        xlog("PROXY: $fU->$tU, LAN to LAN, $ci\n");
                        if (!rtpproxy_offer("fiioc"))
                        {
                            xlog("ERROR: Unable to offer RTP Proxy, $ci\n");
                            sl_send_reply("500","Internal Server Error
RTP");
                            exit;
                        }
                    }
                }
                else
                {
                    xlog("Call from Internet");
                    if (!$ru=~"10.65.\d{1,3}\.\d{1,3}")
                    {
                        xlog("PROXY: $fU->$tU, WAN to WAN, $ci\n");
                        if (!rtpproxy_offer("feeoc"))
                        {
                            xlog("ERROR: Unable to offer RTP Proxy, $ci\n");
                            sl_send_reply("500","Internal Server Error
RTP");
                            exit;
                        }
                    }
                    else
                    {
                        xlog("PROXY: $fU->$tU, WAN to LAN, $ci\n");
                        if (!rtpproxy_offer("feioc"))
                        {
                            xlog("ERROR: Unable to offer RTP Proxy, $ci\n");
                            sl_send_reply("500","Internal Server Error
RTP");
                            exit;
                        }
                    }
                }
            }


Which seems to be working, but that's really ugly and not efficient. If only
I could do nat_uac_test on outgoing client's R-URI - that would simplify
things a lot! Do you have any ideas how to implement something like that?
Because right now I'm analyzing against one network, of course, I can add
regex to check for private LAN IP in there, but I really don't like such
solution...

Thanks for answering!

2011/8/17 Andrew Pogrebennyk <andrew.pogrebennyk at portaone.com>

> Yuri,
>
>
> On 17.08.2011 07:27, Yuri Kirsanov wrote:
>
>> Do you have any idea why is it behaving this way? I'm using OpenSIPS 1.6.4
>> and RTP Proxy 1.2.1 without any patches. I'm not using "mhomed=1" option,
>> I'm using "force_send_socket()" on outgoing calls from Internet client to
>> LAN and it works fine. Should I also use that command for outgoing calls
>> from LAN to Internet client? But that shouldn't affect RTP Proxy behavior,
>> shouldn't it? Also, I've tried to use "r" and "w" options when invoking RTP
>> Proxy, but that doesn't help.
>>
>
> Have you tried using options "ie" for calls from lan to internet, "ei" vice
> versa and "ee" for calls from one client on the internet to another? This
> used to work for me.. one flag i|e may be not enough.
>
> --
> Sincerely,
> Andrew Pogrebennyk
>
> ______________________________**_________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-**bin/mailman/listinfo/users<http://lists.opensips.org/cgi-bin/mailman/listinfo/users>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20110817/267c8b63/attachment.htm>


More information about the Users mailing list