[Freeswitch-users] how to avoid many "|" in bridge application?

Anthony Minessale anthony.minessale at gmail.com
Wed Aug 26 08:42:05 PDT 2009

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"
        <action application="bridge"
        <action application="bridge"
        <action application="bridge"
        <action application="bridge"

    <extension name="myext">
      <condition field="destination_number" expression="^(whatever)$">
        <action application="set" data="dialed_number=$1"/>
        <action application="transfer" data="gateway_macro"/>

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.

On Wed, Aug 26, 2009 at 12:44 AM, Max Ivanov <ivanov.maxim at gmail.com> wrote:

> >
> > 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
> Let's imagine that I need to call 1000,1001,1002 via  gw1,gw2,gw3 by
> 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 at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org

Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
Twitter: http://twitter.com/FreeSWITCH_wire

AIM: anthm
MSN:anthony_minessale at hotmail.com <MSN%3Aanthony_minessale at hotmail.com>
GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com<PAYPAL%3Aanthony.minessale at gmail.com>
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888 at conference.freeswitch.org <sip%3A888 at conference.freeswitch.org>
iax:guest at conference.freeswitch.org/888
googletalk:conf+888 at conference.freeswitch.org<googletalk%3Aconf%2B888 at conference.freeswitch.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20090826/59da5fd7/attachment-0002.html 

More information about the FreeSWITCH-users mailing list