If you know the number of calls the GW can handle in advance, you can limit the call attempts before sending the call to the gateway:<br><a href="http://wiki.freeswitch.org/wiki/Limit">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">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 reroutable error and what is a give-up error:<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>
<a href="http://wiki.freeswitch.org/wiki/Channel_Variables#failure_causes">http://wiki.freeswitch.org/wiki/Channel_Variables#failure_causes</a><br>This might also be useful, particularly with mod_limit: <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>You could use mod_lcr to get a list of all the GWs, but in a random order. That'd let you load balance (randomly) but reroute when required without 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><div class="gmail_quote">On 20 April 2011 08:27, Charles <span dir="ltr"><<a href="mailto:fieldpeak@gmail.com">fieldpeak@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div style="margin: 10px; font-family: verdana; font-size: 10pt;">
<div> </div>
<div>i have two media GWs connected with FS for PSTN calls, FS route the
first one in normal case, once the first GW get full (all of channels were
occupied), i need FS route to the second GW. </div>
<div>i found once the first GW get full, it will reply '404 not found' to FS,
can FS route to the second one according to this condition or any other
alternative? </div>
<div> </div>
<div>although i know there is mod_distributor for load balancing, however, i
need if only first one full then route to second one, so it looks this module
not suitable for this senario...</div>
<div> </div>
<div>Thanks.</div>
<div> </div>
<div>Regards,</div>
<div>Charles</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 style="visibility: hidden; left: -5000px; position: absolute; z-index: 9999; padding: 0px; margin-left: 0px; margin-top: 0px; overflow: hidden; word-wrap: break-word; color: black; font-size: 10px; text-align: left; line-height: 130%;" id="avg_ls_inline_popup">
</div>