<br><br><div class="gmail_quote">On Fri, Apr 27, 2012 at 9:25 AM, Chris B. Ware <span dir="ltr"><<a href="mailto:chrisbware@yahoo.it" target="_blank">chrisbware@yahoo.it</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div style="font-size:12pt;font-family:times new roman,new york,times,serif"><div style="font-family:'times new roman','new york',times,serif;font-size:12pt">Hi,</div><div style="font-family:'times new roman','new york',times,serif;font-size:12pt">
<br></div><div style="font-family:'times new roman','new york',times,serif;font-size:12pt">I'd like to set a channel variable and use it in a time condition like this:</div><div style="font-family:'times new roman','new york',times,serif;font-size:12pt">
<br></div><div><font face="'times new roman', 'new york', times, serif"><condition mon="${rmon}" ></font><br></div><div><font face="'times new roman', 'new york', times, serif"><br>
</font></div><div><font face="'times new roman', 'new york', times, serif">with rmon=1-12 (just to be sure condition is verified).</font></div><div><font face="'times new roman', 'new york', times,
serif"><br></font></div><div><font face="'times new roman', 'new york', times, serif">I can't find out why it doesn't work. </font></div><div><font face="'times new roman', 'new york', times, serif"><br>
</font></div><div><font face="'times new roman', 'new york', times, serif">- Using <action application="info"/> , I can see variable is set [1-12]</font></div><div><font face="'times new roman', 'new york', times, serif">- I've tried also </font><span style="font-family:'times new roman','new york',times,serif"><condition mon="${rmon}" inline="true"></span></div>
<div><span style="font-family:'times new roman','new york',times,serif">- Using directly </span><span style="font-family:'times new roman','new york',times,serif"><condition mon="1-12" > it works</span></div>
<div><span style="font-family:'times new roman','new york',times,serif"><br></span></div></div></div></blockquote><br></div>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.<br>
<br>Try this:<br><condition field="${rmon}" expression="^[12]?[0-9]$"><br><br>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:<br>
<a href="http://wiki.freeswitch.org/wiki/Dialplan_XML#Caller_Profile_Fields_vs._Channel_Variables">http://wiki.freeswitch.org/wiki/Dialplan_XML#Caller_Profile_Fields_vs._Channel_Variables</a><br><br>Let us know how it goes!<br>
-MC<br>