By default, when a "condition" block is completed (in your case after the first bridge) then execution of dialplan breaks and the inbound call is dropped.<div>You can change this default behaviour with: break="never" in the first conditional block.</div>
<div>In this case also the second conditional block is always executed.</div><div>So your first conditional block will be:</div><div><br></div><div><condition field="destination_number" expression="^(9\d+)$" break="never"></div>
<div><div> ....</div><div><br></div><div>Stephen<br><br><div class="gmail_quote">On Wed, Apr 20, 2011 at 4:58 PM, fieldpeak <span dir="ltr"><<a href="mailto:fieldpeak@gmail.com">fieldpeak@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi Steve,<br>
<br>
Thanks for your so rich stuff provided.<br>
<br>
however, i tried to use error code to route as below, it failed (did<br>
not route the next GW when recevied UNALLOCATED_NUMBER), can you<br>
please point out is there any place wrong in the dailplan? attached is<br>
the log, thanks.<br>
<br>
<extension name="9_GW" ><br>
<br>
<condition field="destination_number" expression="^(9\d+)$"><br>
<action application="set" data="continue_on_fail=true"/><br>
<action application="set" data="hangup_after_bridge=false"/><br>
<action application="bridge" data="sofia/internal/$<a href="mailto:1@192.168.200.201">1@192.168.200.201</a>"/><br>
</condition><br>
<br>
<condition field="brige_hangup_cause" expression="UNALLOCATED_NUMBER"><br>
<action application="bridge" data="sofia/internal/$<a href="mailto:1@192.168.200.202">1@192.168.200.202</a>"/><br>
</condition><br>
<br>
</extension><br>
<br>
Regards,<br>
Charles<br>
<br>
2011/4/20, Steven Ayre <<a href="mailto:steveayre@gmail.com">steveayre@gmail.com</a>>:<br>
<div><div></div><div class="h5">> If you know the number of calls the GW can handle in advance, you can limit<br>
> the call attempts before sending the call to the gateway:<br>
> <a href="http://wiki.freeswitch.org/wiki/Limit" target="_blank">http://wiki.freeswitch.org/wiki/Limit</a><br>
> There are several ways to use that.<br>
><br>
> You can reroute calls to a 2nd gateway on error:<br>
> <a href="http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_bridge#Implementing_Failover" target="_blank">http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_bridge#Implementing_Failover</a><br>
><br>
> There are channel variables that let you control what to consider a<br>
> reroutable error and what is a give-up error:<br>
> <a href="http://wiki.freeswitch.org/wiki/Channel_Variables#continue_on_fail" target="_blank">http://wiki.freeswitch.org/wiki/Channel_Variables#continue_on_fail</a><br>
> <a href="http://wiki.freeswitch.org/wiki/Channel_Variables#failure_causes" target="_blank">http://wiki.freeswitch.org/wiki/Channel_Variables#failure_causes</a><br>
> This might also be useful, particularly with mod_limit:<br>
> <a href="http://wiki.freeswitch.org/wiki/Channel_Variables#transfer_on_fail" target="_blank">http://wiki.freeswitch.org/wiki/Channel_Variables#transfer_on_fail</a><br>
><br>
> You could use mod_lcr to get a list of all the GWs, but in a random order.<br>
> That'd let you load balance (randomly) but reroute when required without<br>
> duplicates unlike mod_distributor.<br>
><br>
> Hopefully that's enough building blocks to give you somewhere to start...<br>
><br>
> -Steve<br>
><br>
><br>
><br>
> On 20 April 2011 08:27, Charles <<a href="mailto:fieldpeak@gmail.com">fieldpeak@gmail.com</a>> wrote:<br>
><br>
>><br>
>> i have two media GWs connected with FS for PSTN calls, FS route the first<br>
>> one in normal case, once the first GW get full (all of channels were<br>
>> occupied), i need FS route to the second GW.<br>
>> i found once the first GW get full, it will reply '404 not found' to FS,<br>
>> can FS route to the second one according to this condition or any other<br>
>> alternative?<br>
>><br>
>> although i know there is mod_distributor for load balancing, however, i<br>
>> need if only first one full then route to second one, so it looks this<br>
>> module not suitable for this senario...<br>
>><br>
>> Thanks.<br>
>><br>
>> Regards,<br>
>> Charles<br>
>><br>
>> _______________________________________________<br>
>> FreeSWITCH-users mailing list<br>
>> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
>> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
>> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
>> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
>><br>
>><br>
><br>
</div></div><br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div></div>