[Freeswitch-users] Nested conditions
David Ponzone
david.ponzone at ipeva.fr
Tue Nov 9 23:34:52 PST 2010
Santiago,
you would do this way:
<extension name="call_extension">
<condition field="network_addr" expression="10.1.1.1">
<action application="set" data="continue_on_fail=USER_BUSY"/>
<action application="set" data="hangup_after_bridge=true"/>
<action application="bridge" data="sofia/gateway/profile/${sip_to_user}"/>
<action application="transfer" data="header_test_extension"/>
</condition>
</extension>
<extension name="header_test_extension">
<condition field="${sip_h_X-Header-Name}" expression="Header Value">
<action application="respond" data="404"/>
<action application="hangup"/>
</condition>
</extension>
That's the idea, but I am really not sure you can test the value of ${sip_h_X-Header-Name} if that header is sent back by the called endpoint...
David Ponzone Direction Technique
email: david.ponzone at ipeva.fr
tel: 01 74 03 18 97
gsm: 06 66 98 76 34
Service Client IPeva
tel: 0811 46 26 26
www.ipeva.fr - www.ipeva-studio.com
Ce message et toutes les pièces jointes sont confidentiels et établis à l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisée est interdite. Tout message électronique est susceptible d'altération. IPeva décline toute responsabilité au titre de ce message s'il a été altéré, déformé ou falsifié. Si vous n'êtes pas destinataire de ce message, merci de le détruire immédiatement et d'avertir l'expéditeur.
Le 08/11/2010 à 21:46, Santiago Soares a écrit :
> Hello everybody,
>
> I'd like to handle my calls like this:
> If callee sends a "486 User Busy" AND a certain header is present in the response, Freeswitch would send a "404 Not Found" to the caller.
> The following code would solve my problem:
>
> <extension name="header_test_extension">
>
> <condition field="network_addr" expression="10.1.1.1">
> <action application="set" data="continue_on_fail=USER_BUSY"/>
> <action application="bridge" data="sofia/gateway/profile/${sip_to_user}"/>
> <condition field="${sip_h_X-Header-Name}" expression="Header Value">
> <action application="respond" data="404"/>
> <action application="hangup"/>
> </condition>
> </condition>
>
> </extension>
>
> But the thing is that Freeswitch doesn't allow nested conditions.
>
> Any ideas on how I can handle this?
>
> Santiago Soares
> Fone: (41) 8488-0537
> _______________________________________________
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20101110/5bc83105/attachment.html
More information about the FreeSWITCH-users
mailing list