Hello I want to follow up on this example from YEARS ago. I had tried using the variable &quot;destination_number&quot; but that didn&#39;t work, and I figured that it was because the To: header doesn&#39;t have the destination_number but has just the URI, so I thought I&#39;d use sip_to_user instead.<div>
<br></div><div>We have calls coming in with the following info in the INVITE</div><div><br></div><div>From: &quot;16469NNNNNN&quot; &lt;sip:16469NNNNNN;phone-context=+1@67.1x.xxx.xxx:5060;user=phone&gt;;tag=SDru6fc01-gK0c10a887.</div>
<div>To: &lt;sip:011390NNNNNNNNNN;phone-context=+39@xxx.xxx.xxx.xxx:5060;user=phone&gt;.</div><div>(N and x are obviously being masked for privacy)</div><div><br></div><div>I use this info in the dialplan like so</div><div>
<br></div><div><div>&lt;include&gt;</div><div>  &lt;extension name=&quot;DIDtest&quot;&gt;</div><div>    &lt;condition field=&quot;ani&quot; expression=&quot;^(\+?|\+1?|1?)(6469NNNNNN).*$&quot; break=&quot;never&quot;&gt;</div>
<div>        &lt;action application=&quot;set&quot; data=&quot;effective_caller_id_number=$2&quot;/&gt;</div><div>        &lt;action application=&quot;set&quot; data=&quot;effective_caller_id_name=$2&quot;/&gt;</div><div>
    &lt;/condition&gt;</div><div>    &lt;condition field=&quot;${sip_to_user}&quot; expression=&quot;^(\+?|\+1?|1?|011?)(390NNNNNNNNNN).$&quot; break=&quot;never&quot;&gt;</div><div>        &lt;action application=&quot;set&quot; data=&quot;continue_on_fail=false&quot;/&gt;</div>
