Like rupa said, use anti-action? Remember FreeSWITCH XML dialplan is not a programming language it's a pre-processor routing markup Se potential use of anti-action below: <extension name="checkdigits"> <condition field="destination_number" expression="^checkdigits$"/> <!--The next condition should be true if the variable $digits is not set/undefined --> <condition field="${digits}" expression="^[^.+]$" /> -- <action application="read" data="1 10 ivr/ivr-hello.wav digits 10000 #"/> <action application="phrase" data="spell,${digits}"/> <action application="transfer" data="checkdigits digits XML features"/> <anti-action application="set" data="not_true=true"/> </condition> <condition field="${pincode}" expression="^${some_variable}$"> < SOME ACTIONS HERE > </condition> </extension> On Wed, Oct 21, 2009 at 5:51 PM, Mark Campbell-Smith < mcampbellsmith@gmail.com> wrote:
Thanks Guys for your suggestions! Very much appreciated.
The reason I asked was that I want to check if a variable is set or not. I don't think your suggestions will work because I actually have to check to see an undefined variable. Any way to do this?
I want to have the same extension for checking digits read from DTMF. The problem is that the digits are not set to the variable until the transfer statement, which means I would require 2 extensions. It will make things simpler if I can have the same extension that reads the digits and then checks them.
For example:
<extension name="checkdigits"> <condition field="destination_number" expression="^checkdigits$"/> <!--The next condition should be true if the variable $digits is not set/undefined --> <condition field="${digits}" expression="^[^.+]$" /> -----<<<< what should be here to check for undefined variable $digits ? <action application="read" data="1 10 ivr/ivr-hello.wav digits 10000 #"/> <action application="phrase" data="spell,${digits}"/> <action application="transfer" data="checkdigits digits XML features"/> </condition>
<condition field="${pincode}" expression="^${some_variable}$"> < SOME ACTIONS HERE > </condition> </extension>
On Thu, Oct 22, 2009 at 4:44 AM, Michael Collins <msc@freeswitch.org> wrote:
On Wed, Oct 21, 2009 at 8:07 AM, Rupa Schomaker <rupa@rupa.com> wrote:
You can also look at using anti-action rather than action after the condition.
condition == if action == then anti-action == else
Rupa & Leon,
Nice job of explaining the options. Sometimes we forget about the
powerful
constructs that are available in FreeSWITCH and PCRE. karma++ for both of you. :) -MC
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> iax:guest@conference.freeswitch.org/888 googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:213-799-1400