<p>yes...agree with you , 503 better than 404(maybe also reply 404 in some case that GW is not full...), thanks.</p>
<p>Regards,<br>
Charles</p>
<p>ÔÚ 2011-4-26 ÏÂÎç5:19£¬"Steven Ayre" <<a href="mailto:steveayre@gmail.com">steveayre@gmail.com</a>>дµÀ£º<br type="attribution">> Indeed... there's a specific ISDN clearing cause for it - 34 "no<br>
> circuit/channel available" (NORMAL_CIRCUIT_CONGESTION). That maps to SIP 503<br>> Service Unavailable (RFC3398).<br>> <br>> Unallocated number implies it's not allocated anywhere and therefore<br>> shouldn't reroute, while 503 suggests you should try another route.<br>
> <br>> -Steve<br>> <br>> <br>> <br>> On 26 April 2011 09:35, David Ponzone <<a href="mailto:david.ponzone@ipeva.fr">david.ponzone@ipeva.fr</a>> wrote:<br>> <br>>> Charles,<br>>><br>
>> if you may, I would recommend you change the behaviour of this GW sending<br>>> back a 404 when it's full...<br>>> That's odd.<br>>> It should rather use: 503 Service unavailable.<br>>><br>
>> David Ponzone Direction Technique<br>>> email: <a href="mailto:david.ponzone@ipeva.fr">david.ponzone@ipeva.fr</a><br>>> tel: 01 74 03 18 97<br>>> gsm: 06 66 98 76 34<br>>><br>>> Service Client IPeva<br>
>> tel: 0811 46 26 26<br>>> <a href="http://www.ipeva.fr">www.ipeva.fr</a> - <a href="http://www.ipeva-studio.com">www.ipeva-studio.com</a><br>>><br>>> *Ce message et toutes les pi¨¨ces jointes sont confidentiels et ¨¦tablis ¨¤<br>
>> l'intention exclusive de ses destinataires. Toute utilisation ou diffusion<br>>> non autoris¨¦e est interdite. Tout message ¨¦lectronique est susceptible<br>>> d'alt¨¦ration. **IPeva** d¨¦cline toute responsabilit¨¦ au titre de ce<br>
>> message s'il a ¨¦t¨¦ alt¨¦r¨¦, d¨¦form¨¦ ou falsifi¨¦. Si vous n'¨ºtes pas<br>>> destinataire de ce message, merci de le d¨¦truire imm¨¦diatement et d'avertir<br>>> l'exp¨¦diteur.*<br>>> *<br>
>> *<br>>><br>>><br>>><br>>> Le 21/04/2011 ¨¤ 04:45, fieldpeak a ¨¦crit :<br>>><br>>> Thanks All, it is resolved now with below config.<br>>><br>>> 2011/4/20, Kristian Kielhofner <<a href="mailto:kris@kriskinc.com">kris@kriskinc.com</a>>:<br>
>><br>>> Try this:<br>>><br>>><br>>> <extension name="9_GW" ><br>>><br>>> <condition field="destination_number" expression="^(9\d+)$"><br>
>><br>>> <action application="set" data="continue_on_fail=true"/><br>>><br>>> <action application="set" data="failure_causes=UNALLOCATED_NUMBER"/><br>
>><br>>> <action application="set" data="hangup_after_bridge=true"/><br>>><br>>> <action application="bridge" data="sofia/internal/$<a href="mailto:1@192.168.200.201">1@192.168.200.201</a>"/><br>
>><br>>> <action application="bridge" data="sofia/internal/$<a href="mailto:1@192.168.200.202">1@192.168.200.202</a>"/><br>>><br>>> </condition><br>>><br>>> </extension><br>
>><br>>><br>>> On Wed, Apr 20, 2011 at 10:58 AM, fieldpeak <<a href="mailto:fieldpeak@gmail.com">fieldpeak@gmail.com</a>> wrote:<br>>><br>>> Hi Steve,<br>>><br>>><br>>> Thanks for your so rich stuff provided.<br>
>><br>>><br>>> however, i tried to use error code to route as below, it failed (did<br>>><br>>> not route the next GW when recevied UNALLOCATED_NUMBER), can you<br>>><br>>> please point out is there any place wrong in the dailplan? attached is<br>
>><br>>> the log, thanks.<br>>><br>>><br>>> <extension name="9_GW" ><br>>><br>>><br>>> <condition field="destination_number" expression="^(9\d+)$"><br>
>><br>>> <action application="set" data="continue_on_fail=true"/><br>>><br>>> <action application="set" data="hangup_after_bridge=false"/><br>
>><br>>> <action application="bridge"<br>>><br>>> data="sofia/internal/$<a href="mailto:1@192.168.200.201">1@192.168.200.201</a>"/><br>>><br>>> </condition><br>
>><br>>><br>>> <condition field="brige_hangup_cause" expression="UNALLOCATED_NUMBER"><br>>><br>>> <action application="bridge" data="sofia/internal/$<a href="mailto:1@192.168.200.202">1@192.168.200.202</a>"/><br>
>><br>>> </condition><br>>><br>>><br>>> </extension><br>>><br>>><br>>> Regards,<br>>><br>>> Charles<br>>><br>>><br>>> 2011/4/20, Steven Ayre <<a href="mailto:steveayre@gmail.com">steveayre@gmail.com</a>>:<br>
>><br>>> If you know the number of calls the GW can handle in advance, you can<br>>><br>>> limit<br>>><br>>> the call attempts before sending the call to the gateway:<br>>><br>>> <a href="http://wiki.freeswitch.org/wiki/Limit">http://wiki.freeswitch.org/wiki/Limit</a><br>
>><br>>> There are several ways to use that.<br>>><br>>><br>>> You can reroute calls to a 2nd gateway on error:<br>>><br>>><br>>> <a href="http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_bridge#Implementing_Failover">http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_bridge#Implementing_Failover</a><br>
>><br>>><br>>> There are channel variables that let you control what to consider a<br>>><br>>> reroutable error and what is a give-up error:<br>>><br>>> <a href="http://wiki.freeswitch.org/wiki/Channel_Variables#continue_on_fail">http://wiki.freeswitch.org/wiki/Channel_Variables#continue_on_fail</a><br>
>><br>>> <a href="http://wiki.freeswitch.org/wiki/Channel_Variables#failure_causes">http://wiki.freeswitch.org/wiki/Channel_Variables#failure_causes</a><br>>><br>>> This might also be useful, particularly with mod_limit:<br>
>><br>>> <a href="http://wiki.freeswitch.org/wiki/Channel_Variables#transfer_on_fail">http://wiki.freeswitch.org/wiki/Channel_Variables#transfer_on_fail</a><br>>><br>>><br>>> You could use mod_lcr to get a list of all the GWs, but in a random<br>
>><br>>> order.<br>>><br>>> That'd let you load balance (randomly) but reroute when required without<br>>><br>>> duplicates unlike mod_distributor.<br>>><br>>><br>>> Hopefully that's enough building blocks to give you somewhere to start...<br>
>><br>>><br>>> -Steve<br>>><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>>><br>>> i have two media GWs connected with FS for PSTN calls, FS route the<br>>><br>>> first<br>>><br>>> one in normal case, once the first GW get full (all of channels were<br>
>><br>>> occupied), i need FS route to the second GW.<br>>><br>>> i found once the first GW get full, it will reply '404 not found' to FS,<br>>><br>>> can FS route to the second one according to this condition or any other<br>
>><br>>> alternative?<br>>><br>>><br>>> although i know there is mod_distributor for load balancing, however, i<br>>><br>>> need if only first one full then route to second one, so it looks this<br>
>><br>>> module not suitable for this senario...<br>>><br>>><br>>> Thanks.<br>>><br>>><br>>> Regards,<br>>><br>>> Charles<br>>><br>>><br>>> _______________________________________________<br>
>><br>>> FreeSWITCH-users mailing list<br>>><br>>> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>>><br>>> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
>><br>>> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>>><br>>> <a href="http://www.freeswitch.org">http://www.freeswitch.org</a><br>
>><br>>><br>>><br>>><br>>><br>>> _______________________________________________<br>>><br>>> FreeSWITCH-users mailing list<br>>><br>>> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
>><br>>> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>>><br>>> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
>><br>>> <a href="http://www.freeswitch.org">http://www.freeswitch.org</a><br>>><br>>><br>>><br>>><br>>><br>>><br>>> --<br>>><br>>> Kristian Kielhofner<br>
>><br>>><br>>> _______________________________________________<br>>><br>>> FreeSWITCH-users mailing list<br>>><br>>> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
>><br>>> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>>><br>>> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
>><br>>> <a href="http://www.freeswitch.org">http://www.freeswitch.org</a><br>>><br>>><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">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
>> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>>> <a href="http://www.freeswitch.org">http://www.freeswitch.org</a><br>
>><br>>><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">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>>> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
>> <a href="http://www.freeswitch.org">http://www.freeswitch.org</a><br>>><br>>><br></p>