Like rupa said,<br>use anti-action?<br><br>Remember FreeSWITCH XML dialplan is not a programming language it's a pre-processor routing markup <br><br>Se potential use of anti-action below:<br><br> <extension name="checkdigits"><br>
<condition field="destination_number" expression="^checkdigits$"/><br>
<!--The next condition should be true if the variable $digits is not set/undefined --><br>
<condition field="${digits}" expression="^[^.+]$" /><br>
-- <action application="read" data="1 10 ivr/ivr-hello.wav digits 10000 #"/><br>
<action application="phrase" data="spell,${digits}"/><br>
<action application="transfer" data="checkdigits digits XML features"/><br> <anti-action application="set" data="not_true=true"/><br>
</condition><br>
<br>
<condition field="${pincode}" expression="^${some_variable}$"><br><div id=":8e" class="ii gt">
< SOME ACTIONS HERE ><br>
</condition><br>
</extension><br><br></div><br><br><div class="gmail_quote">On Wed, Oct 21, 2009 at 5: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>
<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>
<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><div class="h5"><br>
On Thu, Oct 22, 2009 at 4:44 AM, Michael Collins <<a href="mailto:msc@freeswitch.org">msc@freeswitch.org</a>> wrote:<br>
><br>
><br>
> On Wed, Oct 21, 2009 at 8:07 AM, Rupa Schomaker <<a href="mailto:rupa@rupa.com">rupa@rupa.com</a>> wrote:<br>
>><br>
>> You can also look at using anti-action rather than action after the<br>
>> condition.<br>
>><br>
>> condition == if<br>
>> action == then<br>
>> anti-action == else<br>
><br>
> Rupa & Leon,<br>
><br>
> Nice job of explaining the options. Sometimes we forget about the powerful<br>
> constructs that are available in FreeSWITCH and PCRE. karma++ for both of<br>
> you. :)<br>
> -MC<br>
><br>
><br>
</div></div><div><div></div><div class="h5">> _______________________________________________<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>
><br>
<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>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/">http://www.cluecon.com/</a><br>
Twitter: <a href="http://twitter.com/FreeSWITCH_wire">http://twitter.com/FreeSWITCH_wire</a><br><br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net">irc.freenode.net</a> #freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br><a href="http://iax:guest@conference.freeswitch.org/888">iax:guest@conference.freeswitch.org/888</a><br>
<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>pstn:213-799-1400<br>