<div dir="ltr"><div><div>Ken,<br><br></div>Is it correct that in the group but not capture (?: we will need an escape character \ to match the literal &quot;+&quot; character as well.  So, I think it should be:<br><font face="Monaco, Courier New"><span style="font-size:11pt">^(?:\+1|1)?([2-9]\d{2}[2-9]\d{6})$</span></font><br>
<br></div><div>-djbinter<br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jan 9, 2013 at 1:44 PM, Sergey Okhapkin <span dir="ltr">&lt;<a href="mailto:sos@sokhapkin.dyndns.org" target="_blank">sos@sokhapkin.dyndns.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It&#39;s better to remove trailing &quot;$&quot;, there could be more digits on handset&#39;s<br>
redial after entering DTMF codes on previous call.<br>
<div class="HOEnZb"><div class="h5"><br>
On Wednesday 09 January 2013 15:33:57 Ken Rice wrote:<br>
&gt; If you are trying to filter NANPA numbers why not use a tighter REGEX like<br>
&gt; ^(?:+1|1)?([2-9]\d{2}[2-9]\d{6})$<br>
&gt;<br>
&gt; This would leave the base 10 digit number in $1<br>
&gt;<br>
&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; 1800336940 is 10-digits; therefore, it will match (\d{10}), which will be<br>
&gt; &gt; $1.<br>
&gt; &gt;<br>
&gt; &gt; $1 = 1800336940<br>
&gt; &gt;<br>
&gt; &gt; Then, in your bridge you add 1 in front, so it is correct.<br>
&gt; &gt;<br>
&gt; &gt; What behaviors are you looking for in this case?<br>
&gt; &gt;<br>
&gt; &gt; -djbinter<br>
&gt; &gt;<br>
&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; HI,<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; I really hope this question is not as dumb as some of my recent questions<br>
&gt; &gt;&gt; (Anybody else wiped out you O/S lately?)!<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Anyway,  I have an xml dial plan:<br>
&gt; &gt;&gt;   &lt;extension name=&quot;ten_or eleven_digiti_dial&quot; &gt;<br>
&gt; &gt;&gt;     &lt;condition field=&quot;destination_number&quot; expression=&quot;^1?(\d{10})$&quot;&gt;<br>
&gt; &gt;&gt;       &lt;action application=&quot;set&quot; data=&quot;ringback=${us-ring}&quot;/&gt;<br>
&gt; &gt;&gt;       &lt;action application=&quot;set&quot;<br>
&gt; &gt;&gt; data=&quot;effective_caller_id_number=${outbound_caller_id_number}&quot;/&gt;<br>
&gt; &gt;&gt;       &lt;action application=&quot;set&quot; data=&quot;ani=${outbound_caller_id_number}&quot;/&gt;<br>
&gt; &gt;&gt;       &lt;action application=&quot;set&quot;<br>
&gt; &gt;&gt; data=&quot;effective_caller_id_name=${outbound_caller_id_name}&quot;/&gt;<br>
&gt; &gt;&gt;       &lt;action application=&quot;set&quot; data=&quot;hangup_after_bridge=true&quot;/&gt;<br>
&gt; &gt;&gt;       &lt;action application=&quot;bridge&quot;<br>
&gt; &gt;&gt; data=&quot;sofia/gateway/vitelity-inbound/1$1&quot;/&gt;<br>
&gt; &gt;&gt;     &lt;/condition&gt;<br>
&gt; &gt;&gt;   &lt;/extension&gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; I thought that would accept either 10 or 11 digit numbers starting with 1<br>
&gt; &gt;&gt; and bridge to the gateway always using 1 plus the 10 digits.<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; In fact in my log I can see:<br>
&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; eleven_digiti_dial] destination_number<a href="tel:%2814104207777" value="+14104207777">(14104207777</a> &lt;tel:%2814104207777&gt; )<br>
&gt; &gt;&gt; =~ /^1?(\d{10})$/ break=on-false<br>
&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; set(ringback=${us-ring})<br>
&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; set(effective_caller_id_number=${outbound_caller_id_number})<br>
&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; set(ani=${outbound_caller_id_number})<br>
&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; set(effective_caller_id_name=${outbound_caller_id_name})<br>
&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; set(hangup_after_bridge=true)<br>
&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; bridge(sofia/gateway/vitelity-inbound/<a href="tel:14104207777" value="+14104207777">14104207777</a> &lt;tel:<a href="tel:14104207777" value="+14104207777">14104207777</a>&gt; )<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; BUT<br>
&gt; &gt;&gt; It does not work for my customer :<br>
&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; [ten_or_eleven_digiti_dial] destination_number(1800336940) =~<br>
&gt; &gt;&gt; /^1?(\d{10})$/ break=on-false<br>
&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; set(ringback=${us-ring})<br>
&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; set(effective_caller_id_number=${outbound_caller_id_number})<br>
&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; set(ani=${outbound_caller_id_number})<br>
&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; set(effective_caller_id_name=${outbound_caller_id_name})<br>
&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; set(hangup_after_bridge=true)<br>
&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; bridge(sofia/gateway/vitelity-inbound/11800336940)  NOTE THE EXTRA<br>
&gt; &gt;&gt; LEADING 1<br>
&gt; &gt;&gt; So, what am I missing?<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Thanks,<br>
&gt; &gt;&gt; Sean<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; &gt;<br>
&gt; &gt; _________________________________________________________________________<br>
&gt; &gt; Professional FreeSWITCH Consulting Services:<br>
&gt; &gt; <a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
&gt; &gt; <a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
&gt; &gt;<br>
&gt; &gt; FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
&gt; &gt; <a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
&gt; &gt;<br>
&gt; &gt; Official FreeSWITCH Sites<br>
&gt; &gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt; &gt; <a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
&gt; &gt; <a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><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; &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; 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>
<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>
</div></div></blockquote></div><br></div>