[Freeswitch-users] Action and Anti-Action

Michael Collins msc at freeswitch.org
Thu Mar 26 09:07:59 PDT 2009


Look in the default.xml dialplan file for the "tod_example" extension.
(It's near the top of the file.) It has an example of how to create an
extension that simply sets a variable that can be used in other
extensions in the dialplan.

-MC

2009/3/26 Rodrigo P. Telles <telles-listas at devel-it.com.br>:
> Hi Guys,
>
> I'm trying to do some string matching against a created var and looks like I
> am doing something wrong but I can't find whats it.
>
> I'm wrote an extension just for tests purposes on dialplan/default.xml:
>
> <extension name="nat_detect" continue="true">
>      <condition>
>         <action application="set" data="nated=${cond(${network_addr} !=
> ${sip_contact_host} ? 1 : 0)}"/>
>      </condition>
>      <condition field="${nated}" expression="1">
>        <action application="log" data="Action=${nated}"/>
>        <action application="set" data="proxy_media=true"/>
>        <action application="set" data="sip_nat_detected=true"/>
>        <anti-action application="log" data="Anti-Action=${nated}"/>
>      </condition>
> </extension>
>
> Using two SIP extensions (1000 and 1001) behind NAT and I expected too see
> "Action=1" on the logs/console, but I'm seeing "Anti-Action=1".
>
> 2009-03-26 11:02:57 [DEBUG] switch_core_state_machine.c:152
> switch_core_standard_on_execute() sofia/internal/1001 at x.x.x.x Execute
> set(nated=${cond(${network_addr} != ${sip_contact_host} ? 1 : 0)})
> 2009-03-26 11:02:57 [DEBUG] switch_core_session.c:1286
> switch_core_session_exec() sofia/internal/1001 at x.x.x.x Expanded String
> set(nated=1)
> 2009-03-26 11:02:57 [DEBUG] mod_dptools.c:711 set_function()
> sofia/internal/1001 at x.x.x.x SET [nated]=[1]
> 2009-03-26 11:02:57 [DEBUG] switch_core_state_machine.c:152
> switch_core_standard_on_execute() sofia/internal/1001 at x.x.x.x Execute
> log(Anti-Action=${nated})
> 2009-03-26 11:02:57 [DEBUG] switch_core_session.c:1286
> switch_core_session_exec() sofia/internal/1001 at x.x.x.x Expanded String
> log(Anti-Action=1)
> 2009-03-26 11:02:57 [DEBUG] mod_dptools.c:895 log_function() Anti-Action=1
> 2009-03-26 11:02:57 [DEBUG] switch_core_state_machine.c:152
> switch_core_standard_on_execute() sofia/internal/1001 at x.x.x.x Execute
> set(dialed_extension=1000)
> ....
>
> I really appreciate any inputs.
> I'm using FS 1.0.3 stable.
>
> regards,
> Rodrigo Telles
>
>
> _______________________________________________
> 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