<div>        &lt;action application=&quot;set&quot; data=&quot;hangup_after_bridge=true&quot;/&gt;</div><div>        &lt;action application=&quot;set&quot; data=&quot;domain_name=$${domain}&quot;/&gt;</div><div>        &lt;action application=&quot;set&quot; data=&quot;bypass_media=true&quot;/&gt;</div>
<div>        &lt;action application=&quot;bridge&quot; data=&quot;{sip_invite_domain=${sip_from_host}}sofia/gateway/blade2/$2&quot;/&gt;</div><div>    &lt;/condition&gt;</div><div>  &lt;/extension&gt;</div><div>&lt;/include&gt;</div>
<div><br></div></div><div>However, the calls aren&#39;t passing the condition in this dialplan and thus not being forwarded to &quot;blade2&quot; server. In fact, even the 011 is not being stripped off. </div><div><br></div>
<div>What am I doing wrong?</div><div><br></div><div>Thanks</div><div>\RR </div><div><br><br><div class="gmail_quote">On Thu, Nov 13, 2008 at 10:52 AM, Peter P GMX <span dir="ltr">&lt;<a href="mailto:Prometheus001@gmx.net">Prometheus001@gmx.net</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Thanks,<br>
<br>
this works<br>
<div class="im"><br>
Best regards<br>
Peter<br>
<br>
Anthony Minessale schrieb:<br>
</div><div class="im">&gt; here&#39;s another hint.<br>
&gt;<br>
&gt; use field=&quot;${sip_to_user}&quot;<br>
&gt;<br>
&gt;<br>
&gt; On Thu, Nov 13, 2008 at 3:43 AM, Peter P GMX &lt;<a href="mailto:Prometheus001@gmx.net">Prometheus001@gmx.net</a><br>
</div><div><div></div><div class="h5">&gt; &lt;mailto:<a href="mailto:Prometheus001@gmx.net">Prometheus001@gmx.net</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     I checked your hint. The variable sip_to_user has the right value<br>
&gt;     - but<br>
&gt;     it is evaluated as empty at the time it is parsed.<br>
&gt;<br>
&gt;     Info gives me:<br>
&gt;     .<br>
&gt;     .<br>
&gt;     variable_sip_to_user: [xxxxxxxxx8910]<br>
&gt;     variable_sip_to_uri: [xxxxxxxxx8910@my.ip.addre.ss]<br>
&gt;<br>
&gt;<br>
&gt;     Example1,:<br>
&gt;     I check with condition field=&quot;destination_number&quot;<br>
&gt;     Match Result<br>
&gt;     2008-11-13 10:24:55 [DEBUG] mod_dialplan_xml.c:117 parse_exten()<br>
&gt;     Regex:<br>
&gt;     [Inbound QSC trunk] destination_number(xxxxxxxxx89) =~<br>
&gt;     /^(xxxxxxxxx89)$/<br>
&gt;     This works but gives only the DID of the trunk (10 is missing at<br>
&gt;     the end).<br>
&gt;<br>
&gt;     Example2:<br>
&gt;     I check with condition field=&quot;sip_to_user&quot;<br>
&gt;     Match Result<br>
&gt;     2008-11-13 10:30:42 [DEBUG] mod_dialplan_xml.c:117 parse_exten()<br>
&gt;     Regex:<br>
&gt;     [Inbound QSC trunk] sip_to_user() =~ /^(xxxxxxxxx89[0-9.])$/<br>
&gt;     2008-11-13 10:30:42 [DEBUG] mod_dialplan_xml.c:119 parse_exten() Regex<br>
&gt;     mismatch<br>
&gt;     sip_to_user() is empty<br>
&gt;     Example3:<br>
&gt;     I check with condition field=&quot;variable_sip_to_user&quot;<br>
&gt;     Match Result<br>
&gt;     2008-11-13 10:39:53 [DEBUG] mod_dialplan_xml.c:117 parse_exten()<br>
&gt;     Regex:<br>
&gt;     [Inbound QSC trunk] variable_sip_to_user() =~ /^(xxxxxxxxx89[0-9.])$/<br>
&gt;     2008-11-13 10:39:53 [DEBUG] mod_dialplan_xml.c:119 parse_exten() Regex<br>
&gt;     mismatch<br>
&gt;     variable_sip_to_user() is empty<br>
&gt;<br>
&gt;     So at the time of evaluation &quot;sip_to_user&quot; resp.<br>
&gt;     &quot;variable_sip_to_user&quot;<br>
&gt;     is empty.<br>
&gt;<br>
&gt;     What can I do?<br>
&gt;<br>
&gt;     Best regards<br>
&gt;     Peter<br>
&gt;<br>
&gt;<br>
&gt;     Anthony Minessale schrieb:<br>
&gt;     &gt; route the call to the &quot;info&quot; app and look for the one that has it.<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt; On Wed, Nov 12, 2008 at 1:36 PM, Peter P GMX<br>
&gt;     &lt;<a href="mailto:Prometheus001@gmx.net">Prometheus001@gmx.net</a> &lt;mailto:<a href="mailto:Prometheus001@gmx.net">Prometheus001@gmx.net</a>&gt;<br>
</div></div>&gt;     &gt; &lt;mailto:<a href="mailto:Prometheus001@gmx.net">Prometheus001@gmx.net</a> &lt;mailto:<a href="mailto:Prometheus001@gmx.net">Prometheus001@gmx.net</a>&gt;&gt;&gt;<br>
<div><div></div><div class="h5">&gt;     wrote:<br>
&gt;     &gt;<br>
&gt;     &gt;     Dear all,<br>
&gt;     &gt;<br>
&gt;     &gt;     when I get an incoming call from my SIP provider I do receive an<br>
&gt;     &gt;     invite<br>
&gt;     &gt;     on the trunk number, e.g. in Germany 0xxxxx9. However I have an<br>
&gt;     &gt;     extension block of 0xxxxx90 to 0xxxxx999.<br>
&gt;     &gt;     In the dialplan I checked the condition<br>
&gt;     field=&quot;destination_number&quot; but<br>
&gt;     &gt;     this compares to the number of the trunk 0xxxxx9, so I do<br>
&gt;     not get the<br>
&gt;     &gt;     direct inward dialling extensions.<br>
&gt;     &gt;<br>
&gt;     &gt;     The SIP to-header contains the direct inward dialling number<br>
&gt;     &gt;     0xxxxx90 to<br>
&gt;     &gt;     0xxxxx999 but I have no success in accessing it in the dialplan.<br>
&gt;     &gt;<br>
&gt;     &gt;     I tried sip_to_user, sip_to_uri, sip_req_user, sip_req_uri,<br>
&gt;     but no<br>
&gt;     &gt;     success. They are all empty.<br>
&gt;     &gt;<br>
&gt;     &gt;     Any idea which variable to parse?<br>
&gt;     &gt;<br>
&gt;     &gt;     Best regards<br>
&gt;     &gt;     Peter<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt;     _______________________________________________<br>
&gt;     &gt;     Freeswitch-users mailing list<br>
&gt;     &gt;     <a href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a><br>
&gt;     &lt;mailto:<a href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a>&gt;<br>
&gt;     &gt;     &lt;mailto:<a href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a><br>
&gt;     &lt;mailto:<a href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a>&gt;&gt;<br>
&gt;     &gt;     <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
&gt;     &gt;<br>
&gt;     UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
&gt;     &gt;     <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt; --<br>
&gt;     &gt; Anthony Minessale II<br>
&gt;     &gt;<br>
&gt;     &gt; FreeSWITCH <a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org/</a><br>
&gt;     &gt; ClueCon <a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com/</a><br>
&gt;     &gt;<br>
&gt;     &gt; AIM: anthm<br>
&gt;     &gt; <a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>
&gt;     &lt;mailto:<a href="mailto:MSN%253Aanthony_minessale@hotmail.com">MSN%3Aanthony_minessale@hotmail.com</a>&gt;<br>
&gt;     &gt; &lt;mailto:<a href="mailto:MSN%253Aanthony_minessale@hotmail.com">MSN%3Aanthony_minessale@hotmail.com</a><br>
</div></div>&gt;     &lt;mailto:<a href="mailto:MSN%25253Aanthony_minessale@hotmail.com">MSN%253Aanthony_minessale@hotmail.com</a>&gt;&gt;<br>
<div class="im">&gt;     &gt; GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
&gt;     &lt;mailto:<a href="mailto:PAYPAL%253Aanthony.minessale@gmail.com">PAYPAL%3Aanthony.minessale@gmail.com</a>&gt;<br>
&gt;     &gt; &lt;mailto:<a href="mailto:PAYPAL%253Aanthony.minessale@gmail.com">PAYPAL%3Aanthony.minessale@gmail.com</a><br>
</div>&gt;     &lt;mailto:<a href="mailto:PAYPAL%25253Aanthony.minessale@gmail.com">PAYPAL%253Aanthony.minessale@gmail.com</a>&gt;&gt;<br>
<div class="im">&gt;     &gt; IRC: <a href="http://irc.freenode.net" target="_blank">irc.freenode.net</a> &lt;<a href="http://irc.freenode.net" target="_blank">http://irc.freenode.net</a>&gt;<br>
&gt;     &lt;<a href="http://irc.freenode.net" target="_blank">http://irc.freenode.net</a>&gt; #freeswitch<br>
&gt;     &gt;<br>
&gt;     &gt; FreeSWITCH Developer Conference<br>
&gt;     &gt; <a href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br>
&gt;     &lt;mailto:<a href="mailto:sip%253A888@conference.freeswitch.org">sip%3A888@conference.freeswitch.org</a>&gt;<br>
&gt;     &gt; &lt;mailto:<a href="mailto:sip%253A888@conference.freeswitch.org">sip%3A888@conference.freeswitch.org</a><br>
</div>&gt;     &lt;mailto:<a href="mailto:sip%25253A888@conference.freeswitch.org">sip%253A888@conference.freeswitch.org</a>&gt;&gt;<br>
<div class="im">&gt;     &gt; <a href="http://iax:guest@conference.freeswitch.org/888" target="_blank">iax:guest@conference.freeswitch.org/888</a><br>
&gt;     &lt;<a href="http://iax:guest@conference.freeswitch.org/888" target="_blank">http://iax:guest@conference.freeswitch.org/888</a>&gt;<br>
&gt;     &gt; &lt;<a href="http://iax:guest@conference.freeswitch.org/888" target="_blank">http://iax:guest@conference.freeswitch.org/888</a>&gt;<br>
&gt;     &gt; <a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>
&gt;     &lt;mailto:<a href="mailto:googletalk%253Aconf%252B888@conference.freeswitch.org">googletalk%3Aconf%2B888@conference.freeswitch.org</a>&gt;<br>
&gt;     &gt; &lt;mailto:<a href="mailto:googletalk%253Aconf%252B888@conference.freeswitch.org">googletalk%3Aconf%2B888@conference.freeswitch.org</a><br>
</div>&gt;     &lt;mailto:<a href="mailto:googletalk%25253Aconf%25252B888@conference.freeswitch.org">googletalk%253Aconf%252B888@conference.freeswitch.org</a>&gt;&gt;<br>
<div class="im">&gt;     &gt; pstn:213-799-1400<br>
&gt;     &gt;<br>
&gt;     ------------------------------------------------------------------------<br>
&gt;     &gt;<br>
&gt;     &gt; _______________________________________________<br>
&gt;     &gt; Freeswitch-users mailing list<br>
&gt;     &gt; <a href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a><br>
</div><div><div></div><div class="h5">&gt;     &lt;mailto:<a href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a>&gt;<br>
&gt;     &gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
&gt;     &gt;<br>
&gt;     UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
&gt;     &gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt;     &gt;<br>
&gt;<br>
&gt;     _______________________________________________<br>
&gt;     Freeswitch-users mailing list<br>
&gt;     <a href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a><br>
&gt;     &lt;mailto:<a href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a>&gt;<br>
&gt;     <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
&gt;     UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
&gt;     <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Anthony Minessale II<br>
&gt;<br>
&gt; FreeSWITCH <a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org/</a><br>
&gt; ClueCon <a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com/</a><br>
&gt;<br>
&gt; AIM: anthm<br>
&gt; <a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>
&gt; &lt;mailto:<a href="mailto:MSN%253Aanthony_minessale@hotmail.com">MSN%3Aanthony_minessale@hotmail.com</a>&gt;<br>
&gt; GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
&gt; &lt;mailto:<a href="mailto:PAYPAL%253Aanthony.minessale@gmail.com">PAYPAL%3Aanthony.minessale@gmail.com</a>&gt;<br>
&gt; IRC: <a href="http://irc.freenode.net" target="_blank">irc.freenode.net</a> &lt;<a href="http://irc.freenode.net" target="_blank">http://irc.freenode.net</a>&gt; #freeswitch<br>
&gt;<br>
&gt; FreeSWITCH Developer Conference<br>
&gt; <a href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br>
&gt; &lt;mailto:<a href="mailto:sip%253A888@conference.freeswitch.org">sip%3A888@conference.freeswitch.org</a>&gt;<br>
&gt; <a href="http://iax:guest@conference.freeswitch.org/888" target="_blank">iax:guest@conference.freeswitch.org/888</a><br>
&gt; &lt;<a href="http://iax:guest@conference.freeswitch.org/888" target="_blank">http://iax:guest@conference.freeswitch.org/888</a>&gt;<br>
&gt; <a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>
&gt; &lt;mailto:<a href="mailto:googletalk%253Aconf%252B888@conference.freeswitch.org">googletalk%3Aconf%2B888@conference.freeswitch.org</a>&gt;<br>
&gt; pstn:213-799-1400<br>
&gt; ------------------------------------------------------------------------<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Freeswitch-users mailing list<br>
&gt; <a href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a><br>
&gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
&gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt;<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></div>