But how does get_avail_gw find out it's avail?
It would have to try making the call so you would call over it to find out it's ok to call then pass that back up to bridge?
You can try to hide the complexity but you still have to stash it somewhere.
So if you don't like looking at it consider making a script or a C mod to hide it.
Here's one cool way you can do with just regular dialplan.
<extension name="gateways">
<condition field="destination_number" expression="gateway_macro">
<action application="set" data="continue_on_fail=true"/>
<action application="set" data="hangup_after_bridge=true"/>
<action application="bridge" data="sofia/gateway/gw1/${dialed_number}"/>
<action application="bridge" data="sofia/gateway/gw2/${dialed_number}"/>
<action application="bridge" data="sofia/gateway/gw3/${dialed_number}"/>
<action application="bridge" data="sofia/gateway/gw4/${dialed_number}"/>
<action application="bridge" data="sofia/gateway/gw5/${dialed_number}"/>
</condition>
</extension>
<extension name="myext">
<condition field="destination_number" expression="^(whatever)$">
<action application="set" data="dialed_number=$1"/>
<action application="transfer" data="gateway_macro"/>
</condition>
</extension>
change whatever to your favorite regex
so now all you have to do is set dialed_number and transfer to gateway_macro (you could have many of these with different names)
One way or another all your real goal seems to be is hiding the complexity so *shrug* here's and easy way with existing tools.
>Let's imagine that I need to call 1000,1001,1002 via gw1,gw2,gw3 by
> Continue_on_fail and hangup_after_bridge like tony pointed out are what you
> want if you don’t want to use the | delimiting ... I use these all the time
> with gateway counts > 10 just stacking additional actions for each bridge
> line
choosing first available. How dialplan would look like?
continue_on_fail=True
hangup_after_bridge=True
bridge gw1/1000
bridge gw1/1001
bridge gw1/1002
bridge gw2/1000
bridge gw2/1001
bridge gw2/1002
bridge gw3/1000
bridge gw3/1001
bridge gw3/1002
Is it easy to understand? From my point of view it's not. Compare to this:
continue_on_fail=True
hangup_after_bridge=True
bridge ${get_avail_gw(gw1,gw2,gw3)}/1000
bridge ${get_avail_gw(gw1,gw2,gw3)}/1001
bridge ${get_avail_gw(gw1,gw2,gw3)}/1002
_______________________________________________
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