Thanks a lot :)
It works now!
 
Pavel Siderov
----- Original Message -----
From: Ron Carithers
To: Pavel Siderov
Sent: Thursday, January 13, 2005 9:51 AM
Subject: Re: [Serusers] Forwarding according to prefix

i think inside the [ ] is an OR, so if it starts with any of those numbers it will go to the first gateway. i think if you remove the [ ] it will do what you want.
ron
 
----- Original Message -----
From: Pavel Siderov
To: serusers@lists.iptel.org
Sent: Wednesday, January 12, 2005 6:47 AM
Subject: [Serusers] Forwarding according to prefix

Hi guys,
 
I have problem with forwarding. Here is what I'm trying to make
 
if (uri=~"^sip:[559881]") {
        log(0, "\n\n************  Forwarding to sip1 ! ***********\n");
        rewritehostport("siphost1.com:5060");
        append_branch("siphost1.com");
        t_relay();
        append_hf("P-hint: VoipSwitch GATEWAY\r\n");
        log(0, "********************************************\n\n\n");
        break;
};

if (uri=~"^sip:[559888]") {
        log(0, "\n\n************  Forwarding to sip2 ! ***********\n");
        rewritehostport("siphost2.com:5060");
        append_branch("siphost2.com");
        t_relay();
        append_hf("P-hint: VoipSwitch GATEWAY\r\n");
        log(0, "********************************************\n\n\n");
        break;
};
 
If I call number for example 35988123 it goes to the right sip server - siphost1.com
If I call number for example 359888123 it goes again to sip server - siphost1.com but it has to go to siphost2.com.
 
Any suggestions what maybe wrong?
 
 
Thanks in advance :)!
 
Pavel Siderov


_______________________________________________
Serusers mailing list
serusers@lists.iptel.org
http://lists.iptel.org/mailman/listinfo/serusers