<div dir="ltr">if both field and expression are not present in the &lt;condition&gt; tag.&nbsp; It is instantly evaluated as true without performing the regex.&nbsp; Therefore there is no expansion and the $1 will remain $1.<br><br>
Notice all you examples that do not work are missing the field=<br><br>e.g.<br>&lt;condition &quot;${sip_referred_by_user}&quot; expression=&quot;4473451&quot;&gt;<br><br><br><div class="gmail_quote">On Thu, Jul 17, 2008 at 4:08 AM, Matt Darnell &lt;<a href="mailto:mattdarnell@gmail.com">mattdarnell@gmail.com</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="Wj3C7c">On Wed, Jul 16, 2008 at 10:59 PM, Matt Darnell &lt;<a href="mailto:mattdarnell@gmail.com">mattdarnell@gmail.com</a>&gt; wrote:<br>

&gt;&gt; I would like the dial plan to route based on the number in the<br>
&gt;&gt; Refered-By or Diversion field.<br>
&gt;<br>
&gt; &nbsp; &nbsp;&lt;extension name=&quot;Mailbox_4473451&quot;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&lt;condition &quot;${sip_referred_by_user}&quot; expression=&quot;4473451&quot;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp;&lt;action application=&quot;info&quot;/&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp;&lt;action application=&quot;export&quot; data=&quot;sip_h_Diversion=3451&quot;/&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp;&lt;action application=&quot;bridge&quot;<br>
&gt; data=&quot;{absolute_codec_string=PCMA}sofia/gateway/<a href="http://gw.akamaitel.com/3451" target="_blank">gw.akamaitel.com/3451</a>&quot;/&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&lt;/condition&gt;<br>
&gt; &nbsp; &nbsp;&lt;/extension&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp;&lt;extension name=&quot;Mailbox_4473452&quot;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&lt;condition &quot;${sip_referred_by_user}&quot; expression=&quot;4473452&quot;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp;&lt;action application=&quot;info&quot;/&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp;&lt;action application=&quot;export&quot; data=&quot;sip_h_Diversion=3452&quot;/&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp;&lt;action application=&quot;bridge&quot;<br>
&gt; data=&quot;{absolute_codec_string=PCMA}sofia/gateway/<a href="http://gw.akamaitel.com/3452" target="_blank">gw.akamaitel.com/3452</a>&quot;/&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&lt;/condition&gt;<br>
&gt; &nbsp; &nbsp;&lt;/extension&gt;<br>
&gt;<br>
&gt; For some reason, all calls go to the first extension. &nbsp;When I look at<br>
&gt; the out put from info, the sip_referred_by_user is 4473452 but it<br>
&gt; still routes to the first extension.<br>
&gt; variable_sip_referred_by_user: [4473452]<br>
&gt;<br>
&gt; I have even changed the condition statement of the first extensin to :<br>
&gt; &lt;condition &quot;${sip_referred_BOGUS_by_user}&quot; expression=&quot;4473451&quot;&gt;<br>
&gt; and it still executes that extension.<br>
&gt;<br>
&gt; Please let me know if you can see the issue.<br>
&gt;<br>
&gt; -Matt<br>
&gt;<br>
<br>
</div></div>Another interesting thing is that if I have this:<br>
 &nbsp; &nbsp;&lt;extension name=&quot;Mailbox_4473451&quot;&gt;<br>
 &nbsp; &nbsp; &nbsp;&lt;condition &quot;${sip_referred_by_user}&quot; expression=&quot;^\d{3}(\d{4})$&quot;&gt;<br>
 &nbsp; &nbsp; &nbsp; &nbsp;&lt;action application=&quot;info&quot;/&gt;<br>
 &nbsp; &nbsp; &nbsp; &nbsp;&lt;action application=&quot;export&quot; data=&quot;sip_h_Diversion=$1&quot;/&gt;<br>
 &nbsp; &nbsp; &nbsp; &nbsp;&lt;action application=&quot;bridge&quot;<br>
data=&quot;{absolute_codec_string=PCMA}sofia/gateway/<a href="http://gw.akamaitel.com/$1" target="_blank">gw.akamaitel.com/$1</a>&quot;/&gt;<br>
 &nbsp; &nbsp; &nbsp;&lt;/condition&gt;<br>
 &nbsp; &nbsp;&lt;/extension&gt;<br>
<br>
$1 does not get populated with \d{4}, the invite has $1 in the string.<br>
<br>
This however works fine:<br>
&lt;condition field=&quot;destination_number&quot; expression=&quot;^\d{3}(\d{4})$&quot;&gt;<br>
<div><div></div><div class="Wj3C7c"><br>
-Matt<br>
<br>
_______________________________________________<br>
Freeswitch-users mailing list<br>
<a href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/">http://www.cluecon.com/</a><br>
<br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net">irc.freenode.net</a> #freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br><a href="http://iax:guest@conference.freeswitch.org/888">iax:guest@conference.freeswitch.org/888</a><br>
<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>pstn:213-799-1400
</div>