[OpenSIPS-Users] Calling from one Subnet to another using Prefix works, any other possibility?

Bogdan-Andrei Iancu bogdan at voice-system.ro
Thu Nov 12 13:31:02 CET 2009


Hi Duc,

Instead of changing the  RURI (with rewritehostport) you can leave the 
RURI untouched and place the new destination in $du variable (du is 
destination URI and it acts as an outbound proxy):

if (uri=~"sip:01[0-9]+@ <sip:01%5B0-9%5D+@>) {
    strip(2);
    $du = "sip:192.168.1.2"; // ip from opensips1
    t_relay();
    exit;
}

Regards,
Bogdan

Duc-Lam Tran wrote:
> Hi there 
> Pinging was ok, but it was another Gateway issue. Thanks for your 
> reply. It works now.
> I've another question. 
> Is there an other possibility to do such calls without rewrite the host?
> I mean Phone 1 would call Phone 2 and Host1 (OpenSips1) should know 
> that the destination is in the other subnet and forward the invite? 
> Or is the rewritehost the best possibility to do that?
>
> Regards
> Duc
>
> Am 11.11.2009 um 12:00 schrieb users-request at lists.opensips.org 
> <mailto:users-request at lists.opensips.org>:
>
>> So this might be a stupid question, but is OpenSIPS1 able to ping
>> OpenSIPS2???  I am wondering if you Network Gateway/Router is the 
>> issue.  If
>> you can ping then what do you see on OpenSIPS2 when you perform an 
>> ngrep for
>> the SIP packets?
>>
>> On Tue, Nov 10, 2009 at 8:27 PM, Duc-Lam Tran <dltran1983 at gmail.com 
>> <mailto:dltran1983 at gmail.com>> wrote:
>>
>>> Hi there
>>> I got 2 Subnets with the addresses 192.168.1.0 and 172.31.10.0
>>> Between those two OpenSips is a Linux Debian Gateway installed with IP
>>> forwarding and 2 Network Interfaces.
>>> OpenSips1 ---- Gateway ---- OpenSips2
>>> My Goal is to config the OpenSips that i can call from Subnet 1 to
>>> Subnet 2 using Prefixes.
>>> I got a Sipphone at Subnet 1 (Callnumber 1000) and another at subnet 2
>>> (1001)
>>> My configutarion of opensips.cfg for prefix calling is:
>>> if (uri=~"sip:01[0-9]+@ <sip:01%5B0-9%5D+@>) {
>>>       strip(2);
>>>       rewritehost("192.168.1.2"); // ip from opensips1
>>>       t_relay();
>>>       exit;
>>> }
>>> --> if I dial 01-1000 (01 Prefix) from agent 2 than i should get a
>>> ring at agent 1. but it doesnt work (time out)
>>> is this code correct? did i forget something? or is there another
>>> possibility to do such calls?
>>>
>>> Thanks for your help in advance.
>>>
>>> Regards
>>> Duc
>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users at lists.opensips.org <mailto:Users at lists.opensips.org>
>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>   




More information about the Users mailing list