[Freeswitch-users] continue_on_fail failover with mod_lcr

Ivan Kovacevic ivank at rogers.com
Fri Jun 10 00:38:22 MSD 2011


Hi Everyone,

 

I would like to implement fail-over for my outbound gateway, but I would like to be able to pick certain cause codes which qualify
to stop trying next gateway (specifically when I have bad number and I am getting sip:404 NO_ROUTE_DESTINATION, UNALLOCATED_NUMBER).
I was using 1.0.6, but I moved to the newest git about month ago.

 

After searching through lists and spending several hours playing with continue_to_fail, failure_causes and fail_on_single_reject I
was able to make it work by specifying  cause codes for which I want to fail-over and omitting ones that qualify to stop trying next
gateway in variable continue_to_fail:

 

So this setup is working for me and in the case I have bad number and x.x.x.x returns sip:404 (NO_ROUTE_DESTINATION or
UNALLOCATED_NUMBER) it is not trying y.y.y.y gateway.

 

 

<include>

  <extension name="myextension">

    <condition field="destination_number" expression="^(01144\d+)$">

      <action application="set"

data="continue_on_fail=NORMAL_TEMPORARY_FAILURE,USER_BUSY,NO_ANSWER,SERVICE_NOT_IMPLEMENTED,CALL_RE

JECTED,NO_USER_RESPONSE,EXCHANGE_ROUTING_ERROR,INCOMPATIBLE_DESTINATION,NETWORK_OUT_OF_ORDER,RECOVERY_ON_TIMER_EXPIRE"/>

       <action application="bridge" data="sofia/myprofile/$1 at x.x.x.x"/>

       <action application="bridge" data="sofia/myprofile/$1 at y.y.y.y"/>

       <action application="bridge" data="sofia/myprofile/$1 at z.z.z.z"/>

    </condition>

  </extension>

</include>

 

 

However if I want to use "|" between my gateways - and the example below is not working. And no matter what x.x.x.x returns - it
will try y.y.y.y  and eventually z.z.z.z.

 

<action application="set"

data="continue_on_fail=NORMAL_TEMPORARY_FAILURE,USER_BUSY,NO_ANSWER,SERVICE_NOT_IMPLEMENTED,CALL_RE

JECTED,NO_USER_RESPONSE,EXCHANGE_ROUTING_ERROR,INCOMPATIBLE_DESTINATION,NETWORK_OUT_OF_ORDER,RECOVERY_ON_TIMER_EXPIRE"/>

<action application="bridge"

data="sofia/myprofile/$1 at x.x.x.x|sofia/myprofile/$1 at y.y.y.y|sofia/myprofile/$1 at z.z.z.z"/>

 

Unfortunately, we have to use pipe for fail-over since we are using mod_lcr to choose between outbound gateways.

 

Any suggestions? 

 

Thanks,

 

Ivan 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20110609/7f89d158/attachment.html 


More information about the FreeSWITCH-users mailing list