You can (somewhat) do this in a lua script or over ESL. Options ping will raise events which you can listen for and either issue killgw or rescan. The problem is when you have multiple gateways removed since rescan will re-add them all. What would be useful as a new feature is a pause/resume option for gateways, or at least a way to start one gateway by name instead of re-adding them all.

On 14 February 2017 at 07:30, Stanislav Sinyagin <ssinyagin@gmail.com> wrote:
did someone work already on the following feature? It should be
relatively easy to do via ESL:

let's say our FreeSWITCH server is a part of a redundant cluster, and
it should stop accepting new calls if its PSTN gateway is down.
Ideally, it would stop responding on OPTIONS pings, so that its
upstream neighbors recognize that this node is not good for sending
calls.

So, the solution should define dependencies between gateways (ideally,
not only SIP gateways, but other endpoint types too), like:

if gateway X is down for more than 10 seconds, shut down gateways Y
and Z. If X is up for more than 5 seconds, bring up Y and Z.

In a more scalable approach, you would trigger the change if less than
a certain percentage in a set of gateways is down.

_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.org
http://www.freeswitchsolutions.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://confluence.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org