[OpenSIPS-Users] A few simple general question
Nick Khamis
symack at gmail.com
Mon May 27 17:16:53 CEST 2013
Worked perfectly!
What I did was added the clause to two parts in the script:
In the loose route:
if (loose_route() || match_dialog()) {
....
else if (is_method("INVITE")) {
xlog("L_INFO","Recording Route From: $fu To: $tu IP: $si\n");
if($ruri==myself) set_advertised_address("192.168.2.20");
else set_advertised_address("xx.xx.xx.xx");
record_route();
}
....
}
And later down in the script:
if (!is_method("REGISTER|MESSAGE")) {
if($ruri==myself) set_advertised_address("192.168.2.20");
else set_advertised_address("xx.xx.xx.xx");
record_route();
}
Kind Regards,
Nick.
On 5/27/13, Bogdan-Andrei Iancu <bogdan at opensips.org> wrote:
> Hello Nick,
>
> Do :
>
> if (ruri==myself)
>
> This will check RURI against listeners, advertised IP, aliases, local
> domains.
>
> Regards,
>
> Bogdan-Andrei Iancu
> OpenSIPS Founder and Developer
> http://www.opensips-solutions.com
>
>
> On 05/27/2013 05:47 PM, Nick Khamis wrote:
>> Hello Bogdan
>>
>> ru is exactly what I was looking for. Totally forgot about ru. What I
>> am trying to accomplish is the following:
>>
>> if ru == local "domain name, cidr, or ip"
>> set_advertised_address(local opensips ip address);
>> else
>> set_advertised_address(pulibc opensips ip address);
>>
>> Is there a core function in opensips that can return true or false for:
>> local cidr (192.168.2.0/24)
>> local domain names
>> local ip addresses
>>
>> My last noob question for the day. After this, it's onto
>> "administrative" stuff.....
>>
>> Kind Regards,
>>
>> Nick.
>
More information about the Users
mailing list