[Freeswitch-users] Using Variables in Dialplans
Michael Collins
msc at freeswitch.org
Thu Apr 23 08:28:55 PDT 2009
On Wed, Apr 22, 2009 at 5:20 PM, Chris Fowler <chris at fowler.cc> wrote:
> Brian, Michael,
>
> Thanks for the help - I had read that but not fully comprehended it until
> you spun it the way you did.
>
> Here's what I ended up with - if there's optimization that could be done
> let me know. Happy to update the wiki if this is a common request.
That looks pretty good. It is clean and readable and most importantly it
sounds like it does what you need! :)
-MC
>
>
> <!-- Provide an internal ext # for Sales -->
> <extension name="RS-Sales-x2002">
> <condition field="destination_number" expression="^2002$">
> <action application="transfer" data="RS-Sales"/>
> </condition>
> </extension>
>
> <!-- Setup variables prior to transfering to call handler for sales -->
> <extension name="RS-Sales" continue="true">
> <!-- man strftime - M-F, 9AM to 5PM -->
> <condition field="destination_number" expression="^RS-Sales$"/>
> <condition field="${strftime(%w)}" expression="^([1-5])$"/>
> <condition field="${strftime(%H%M)}"
> expression="^((09|1[0-6])[0-5][0-9]|1700)$">
> <action application="set" data="RS-Sales_open=true"/>
> <action application="transfer" data="xfer-to-sales"/>
> <anti-action application="set" data="RS-Sales_open=false"/>
> <anti-action application="transfer" data="xfer-to-sales"/>
> </condition>
> </extension>
>
> <!-- Handle Sales Call -->
> <!-- If Sales is open then route to extension first then vMail; else
> direct to vMail -->
> <extension name="xfer-to-sales">
> <condition field="destination_number" expression="^xfer-to-sales$"/>
> <condition field="${RS-Sales_open}" expression="^true$">
> <action application="bridge" data="user/1001@${domain_name}"/>
> <action application="answer"/>
> <action application="sleep" data="2000"/>
> <action application="voicemail" data="default ${domain_name} 2001"/>
> <anti-action application="voicemail" data="default ${domain_name}
> 2001"/>
> </condition>
> </extension>
>
> Thx, Chris.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20090423/230f6edd/attachment-0002.html
More information about the FreeSWITCH-users
mailing list