<br><br><div class="gmail_quote">On Wed, Oct 21, 2009 at 3:51 PM, Mark Campbell-Smith <span dir="ltr"><<a href="mailto:mcampbellsmith@gmail.com">mcampbellsmith@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thanks Guys for your suggestions! Very much appreciated.<br>
<br>
The reason I asked was that I want to check if a variable is set or<br>
not. I don't think your suggestions will work because I actually have<br>
to check to see an undefined variable. Any way to do this?<br></blockquote><div><br>Not in the dialplan itself. Better off using a script for this. <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
I want to have the same extension for checking digits read from DTMF.<br>
The problem is that the digits are not set to the variable until the<br>
transfer statement, which means I would require 2 extensions. It<br>
will make things simpler if I can have the same extension that reads<br>
the digits and then checks them.<br></blockquote><div><br>You need either to use multiple extensions or use a script. The dialplan was specifically designed not to be a programming language and the functionality you seek is best served by using a script or by using transfer to drop the call through the diaplan again and use another extension. <br>
-MC<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
For example:<br>
<br>
<extension name="checkdigits"><br>
<condition field="destination_number" expression="^checkdigits$"/><br>
<!--The next condition should be true if the variable $digits<br>
is not set/undefined --><br>
<condition field="${digits}" expression="^[^.+]$" /><br>
-----<<<< what should be here to check for undefined variable $digits<br>
?<br>
<action application="read" data="1 10 ivr/ivr-hello.wav<br>
digits 10000 #"/><br>
<action application="phrase" data="spell,${digits}"/><br>
<action application="transfer" data="checkdigits digits XML<br>
features"/><br>
</condition><br>
<br>
<condition field="${pincode}" expression="^${some_variable}$"><br>
< SOME ACTIONS HERE ><br>
</condition><br>
</extension><br>
<div><div></div><br></div></blockquote></div><br>