But how does get_avail_gw find out it's avail? <br>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?<br><br>You can try to hide the complexity but you still have to stash it somewhere.<br>
<br>So if you don't like looking at it consider making a script or a C mod to hide it.<br><br>Here's one cool way you can do with just regular dialplan.<br><br><br> <extension name="gateways"><br>
<condition field="destination_number" expression="gateway_macro"><br> <action application="set" data="continue_on_fail=true"/><br> <action application="set" data="hangup_after_bridge=true"/><br>
<action application="bridge" data="sofia/gateway/gw1/${dialed_number}"/><br> <action application="bridge" data="sofia/gateway/gw2/${dialed_number}"/><br> <action application="bridge" data="sofia/gateway/gw3/${dialed_number}"/><br>
<action application="bridge" data="sofia/gateway/gw4/${dialed_number}"/><br> <action application="bridge" data="sofia/gateway/gw5/${dialed_number}"/><br> </condition><br>
</extension><br><br> <extension name="myext"><br> <condition field="destination_number" expression="^(whatever)$"><br> <action application="set" data="dialed_number=$1"/><br>
<action application="transfer" data="gateway_macro"/><br> </condition><br> </extension><br><br>change whatever to your favorite regex<br>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)<br>
<br><br>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.<br><br><br><br><div class="gmail_quote">On Wed, Aug 26, 2009 at 12:44 AM, Max Ivanov <span dir="ltr"><<a href="mailto:ivanov.maxim@gmail.com">ivanov.maxim@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">><br>
> Continue_on_fail and hangup_after_bridge like tony pointed out are what you<br>
> want if you don’t want to use the | delimiting ... I use these all the time<br>
> with gateway counts > 10 just stacking additional actions for each bridge<br>
> line<br>
<br>
</div>Let's imagine that I need to call 1000,1001,1002 via gw1,gw2,gw3 by<br>
choosing first available. How dialplan would look like?<br>
<br>
continue_on_fail=True<br>
hangup_after_bridge=True<br>
bridge gw1/1000<br>
bridge gw1/1001<br>
bridge gw1/1002<br>
bridge gw2/1000<br>
bridge gw2/1001<br>
bridge gw2/1002<br>
bridge gw3/1000<br>
bridge gw3/1001<br>
bridge gw3/1002<br>
<br>
Is it easy to understand? From my point of view it's not. Compare to this:<br>
continue_on_fail=True<br>
hangup_after_bridge=True<br>
bridge ${get_avail_gw(gw1,gw2,gw3)}/1000<br>
bridge ${get_avail_gw(gw1,gw2,gw3)}/1001<br>
bridge ${get_avail_gw(gw1,gw2,gw3)}/1002<br>
<div><div></div><div class="h5"><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>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/">http://www.cluecon.com/</a><br>
Twitter: <a href="http://twitter.com/FreeSWITCH_wire">http://twitter.com/FreeSWITCH_wire</a><br><br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net">irc.freenode.net</a> #freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br><a href="http://iax:guest@conference.freeswitch.org/888">iax:guest@conference.freeswitch.org/888</a><br>
<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>pstn:213-799-1400<br>