[Freeswitch-users] Best way to replicate include =>?

Anthony Minessale anthony.minessale at gmail.com
Mon Oct 20 14:29:59 PDT 2008


One important thing to remember is that in FreeSWITCH the dialplan is a
separate stage of a call.
FS parses your dialplan in one pass and builds a "todo" list and then it
hits execute state and really does the stuff.

We do have an application called execute_extension that lets you run a
dialplan module from the execute state just for the purpose of executing the
instruction set from a certian extension so you could use that for what you
want like so:

<!--- put this extension last -->
 <extension name="include" continue="true">
   <!-- conditions with no expression are instantly true -->
   <condition>
      <action application="execute_extension" data="${dialed_ext} XML
include"/>
      <action application="execute_extension" data="${dialed_ext} XML
include2"/>
   <condition/>
 </extension>

This would actually cause you to run through both contexts in this order
during EXECUTE state.
were the transfer app actually stops the EXECUTE by sending the channel back
to RINGING and
re-entering the dialplan stage.

Your best bet is to try to shift the paragidm in your head away from how
asterisk does it =D



On Mon, Oct 20, 2008 at 3:06 PM, Kristian Kielhofner <
kkielhofner at star2star.com> wrote:

> On 10/20/08, Michael Collins <msc at freeswitch.org> wrote:
> > Could you post a sample from an Asterisk dialplan and maybe we can come
> up
> > with a good way to replicate it in FS? Possibly there is a more elegant
> > solution that does not require lots of munging.
> > -MC
> >
>
> Sure:
>
> [include]
> exten => 727,1,DoStuff
> exten => 800,1,DoOtherStuff
>
>
> [default]
> include => include
>
>  I know it's a simple case and not really an "example" but I'm really
> just looking for a way for a context to just "plow through" another
> context looking for a match before it returns "No Route" and aborts.
> Not exactly elegant but sometimes it's just got to be done (I guess).
>
>  It looks like that's what transfer is supposed to do...  Is there
> any way for me to just remove a condition on the match in [default]
> and then just run through another context as defined by my args to
> transfer before returning no route?  It would be nice to be able to do
> multiple "includes" like so:
>
>  <extension name="include" continue="true">
>    <action application="transfer" data="${dialed_ext} XML include"/>
>  </extension>
>
>  <extension name="include2" continue="true">
>    <action application="transfer" data="${dialed_ext} XML include2"/>
>  </extension>
>
>  I know it's ugly... :(
>
> --
> Kristian Kielhofner
> http://blog.krisk.org
> http://www.submityoursip.com
> http://www.astlinux.org
> http://www.star2star.com
>
> _______________________________________________
> 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/

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>
pstn:213-799-1400
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20081020/342146d2/attachment-0002.html 


More information about the FreeSWITCH-users mailing list