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 What's wrong? Help, please
Are you setting the rmon variable in the same dialplan execution? If so you will need to inline the set of the variable. -- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/Time-routing-issue-tp7506728p7... Sent from the freeswitch-users mailing list archive at Nabble.com.
On Fri, Apr 27, 2012 at 9:25 AM, Chris B. Ware <chrisbware@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._Chann... Let us know how it goes! -MC
On Fri, Apr 27, 2012 at 9:25 AM, Chris B. Ware <chrisbware@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._Chann... Let us know how it goes! -MC
participants (3)
-
Chris B. Ware
-
Jeff Lenk
-
Michael Collins