[Serusers] backup route

Tobias Lindgren tobias.lindgren at ip-only.se
Wed May 24 16:19:01 CEST 2006


Hi,

"ser -c" will tell you exactly which row that's not correct, also it
will in many cases tell you what you have done wrong.

Br,
Tobias

Giuseppe Parlato said the following on 2006-05-24 16:11:
> help please, I'm going crazy. I still get 2 errors... where?
> the new configuration:
> 
> if (lookup("location")) {
>           rewritehost("mydomain.com");
>           } else {
>           if ((uri=~"^sip:6200[0-9]+@") && (!uri=~"^sip:6200200@") && 
> (!uri=~"^sip:6200100@") ) {
>              rewritehost("routerA");
>              forward(uri:host, uri:port);
>              break;
>              } else {
>              if ((uri=~"^sip:80[0-9]+@") | (uri=~"^sip:1[0-9][0-9]@") | 
> (uri=~"^sip:1515@")) {
>                 route(3);
>                 break;
>                 }
>              };
>           };
> 
> 
> route[3] {
>         rewritehost("routerB");
>         forward(uri:host, uri:port);
>         t_on_failure("3");
>         t_relay();
>         }
> 
> failure_route[3] {
>         rewritehost("routerC");
>         forward(uri:host, uri:port);
>         append_branch();
>         t_relay();
>         }
> 
> 
> 
> how do I have to use  } or  };    ??
> 
> 
> Giuseppe
> 
> 
> ----- Original Message ----- 
> From: "Giuseppe Parlato" <gparlato at tnet.it>
> To: <serusers at iptel.org>
> Cc: "Tobias Lindgren" <tobias.lindgren at ip-only.se>
> Sent: Tuesday, May 23, 2006 1:20 PM
> Subject: Re: [Serusers] backup route
> 
> 
>> yes.. t_on_failure is "4" .. but when I restart ser I get 8 errors in 
>> config file, is there any way to check where these errors are?
>>
>> route[3] {
>>
>>        if ((uri=~"^sip:80[0-9]+@") | (uri=~"^sip:1[0-9][0-9]@") | 
>> (uri=~"^sip:1515@")) {
>>        route(4);
>>        }
>>
>> route[4] {
>>        rewritehost("routerA cisco IP");
>>        forward(uri:host, uri:port);
>>        t_on_failure("4");
>>        t_relay();
>>        }
>>
>> failure_route[4] {
>>        rewritehost("routerB cisco IP");
>>        forward(uri:host, uri:port);
>>        append_branch();
>>        t_relay();
>>        }
>>
>>
>> Giuseppe
>>
>> ----- Original Message ----- 
>> From: "Tobias Lindgren" <tobias.lindgren at ip-only.se>
>> To: "Giuseppe Parlato" <gparlato at tnet.it>
>> Cc: <serusers at iptel.org>
>> Sent: Tuesday, May 23, 2006 12:39 PM
>> Subject: Re: [Serusers] backup route
>>
>>
>>> Yep, that works fine.
>>>
>>> But t_on_failuer("X") == failure_route[X], so t_on_failure should be 4,
>>> if you use failure_route[4].
>>>
>>> /T
>>>
>>> Giuseppe Parlato said the following on 2006-05-23 12:25:
>>>> actually this is a subroute..
>>>>
>>>> route[3] {
>>>>         if ((uri=~"^sip:80[0-9]+@") | (uri=~"^sip:1[0-9][0-9]@") |
>>>> (uri=~"^sip:1515@")) {
>>>>                 rewritehost("ip");
>>>>                 forward(uri:host, uri:port);
>>>>                 break;
>>>>         };
>>>>
>>>> .. called by he main route
>>>>
>>>> if ((uri=~"^sip:1200[0-9]+@") && (!uri=~"^sip:1200200@") &&
>>>> (!uri=~"^sip:1200100@") )  {
>>>>                         rewritehost("ip");
>>>>                         forward(uri:host, uri:port);
>>>>                         break;
>>>>
>>>>                 } else {
>>>>                         route(3);
>>>>                         break;
>>>>
>>>> ..can I do like this?? call a subroute [4] from e subroute [3]?
>>>>
>>>> if ((uri=~"^sip:80[0-9]+@") | (uri=~"^sip:1[0-9][0-9]@") |
>>>> (uri=~"^sip:1515@")) {
>>>> route(4);
>>>> }
>>>> route[4] {
>>>> rewritehostport("192.168.0.1:5060");
>>>> t_on_failure("1");
>>>> t_relay();
>>>> }
>>>>
>>>> failure_route[4] {
>>>> rewritehostport("192.168.0.2:5060");
>>>> append_branch();
>>>> t_relay();
>>>> }
>>>>
>>>>
>>>> Giuseppe
>>>>
>>>> ----- Original Message ----- 
>>>> From: "Tobias Lindgren" <tobias.lindgren at ip-only.se>
>>>> To: "Giuseppe Parlato" <gparlato at tnet.it>
>>>> Cc: <serusers at iptel.org>
>>>> Sent: Tuesday, May 23, 2006 9:56 AM
>>>> Subject: Re: [Serusers] backup route
>>>>
>>>>
>>>>> Hello,
>>>>>
>>>>> You can use the "route[]" and "failure_route[]" functions in ser.cfg.
>>>>>
>>>>> A short example:
>>>>> if ((uri=~"^sip:80[0-9]+@") | (uri=~"^sip:1[0-9][0-9]@") |
>>>>> (uri=~"^sip:1515@")) {
>>>>> route(1);
>>>>> }
>>>>> route[1] {
>>>>> rewritehostport("192.168.0.1:5060");
>>>>> t_on_failure("1");
>>>>> t_relay();
>>>>> }
>>>>>
>>>>> failure_route[1] {
>>>>> rewritehostport("192.168.0.2:5060");
>>>>> append_branch();
>>>>> t_relay();
>>>>> }
>>>>>
>>>>> This above would relay on that you have the "tm.so" module loaded. 
>>>>> Also,
>>>>> the tm-module has some parameters for timeouts and stuff (such as
>>>>> fr_timer) which you should laborate with.
>>>>>
>>>>> Good luck!
>>>>>
>>>>> Br,
>>>>> Tobias
>>>>>
>>>>> Giuseppe Parlato said the following on 2006-05-22 18:04:
>>>>>> When calling some numbers I have to forward calls to a router
>>>>>> cisco (then it wil forward calls out through isdn) or to a backup 
>>>>>> router
>>>>>> cisco if the first one is busy. The route to primary cisco router 
>>>>>> works
>>>>>> but I don't know how to implement the backup route in ser.cfg ? how 
>>>>>> can
>>>>>> I configure a backup route in sip server?
>>>>>> I hope someone can answer me soon, I'm in trouble :|
>>>>>>
>>>>>>
>>>>>> if ((uri=~"^sip:80[0-9]+@") | (uri=~"^sip:1[0-9][0-9]@") |
>>>>>> (uri=~"^sip:1515@")) {
>>>>>>                 rewritehost("router IP");
>>>>>>                 forward(uri:host, uri:port);
>>>>>>                 break;
>>>>>>         };
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>> Giuseppe
>>>>>>
>>>>>>
>>>>>> ------------------------------------------------------------------------
>>>>>>
>>>>>> _______________________________________________
>>>>>> Serusers mailing list
>>>>>> Serusers at iptel.org
>>>>>> http://mail.iptel.org/mailman/listinfo/serusers
>>>>>
>>>>>
>>>>> -- 
>>>>> No virus found in this incoming message.
>>>>> Checked by AVG Free Edition.
>>>>> Version: 7.1.392 / Virus Database: 268.6.1/344 - Release Date: 
>>>>> 19/05/2006
>>>>>
>>>>>
>>>>
>>>
>>>
>>> -- 
>>> No virus found in this incoming message.
>>> Checked by AVG Free Edition.
>>> Version: 7.1.392 / Virus Database: 268.7.0/345 - Release Date: 22/05/2006
>>>
>>>
>> 
> 



More information about the sr-users mailing list