Variables are not fields. Fields are a specific set of attributes of the call... you can however check variables in a condition, it just has a slightly different syntax. Try this.<br><br><p class="MsoNormal"><extension name="public_did"></p>
<p class="MsoNormal"> <condition field="destination_number" expression="^(.*)$"></p><p class="MsoNormal"> <action inline="true" application="set" data="hours=1"/></p>
<p class="MsoNormal"> </condition></p><p class="MsoNormal"> <condition field="${hours}" expression="^1$"></p><p class="MsoNormal"> <action application="answer"/></p>
<p class="MsoNormal"> <action application="ivr" data="GAC-BH"/></p><p class="MsoNormal"> <action application="hangup"/></p><p class="MsoNormal"> <anti-action application="answer"/></p>
<p class="MsoNormal"> <anti-action application="ivr" data="GAC-BH"/></p><p class="MsoNormal"> <anti-action application="hangup"/></p><p class="MsoNormal"> </condition></p>
<p class="MsoNormal"> </extension></p> <br>Also note I changed your regex of "1" to "^1$". The first matches any
string containing a digit 1 including 10, 21, 100, 200351. The latter
matches the start (^) and end ($) of the string so will only match the
exact string of 1.<br><br>-Steve<br><br><div class="gmail_quote">On 25 July 2011 20:54, Joshua Foshee <span dir="ltr"><<a href="mailto:Joshua.Foshee@logixcom.com">Joshua.Foshee@logixcom.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div link="blue" vlink="purple" lang="EN-US"><div><p class="MsoNormal">I am trying to set a variable in the dial plan and use it on a condition. I have pushed the variable setting as close to the condition for testing and this is what I get. Why does it not see the variable set?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><extension name="public_did"><u></u><u></u></p><p class="MsoNormal"> <condition field="destination_number" expression="^(.*)$"><u></u><u></u></p>
<p class="MsoNormal"> <action inline="true" application="set" data="hours=1"/><u></u><u></u></p><p class="MsoNormal"> </condition><u></u><u></u></p><p class="MsoNormal">
<condition field="hours" expression="1"><u></u><u></u></p><p class="MsoNormal"> <action application="answer"/><u></u><u></u></p><p class="MsoNormal"> <action application="ivr" data="GAC-BH"/><u></u><u></u></p>
<p class="MsoNormal"> <action application="hangup"/><u></u><u></u></p><p class="MsoNormal"> <anti-action application="answer"/><u></u><u></u></p><p class="MsoNormal"> <anti-action application="ivr" data="GAC-BH"/><u></u><u></u></p>
<p class="MsoNormal"> <anti-action application="hangup"/><u></u><u></u></p><p class="MsoNormal"> </condition><u></u><u></u></p><p class="MsoNormal"> </extension><u></u><u></u></p><p class="MsoNormal">
<u></u> <u></u></p><p class="MsoNormal">Here is the console output<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Dialplan: FreeTDM/1:7/405790xxx8 Regex (PASS) [public_did] destination_number(405790xxx8) =~ /^(.*)$/ break=on-false<u></u><u></u></p>
<p class="MsoNormal">Dialplan: FreeTDM/1:7/405790xxx8 Action set(hours=1) INLINE<u></u><u></u></p><p class="MsoNormal">EXECUTE FreeTDM/1:7/405790xxx8 set(hours=1)<u></u><u></u></p><p class="MsoNormal">2011-07-25 12:05:25.191357 [DEBUG] mod_dptools.c:1063 FreeTDM/1:7/405790xxx8 SET [hours]=[1]<u></u><u></u></p>
<p class="MsoNormal">Dialplan: FreeTDM/1:7/405790xxx8 Regex (FAIL) [public_did] hours() =~ /1/ break=on-false<u></u><u></u></p><p class="MsoNormal">Dialplan: FreeTDM/1:7/405790xxx8 ANTI-Action answer()<u></u><u></u></p><p class="MsoNormal">
Dialplan: FreeTDM/1:7/405790xxx8 ANTI-Action ivr(GAC-BH)<u></u><u></u></p><p class="MsoNormal">Dialplan: FreeTDM/1:7/405790xxx8 ANTI-Action hangup()<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">
<u></u> <u></u></p><p class="MsoNormal"><u></u> <u></u></p></div></div><br>_______________________________________________<br>
Join us at ClueCon 2011, Aug 9-11, Chicago<br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a> 877-7-4ACLUE<br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br><div style="visibility: hidden; left: -5000px; position: absolute; z-index: 9999; padding: 0px; margin-left: 0px; margin-top: 0px; overflow: hidden; word-wrap: break-word; color: black; font-size: 10px; text-align: left; line-height: 130%;" id="avg_ls_inline_popup">
</div>