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