<div dir="ltr">if both field and expression are not present in the <condition> tag. It is instantly evaluated as true without performing the regex. 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><condition "${sip_referred_by_user}" expression="4473451"><br><br><br><div class="gmail_quote">On Thu, Jul 17, 2008 at 4:08 AM, Matt Darnell <<a href="mailto:mattdarnell@gmail.com">mattdarnell@gmail.com</a>> 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 <<a href="mailto:mattdarnell@gmail.com">mattdarnell@gmail.com</a>> wrote:<br>
>> I would like the dial plan to route based on the number in the<br>
>> Refered-By or Diversion field.<br>
><br>
> <extension name="Mailbox_4473451"><br>
> <condition "${sip_referred_by_user}" expression="4473451"><br>
> <action application="info"/><br>
> <action application="export" data="sip_h_Diversion=3451"/><br>
> <action application="bridge"<br>
> data="{absolute_codec_string=PCMA}sofia/gateway/<a href="http://gw.akamaitel.com/3451" target="_blank">gw.akamaitel.com/3451</a>"/><br>
> </condition><br>
> </extension><br>
><br>
> <extension name="Mailbox_4473452"><br>
> <condition "${sip_referred_by_user}" expression="4473452"><br>
> <action application="info"/><br>
> <action application="export" data="sip_h_Diversion=3452"/><br>
> <action application="bridge"<br>
> data="{absolute_codec_string=PCMA}sofia/gateway/<a href="http://gw.akamaitel.com/3452" target="_blank">gw.akamaitel.com/3452</a>"/><br>
> </condition><br>
> </extension><br>
><br>
> For some reason, all calls go to the first extension. When I look at<br>
> the out put from info, the sip_referred_by_user is 4473452 but it<br>
> still routes to the first extension.<br>
> variable_sip_referred_by_user: [4473452]<br>
><br>
> I have even changed the condition statement of the first extensin to :<br>
> <condition "${sip_referred_BOGUS_by_user}" expression="4473451"><br>
> and it still executes that extension.<br>
><br>
> Please let me know if you can see the issue.<br>
><br>
> -Matt<br>
><br>
<br>
</div></div>Another interesting thing is that if I have this:<br>
<extension name="Mailbox_4473451"><br>
<condition "${sip_referred_by_user}" expression="^\d{3}(\d{4})$"><br>
<action application="info"/><br>
<action application="export" data="sip_h_Diversion=$1"/><br>
<action application="bridge"<br>
data="{absolute_codec_string=PCMA}sofia/gateway/<a href="http://gw.akamaitel.com/$1" target="_blank">gw.akamaitel.com/$1</a>"/><br>
</condition><br>
</extension><br>
<br>
$1 does not get populated with \d{4}, the invite has $1 in the string.<br>
<br>
This however works fine:<br>
<condition field="destination_number" expression="^\d{3}(\d{4})$"><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>