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 <
[email protected]> 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 <[email protected]>
> wrote:
> >
> >
> > On Wed, Oct 21, 2009 at 8:07 AM, Rupa Schomaker <[email protected]> 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
> > [email protected]
> > 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
> [email protected]
> 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:[email protected] <msn%[email protected]>
GTALK/JABBER/PAYPAL:[email protected]<paypal%[email protected]>
IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference
sip:[email protected] <sip%[email protected]>
iax:[email protected]/888
googletalk:[email protected]<googletalk%3aconf%[email protected]>
pstn:213-799-1400
_______________________________________________
FreeSWITCH-users mailing list
[email protected]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org