[Freeswitch-users] Nested conditions and anti-actions

Mimiko vbvbrj at gmail.com
Fri Jan 20 09:36:55 MSK 2017


Yes, I know this, Ken. The problem is with nested condition. Anti-actions in nested conditions are executed if parent condition fail? Also, I've 
observed that even if parent condition fail, actions or anti-actions in nested condition is executed. Ie, nested condition is checked and if fails - 
anti-action is executed, if it pass - actions is executed, regardless if parent condition fail or pass.

I expected that any actions/anti-actions in nested condition will be executed only if parent condition pass. Yes, wiki states that parent condition is 
not checked until nested-conditions are not checked. But, if at the end parent condition fails, whole extension should not be executed.

For now I changed the conditions in a simple AND without nested conditions.


On 19.01.2017 19:13, Ken Rice wrote:
> This is buy design...
>
> <condition><action/></anti-action></condition>
>
> Is the if CONDITION then ACTION else ANTI-ACTION
>
> And keep in mind the dialplan is not a programming language... once you
> reach a certain point that's what things like lua xml_curl and just
> replacing the dialplan with a custom C module are for
>
>
> -----Original Message-----
> From: freeswitch-users-bounces at lists.freeswitch.org
> [mailto:freeswitch-users-bounces at lists.freeswitch.org] On Behalf Of Mimiko
> Sent: Thursday, January 19, 2017 8:36 AM
> To: FreeSWITCH Users Help <freeswitch-users at lists.freeswitch.org>
> Subject: [Freeswitch-users] Nested conditions and anti-actions
>
> Hello.
>
> This is a snipped:
>
> <condition field="destination_number" expression="^(1001|1002)$"
> require-nested="false">
>   <condition field="${effective_caller_id_name}" expression="^.+$"
> break="never">
>    <action application="export"
> data="caller_id_name=${effective_caller_id_name} > ${destination_number}"/>
>    <action application="export"
> data="effective_caller_id_name=${effective_caller_id_name} >
> ${destination_number}"/>
>    <anti-action application="export" data="caller_id_name=${caller_id_name}
>> ${destination_number}"/>
>    <anti-action application="export"
> data="effective_caller_id_name=${caller_id_name} > ${destination_number}"/>
>   </condition>
> <action .... />
> </condition>
>
> The problem I'm facing is that anti-actions are evaluated even if
> destination_number is not equal to 1001 or 1002. But I need that ant-actions
> will evaluate only when parent condition is true.
>
> Is this a bug or it is by design?
>
> --
> Mimiko desu.
>


-- 
Mimiko desu.



Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list