<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Mike,<br>
<br>
Using a single condition did the trick, thanks :-)<br>
Based on Brian's explanation the example from
<a class="moz-txt-link-freetext" href="http://wiki.freeswitch.org/wiki/Proxy_Media">http://wiki.freeswitch.org/wiki/Proxy_Media</a> is buggy...<br>
<br>
regards,<br>
Rodrigo Telles<br>
<br>
Michael Jerris wrote:
<blockquote cite="mid:FA78FEAC-D062-4944-9ECB-2B0D0296B21A@jerris.com"
type="cite">Actions are all run AFTER all conditions are parsed so the
nated var is not set yet. you can do a single condition in this case,
and set nated for use elsewhere if you need it in the actions.
<div><br>
</div>
<div>Mike</div>
<div><br>
<div>
<div>On Mar 26, 2009, at 10:27 AM, Rodrigo P. Telles wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div bgcolor="#ffffff" text="#000000"> <font
face="Helvetica, Arial, sans-serif">Hi Guys,<br>
<br>
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.<br>
<br>
I'm wrote an extension just for tests purposes on dialplan/default.xml:<br>
<br>
<extension name="nat_detect" continue="true"><br>
<condition><br>
<action application="set" data="nated=${cond(${network_addr}
!= ${sip_contact_host} ? 1 : 0)}"/><br>
</condition><br>
<condition field="${nated}" expression="1"><br>
<action application="log" data="Action=${nated}"/><br>
<action application="set" data="proxy_media=true"/><br>
<action application="set" data="sip_nat_detected=true"/><br>
<anti-action application="log"
data="Anti-Action=${nated}"/><br>
</condition><br>
</extension><br>
<br>
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".<br>
<br>
2009-03-26 11:02:57 [DEBUG] switch_core_state_machine.c:152
switch_core_standard_on_execute() <a moz-do-not-send="true"
class="moz-txt-link-abbreviated"
href="mailto:sofia/internal/1001@x.x.x.x">sofia/internal/1001@x.x.x.x</a>
Execute set(nated=${cond(${network_addr} != ${sip_contact_host} ? 1 :
0)})<br>
2009-03-26 11:02:57 [DEBUG] switch_core_session.c:1286
switch_core_session_exec() <a moz-do-not-send="true"
class="moz-txt-link-abbreviated"
href="mailto:sofia/internal/1001@x.x.x.x">sofia/internal/1001@x.x.x.x</a>
Expanded String set(nated=1)<br>
2009-03-26 11:02:57 [DEBUG] mod_dptools.c:711 set_function() <a
moz-do-not-send="true" class="moz-txt-link-abbreviated"
href="mailto:sofia/internal/1001@x.x.x.x">sofia/internal/1001@x.x.x.x</a>
SET [nated]=[1]<br>
2009-03-26 11:02:57 [DEBUG] switch_core_state_machine.c:152
switch_core_standard_on_execute() <a moz-do-not-send="true"
class="moz-txt-link-abbreviated"
href="mailto:sofia/internal/1001@x.x.x.x">sofia/internal/1001@x.x.x.x</a>
Execute log(Anti-Action=${nated})<br>
2009-03-26 11:02:57 [DEBUG] switch_core_session.c:1286
switch_core_session_exec() <a moz-do-not-send="true"
class="moz-txt-link-abbreviated"
href="mailto:sofia/internal/1001@x.x.x.x">sofia/internal/1001@x.x.x.x</a>
Expanded String log(Anti-Action=1)<br>
2009-03-26 11:02:57 [DEBUG] mod_dptools.c:895 log_function()
Anti-Action=1<br>
2009-03-26 11:02:57 [DEBUG] switch_core_state_machine.c:152
switch_core_standard_on_execute() <a moz-do-not-send="true"
class="moz-txt-link-abbreviated"
href="mailto:sofia/internal/1001@x.x.x.x">sofia/internal/1001@x.x.x.x</a>
Execute set(dialed_extension=1000)<br>
....<br>
<br>
I really appreciate any inputs.<br>
I'm using FS 1.0.3 stable.<br>
<br>
regards,<br>
Rodrigo Telles<br>
<br>
</font> </div>
</blockquote>
</div>
</div>
</blockquote>
<br>
</body>
</html>