[Freeswitch-users] Time routing issue

Michael Collins msc at freeswitch.org
Mon Apr 30 07:15:21 MSD 2012


On Fri, Apr 27, 2012 at 9:25 AM, Chris B. Ware <chrisbware at yahoo.it> wrote:

> Hi,
>
> I'd like to set a channel variable and use it in a time condition like
> this:
>
> <condition mon="${rmon}" >
>
> with rmon=1-12 (just to be sure condition is verified).
>
> I can't find out why it doesn't work.
>
> - Using <action application="info"/> , I can see variable is set [1-12]
> - I've tried also <condition mon="${rmon}"  inline="true">
> - Using directly  <condition mon="1-12" > it works
>
>
Like Jeff says, be sure that the ${rmon} variable is getting set with the
inline="true" attribute. Note: You don't use inline="true" in a condition
tag.

Try this:
<condition field="${rmon}" expression="^[12]?[0-9]$">

You need to use a regular expression when checking the value of a channel
variable and you need to wrap the the chan var in ${}. Check this section
of the XML Dialplan wiki page:
http://wiki.freeswitch.org/wiki/Dialplan_XML#Caller_Profile_Fields_vs._Channel_Variables

Let us know how it goes!
-MC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20120429/043baadf/attachment-0001.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list