By default, when a &quot;condition&quot; 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=&quot;never&quot; 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>&lt;condition field=&quot;destination_number&quot; expression=&quot;^(9\d+)$&quot; break=&quot;never&quot;&gt;</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">&lt;<a href="mailto:fieldpeak@gmail.com">fieldpeak@gmail.com</a>&gt;</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>
&lt;extension name=&quot;9_GW&quot; &gt;<br>
<br>
   &lt;condition field=&quot;destination_number&quot; expression=&quot;^(9\d+)$&quot;&gt;<br>
      &lt;action application=&quot;set&quot; data=&quot;continue_on_fail=true&quot;/&gt;<br>
     &lt;action application=&quot;set&quot; data=&quot;hangup_after_bridge=false&quot;/&gt;<br>
      &lt;action application=&quot;bridge&quot; data=&quot;sofia/internal/$<a href="mailto:1@192.168.200.201">1@192.168.200.201</a>&quot;/&gt;<br>
 &lt;/condition&gt;<br>
<br>
   &lt;condition field=&quot;brige_hangup_cause&quot; expression=&quot;UNALLOCATED_NUMBER&quot;&gt;<br>
    &lt;action application=&quot;bridge&quot; data=&quot;sofia/internal/$<a href="mailto:1@192.168.200.202">1@192.168.200.202</a>&quot;/&gt;<br>
   &lt;/condition&gt;<br>
<br>
 &lt;/extension&gt;<br>
<br>
Regards,<br>
Charles<br>
<br>
2011/4/20, Steven Ayre &lt;<a href="mailto:steveayre@gmail.com">steveayre@gmail.com</a>&gt;:<br>
<div><div></div><div class="h5">&gt; If you know the number of calls the GW can handle in advance, you can limit<br>
&gt; the call attempts before sending the call to the gateway:<br>
&gt; <a href="http://wiki.freeswitch.org/wiki/Limit" target="_blank">http://wiki.freeswitch.org/wiki/Limit</a><br>
&gt; There are several ways to use that.<br>
&gt;<br>
&gt; You can reroute calls to a 2nd gateway on error:<br>
&gt; <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>
&gt;<br>
&gt; There are channel variables that let you control what to consider a<br>
&gt; reroutable error and what is a give-up error:<br>
&gt; <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>
&gt; <a href="http://wiki.freeswitch.org/wiki/Channel_Variables#failure_causes" target="_blank">http://wiki.freeswitch.org/wiki/Channel_Variables#failure_causes</a><br>
&gt; This might also be useful, particularly with mod_limit:<br>
&gt; <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>
&gt;<br>
&gt; You could use mod_lcr to get a list of all the GWs, but in a random order.<br>
&gt; That&#39;d let you load balance (randomly) but reroute when required without<br>
&gt; duplicates unlike mod_distributor.<br>
&gt;<br>
&gt; Hopefully that&#39;s enough building blocks to give you somewhere to start...<br>
&gt;<br>
&gt; -Steve<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On 20 April 2011 08:27, Charles &lt;<a href="mailto:fieldpeak@gmail.com">fieldpeak@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; i have two media GWs connected with FS for PSTN calls, FS route the first<br>
&gt;&gt; one in normal case, once the first GW get full (all of channels were<br>
&gt;&gt; occupied), i need FS route to the second GW.<br>
&gt;&gt; i found once the first GW get full, it will reply &#39;404 not found&#39; to FS,<br>
&gt;&gt; can FS route to the second one according to this condition or any other<br>
&gt;&gt; alternative?<br>
&gt;&gt;<br>
&gt;&gt; although i know there is mod_distributor for load balancing, however, i<br>
&gt;&gt; need if only first one full then route to second one, so it looks this<br>
&gt;&gt; module not suitable for this senario...<br>
&gt;&gt;<br>
&gt;&gt; Thanks.<br>
&gt;&gt;<br>
&gt;&gt; Regards,<br>
&gt;&gt; Charles<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; FreeSWITCH-users mailing list<br>
&gt;&gt; <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
&gt;&gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
&gt;&gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
&gt;&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;<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>