[Kamailio-Users] problem with relaying invite

Alex Balashov abalashov at evaristesys.com
Mon Oct 13 12:59:30 CEST 2008


Of course, this is the manual approach for two gateways.  If you have 
more than two gateways and need to cycle through a list, you may want to 
consider the dispatcher module.

Alex Balashov wrote:

> Asim Riaz wrote:
> 
>>       so then what is the posibility to send calls the first proxy if
>>     thats fail route to another one and so on ?
> 
> The possibility is high.  :-)
> 
> Here - try something like this:
> 
> route {
> 
>     ...
> 
>     if(is_method("INVITE"))
>        route(1);
> 
>     ...
> }
> 
> 
> # -- Relay INVITE -- #
> 
> route[1] {
>     t_on_failure("1");
> 
>     if(!t_relay("udp:proxy1:5060")) {
>        xlog("L_INFO", "Final relay failure!\n");
>        t_reply("503", "Service Unavailable");
>        exit;
>     }
> }
> 
> # -- Backup INVITE route on failure of route(1) -- #
> 
> failure_route[1] {
>     if(t_was_cancelled()) {
>        xlog("L_INFO", "Transaction cancelled.\n");
>        exit;
>     }
> 
>     append_branch();
> 
>     if(!t_relay("udp:proxy2:5060")) {
>        xlog("L_INFO", "Relay to proxy2 failed - not so good!\n");
>        t_reply("503", "Service Unavailable");
>        exit;
>     }
> }
> 


-- 
Alex Balashov
Evariste Systems
Web    : http://www.evaristesys.com/
Tel    : (+1) (678) 954-0670
Direct : (+1) (678) 954-0671
Mobile : (+1) (706) 338-8599




More information about the sr-users mailing list