[Freeswitch-users] FreeSWITCH-users Digest, Vol 40, Issue 179

Mark Campbell-Smith mcampbellsmith at gmail.com
Wed Oct 21 21:28:41 PDT 2009


Can't you use the inline statement to set a variable so that it can be
used directly in a condition?

http://wiki.freeswitch.org/wiki/Dialplan_XML#Inline_Actions


On Thu, Oct 22, 2009 at 3:08 PM, Ahmed Munir <ahmedmunir007 at gmail.com> wrote:
> Hi,
>
> Thanks for reply, it really helped me. One more thing to ask, how can we
> make decision against >,<, >=, <= in condition header? Like we use == for
> action and != for anti-action.
>
> Kindly highlight it.
>
>
>
>>
>> ---------- Forwarded message ----------
>> From: Ahmed Munir <ahmedmunir007 at gmail.com>
>> To: FreeSwitch <freeswitch-users at lists.freeswitch.org>
>> Date: Wed, 21 Oct 2009 15:37:15 +0500
>> Subject: [Freeswitch-users] Call custom variable in condition
>> Hi,
>>
>> I've declared a variable named AUTHENTICATION_STATUS in dialplan, and I
>> want to use it in condition, as I'm listing down the configuration below;
>>
>> <context name="SIP_incoming">
>>    <extension name="call-sip-extensions">
>>       <condition field="destination_number" expression="^(\d+)$">
>>           <action application="set" data="AUTHENTICATION_STATUS=0"/>
>>            <action application="transfer" data="${AUTHENTICATION_STATUS}
>> XML Authen_Status"/>
>>       </condition>
>>    </extension>
>> </context>
>>
>> <context name="Authen_Status">
>>      <extension name="exten-auth-status">
>>        <condition field="AUTHENTICATION_STATUS" expression="^0$">
>>           <action application="answer"/>
>>           <action application="playback" data="play.wav"/>
>>       </condition>
>>     </extension>
>>   </context>
>>
>>
>>
>>
>>  But unfortunately it is not working. Kindly advise me how to do implement
>> it(Note: I don't want to call script). And one more thing to ask how can I
>> transfer the values within the same context?
>>
>> --
>> Regards,
>>
>> Ahmed Munir
>>
>>
>>
>>
>> ---------- Forwarded message ----------
>> From: Ghulam Mustafa <mustafa.pk at gmail.com>
>> To: freeswitch-users at lists.freeswitch.org
>> Date: Wed, 21 Oct 2009 15:52:24 +0500
>> Subject: Re: [Freeswitch-users] Call custom variable in condition
>> Ahmed,
>>
>> you can't use variables set by "set" application within a condition,
>> though it doesn't make sense. wondering if there is any logic behind this or
>> it's just a simple missing feature. anyone?
>>
>> -m
>>
>> Ahmed Munir wrote:
>>>
>>> Hi,
>>>
>>> I've declared a variable named AUTHENTICATION_STATUS in dialplan, and I
>>> want to use it in condition, as I'm listing down the configuration below;
>>>
>>> <context name="SIP_incoming">
>>>   <extension name="call-sip-extensions">
>>>      <condition field="destination_number" expression="^(\d+)$">
>>>          <action application="set" data="AUTHENTICATION_STATUS=0"/>
>>>           <action application="transfer" data="${AUTHENTICATION_STATUS}
>>> XML Authen_Status"/>
>>>      </condition>
>>>   </extension>
>>> </context>
>>>
>>> <context name="Authen_Status">
>>>     <extension name="exten-auth-status">
>>>       <condition field="AUTHENTICATION_STATUS" expression="^0$">
>>>          <action application="answer"/>
>>>          <action application="playback" data="play.wav"/>
>>>      </condition>
>>>    </extension>
>>>  </context>
>>>
>>>
>>>
>>>
>>>  But unfortunately it is not working. Kindly advise me how to do
>>> implement it(Note: I don't want to call script). And one more thing to ask
>>> how can I transfer the values within the same context?
>>>
>>> --
>>> Regards,
>>>
>>> Ahmed Munir
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> 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
>>>
>>
>>
>>
>>
>>
>> ---------- Forwarded message ----------
>> From: Tihomir Culjaga <tculjaga at gmail.com>
>> To: freeswitch-users at lists.freeswitch.org
>> Date: Wed, 21 Oct 2009 13:13:13 +0200
>> Subject: Re: [Freeswitch-users] Call custom variable in condition
>> consider this:
>>
>>
>>
>> <context name="SIP_incoming">
>>    <extension name="call-sip-extensions">
>>       <condition field="destination_number" expression="^(\d+)$">
>>           <action application="set" data="AUTHENTICATION_STATUS=0"/>
>>            <action application="transfer" data="${AUTHENTICATION_STATUS}
>> XML Authen_Status"/>
>>       </condition>
>>    </extension>
>> </context>
>>
>>
>>
>> <context name="Authen_Status">
>>      <extension name="exten-auth-status">
>>        <condition field="${AUTHENTICATION_STATUS}" expression="^0$">
>>           <action application="answer"/>
>>           <action application="playback" data="play.wav"/>
>>       </condition>
>>     </extension>
>>   </context>
>>
>>
>>
>>
>>
>> here is one of my dialplan. I'm using execute_extension but it is quite
>> the same...
>>
>>
>>
>>    <extension name="ServiceLookup">
>>       <condition field="destination_number" expression="(^300030)(.*)">
>>          <action application="lookup_service_destination" data="in
>> ${caller_id_number:6:16}, in ${caller_id_number:0:6}, in $2, in $
>> 1, in ${network_addr}:5060, out red_contact, out authResult"/>
>>          <action application="log" data="INFO ########################
>> ServiceLookup ########################\n"/>
>>          <action application="log" data="INFO ########################
>> contact = '${red_contact}' ##############\n"/>
>>          <action application="log" data="INFO ########################
>> CallerNum = '${caller_id_number:6:16}' ##########\n"/>
>>          <action application="log" data="INFO ########################
>> RADIUS auth = '${authResult}' ##########\n"/>
>>
>>          <action application="execute_extension" data="doRedirect XML
>> public"/>
>>         </condition>
>>    </extension>
>>
>>
>>    <extension name="doRedirect">
>>       <condition field="destination_number" expression="^doRedirect$"/>
>>       <condition field="${authResult}" expression="^0$|^60$">
>>          <action application="log" data="INFO ########################
>> RADIUS auth OK!!!' ##########\n"/>
>>          <action application="redirect" data="${red_contact}"/>
>>          <anti-action application="log" data="INFO
>> ######################## RADIUS auth NOK!! ##########\n"/>
>>          <anti-action application="respond" data="403 Forbidden"/>
>>       </condition>
>>
>>    </extension>
>>
>>
>>
>>
>> On Wed, Oct 21, 2009 at 12:37 PM, Ahmed Munir <ahmedmunir007 at gmail.com>
>> wrote:
>>>
>>> Hi,
>>>
>>> I've declared a variable named AUTHENTICATION_STATUS in dialplan, and I
>>> want to use it in condition, as I'm listing down the configuration below;
>>>
>>> <context name="SIP_incoming">
>>>    <extension name="call-sip-extensions">
>>>       <condition field="destination_number" expression="^(\d+)$">
>>>           <action application="set" data="AUTHENTICATION_STATUS=0"/>
>>>            <action application="transfer" data="${AUTHENTICATION_STATUS}
>>> XML Authen_Status"/>
>>>       </condition>
>>>    </extension>
>>> </context>
>>>
>>> <context name="Authen_Status">
>>>      <extension name="exten-auth-status">
>>>        <condition field="AUTHENTICATION_STATUS" expression="^0$">
>>>           <action application="answer"/>
>>>           <action application="playback" data="play.wav"/>
>>>       </condition>
>>>     </extension>
>>>   </context>
>>>
>>>
>>>
>>>
>>>  But unfortunately it is not working. Kindly advise me how to do
>>> implement it(Note: I don't want to call script). And one more thing to ask
>>> how can I transfer the values within the same context?
>>>
>>> --
>>> Regards,
>>>
>>> Ahmed Munir
>>>
>>>
>>>
>>> _______________________________________________
>>> 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
>>>
>>
>>
>> _______________________________________________
>> 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
>>
>
>
>
> --
> Regards,
>
> Ahmed Munir
>
>
>
> _______________________________________________
> 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