[Freeswitch-users] NOT in dialplan expression

Mark Campbell-Smith mcampbellsmith at gmail.com
Wed Oct 21 15:51:47 PDT 2009


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 at freeswitch.org> wrote:
>
>
> On Wed, Oct 21, 2009 at 8:07 AM, Rupa Schomaker <rupa at 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 at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>




More information about the FreeSWITCH-users mailing list