Or you could both win by modifying the regex a bit:<br>^(?:+1|1)?([2-9]\d{2}[2-9]\d{6})\d*$<br><br>That assumes a valid NANPA number with &quot;some extra digits&quot; is just that - a valid NANPA number with some extra digits. However, I wouldn&#39;t trust a handset that doesn&#39;t know the difference between digits in the phone number and digits sent after far end answered.<br>
<br>-MC<br><br><div class="gmail_quote">On Wed, Jan 9, 2013 at 2:00 PM, Ken Rice <span dir="ltr">&lt;<a href="mailto:krice@freeswitch.org" target="_blank">krice@freeswitch.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
We can agree to disagree on that... I would argue if that&#39;s happening they<br>
need to update their handset... Its not 1985 any more<br>
<br>
<br>
On 1/9/13 3:44 PM, &quot;Sergey Okhapkin&quot; &lt;<a href="mailto:sos@sokhapkin.dyndns.org">sos@sokhapkin.dyndns.org</a>&gt; wrote:<br>
<br>
&gt; It&#39;s better to remove trailing &quot;$&quot;, there could be more digits on handset&#39;s<br>
&gt; redial after entering DTMF codes on previous call.<br>
&gt;<br>
&gt; On Wednesday 09 January 2013 15:33:57 Ken Rice wrote:<br>
&gt;&gt; If you are trying to filter NANPA numbers why not use a tighter REGEX like<br>
&gt;&gt; ^(?:+1|1)?([2-9]\d{2}[2-9]\d{6})$<br>
&gt;&gt;<br>
&gt;&gt; This would leave the base 10 digit number in $1<br>
&gt;&gt;<br>
&gt;&gt; On 1/9/13 2:00 PM, &quot;DJB International&quot; &lt;<a href="mailto:djbinter@gmail.com">djbinter@gmail.com</a>&gt; wrote:<br>
&gt;&gt;&gt; 1800336940 is 10-digits; therefore, it will match (\d{10}), which will be<br>
&gt;&gt;&gt; $1.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; $1 = 1800336940<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Then, in your bridge you add 1 in front, so it is correct.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; What behaviors are you looking for in this case?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; -djbinter<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On Wed, Jan 9, 2013 at 11:48 AM, Sean Devoy &lt;<a href="mailto:sdevoy@bizfocused.com">sdevoy@bizfocused.com</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt; HI,<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; I really hope this question is not as dumb as some of my recent questions<br>
&gt;&gt;&gt;&gt; (Anybody else wiped out you O/S lately?)!<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Anyway,  I have an xml dial plan:<br>
&gt;&gt;&gt;&gt;   &lt;extension name=&quot;ten_or eleven_digiti_dial&quot; &gt;<br>
&gt;&gt;&gt;&gt;     &lt;condition field=&quot;destination_number&quot; expression=&quot;^1?(\d{10})$&quot;&gt;<br>
&gt;&gt;&gt;&gt;       &lt;action application=&quot;set&quot; data=&quot;ringback=${us-ring}&quot;/&gt;<br>
&gt;&gt;&gt;&gt;       &lt;action application=&quot;set&quot;<br>
&gt;&gt;&gt;&gt; data=&quot;effective_caller_id_number=${outbound_caller_id_number}&quot;/&gt;<br>
&gt;&gt;&gt;&gt;       &lt;action application=&quot;set&quot; data=&quot;ani=${outbound_caller_id_number}&quot;/&gt;<br>
&gt;&gt;&gt;&gt;       &lt;action application=&quot;set&quot;<br>
&gt;&gt;&gt;&gt; data=&quot;effective_caller_id_name=${outbound_caller_id_name}&quot;/&gt;<br>
&gt;&gt;&gt;&gt;       &lt;action application=&quot;set&quot; data=&quot;hangup_after_bridge=true&quot;/&gt;<br>
&gt;&gt;&gt;&gt;       &lt;action application=&quot;bridge&quot;<br>
&gt;&gt;&gt;&gt; data=&quot;sofia/gateway/vitelity-inbound/1$1&quot;/&gt;<br>
&gt;&gt;&gt;&gt;     &lt;/condition&gt;<br>
&gt;&gt;&gt;&gt;   &lt;/extension&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; I thought that would accept either 10 or 11 digit numbers starting with 1<br>
&gt;&gt;&gt;&gt; and bridge to the gateway always using 1 plus the 10 digits.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; In fact in my log I can see:<br>
&gt;&gt;&gt;&gt; Dialplan: sofia/external/<a href="mailto:220@fs_bfis.bizfocused.com">220@fs_bfis.bizfocused.com</a> Regex (PASS) [ten_or<br>
&gt;&gt;&gt;&gt; eleven_digiti_dial] destination_number(14104207777 &lt;tel:%2814104207777&gt; )<br>
&gt;&gt;&gt;&gt; =~ /^1?(\d{10})$/ break=on-false<br>
&gt;&gt;&gt;&gt; Dialplan: sofia/external/<a href="mailto:220@fs_bfis.bizfocused.com">220@fs_bfis.bizfocused.com</a> Action<br>
&gt;&gt;&gt;&gt; set(ringback=${us-ring})<br>
&gt;&gt;&gt;&gt; Dialplan: sofia/external/<a href="mailto:220@fs_bfis.bizfocused.com">220@fs_bfis.bizfocused.com</a> Action<br>
&gt;&gt;&gt;&gt; set(effective_caller_id_number=${outbound_caller_id_number})<br>
&gt;&gt;&gt;&gt; Dialplan: sofia/external/<a href="mailto:220@fs_bfis.bizfocused.com">220@fs_bfis.bizfocused.com</a> Action<br>
&gt;&gt;&gt;&gt; set(ani=${outbound_caller_id_number})<br>
&gt;&gt;&gt;&gt; Dialplan: sofia/external/<a href="mailto:220@fs_bfis.bizfocused.com">220@fs_bfis.bizfocused.com</a> Action<br>
&gt;&gt;&gt;&gt; set(effective_caller_id_name=${outbound_caller_id_name})<br>
&gt;&gt;&gt;&gt; Dialplan: sofia/external/<a href="mailto:220@fs_bfis.bizfocused.com">220@fs_bfis.bizfocused.com</a> Action<br>
&gt;&gt;&gt;&gt; set(hangup_after_bridge=true)<br>
&gt;&gt;&gt;&gt; Dialplan: sofia/external/<a href="mailto:220@fs_bfis.bizfocused.com">220@fs_bfis.bizfocused.com</a> Action<br>
&gt;&gt;&gt;&gt; bridge(sofia/gateway/vitelity-inbound/14104207777 &lt;tel:14104207777&gt; )<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; BUT<br>
&gt;&gt;&gt;&gt; It does not work for my customer :<br>
&gt;&gt;&gt;&gt; Dialplan: sofia/external/<a href="mailto:101@fs_alst.bizfocused.com">101@fs_alst.bizfocused.com</a> Regex (PASS)<br>
&gt;&gt;&gt;&gt; [ten_or_eleven_digiti_dial] destination_number(1800336940) =~<br>
&gt;&gt;&gt;&gt; /^1?(\d{10})$/ break=on-false<br>
&gt;&gt;&gt;&gt; Dialplan: sofia/external/<a href="mailto:101@fs_alst.bizfocused.com">101@fs_alst.bizfocused.com</a> Action<br>
&gt;&gt;&gt;&gt; set(ringback=${us-ring})<br>
&gt;&gt;&gt;&gt; Dialplan: sofia/external/<a href="mailto:101@fs_alst.bizfocused.com">101@fs_alst.bizfocused.com</a> Action<br>
&gt;&gt;&gt;&gt; set(effective_caller_id_number=${outbound_caller_id_number})<br>
&gt;&gt;&gt;&gt; Dialplan: sofia/external/<a href="mailto:101@fs_alst.bizfocused.com">101@fs_alst.bizfocused.com</a> Action<br>
&gt;&gt;&gt;&gt; set(ani=${outbound_caller_id_number})<br>
&gt;&gt;&gt;&gt; Dialplan: sofia/external/<a href="mailto:101@fs_alst.bizfocused.com">101@fs_alst.bizfocused.com</a> Action<br>
&gt;&gt;&gt;&gt; set(effective_caller_id_name=${outbound_caller_id_name})<br>
&gt;&gt;&gt;&gt; Dialplan: sofia/external/<a href="mailto:220@fs_bfis.bizfocused.com">220@fs_bfis.bizfocused.com</a> Action<br>
&gt;&gt;&gt;&gt; set(hangup_after_bridge=true)<br>
&gt;&gt;&gt;&gt; Dialplan: sofia/external/<a href="mailto:101@fs_alst.bizfocused.com">101@fs_alst.bizfocused.com</a> Action<br>
&gt;&gt;&gt;&gt; bridge(sofia/gateway/vitelity-inbound/11800336940)  NOTE THE EXTRA<br>
&gt;&gt;&gt;&gt; LEADING 1<br>
&gt;&gt;&gt;&gt; So, what am I missing?<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Thanks,<br>
&gt;&gt;&gt;&gt; Sean<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; _________________________________________________________________________<br>
&gt;&gt;&gt;&gt; Professional FreeSWITCH Consulting Services:<br>
&gt;&gt;&gt;&gt; <a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
&gt;&gt;&gt;&gt; <a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
&gt;&gt;&gt;&gt; <a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Official FreeSWITCH Sites<br>
&gt;&gt;&gt;&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt;&gt;&gt;&gt; <a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
&gt;&gt;&gt;&gt; <a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; FreeSWITCH-users mailing list<br>
&gt;&gt;&gt;&gt; <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
&gt;&gt;&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;&gt;&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;&gt;&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; _________________________________________________________________________<br>
&gt;&gt;&gt; Professional FreeSWITCH Consulting Services:<br>
&gt;&gt;&gt; <a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
&gt;&gt;&gt; <a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
&gt;&gt;&gt; <a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Official FreeSWITCH Sites<br>
&gt;&gt;&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt;&gt;&gt; <a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
&gt;&gt;&gt; <a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; FreeSWITCH-users mailing list<br>
&gt;&gt;&gt; <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
&gt;&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;&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;&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt;<br>
&gt; _________________________________________________________________________<br>
&gt; Professional FreeSWITCH Consulting Services:<br>
&gt; <a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
&gt; <a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
&gt;<br>
&gt; FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
&gt; <a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
&gt;<br>
&gt; Official FreeSWITCH Sites<br>
&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt; <a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
&gt; <a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><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>
<br>
--<br>
Ken<br>
<a href="http://www.FreeSWITCH.org" target="_blank">http://www.FreeSWITCH.org</a><br>
<a href="http://www.ClueCon.com" target="_blank">http://www.ClueCon.com</a><br>
<a href="http://www.OSTAG.org" target="_blank">http://www.OSTAG.org</a><br>
<a href="http://irc.freenode.net" target="_blank">irc.freenode.net</a> #freeswitch<br>
<br>
<br>
<br>
_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><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>
</blockquote></div><br><br clear="all"><br>-- <br>Michael S Collins<br>Twitter: @mercutioviz<br><a href="http://www.FreeSWITCH.org" target="_blank">http://www.FreeSWITCH.org</a><br><a href="http://www.ClueCon.com" target="_blank">http://www.ClueCon.com</a><br>
<a href="http://www.OSTAG.org" target="_blank">http://www.OSTAG.org</a><br><br>