<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 "+" 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"><<a href="mailto:sos@sokhapkin.dyndns.org" target="_blank">sos@sokhapkin.dyndns.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It's better to remove trailing "$", there could be more digits on handset'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>
> If you are trying to filter NANPA numbers why not use a tighter REGEX like<br>
> ^(?:+1|1)?([2-9]\d{2}[2-9]\d{6})$<br>
><br>
> This would leave the base 10 digit number in $1<br>
><br>
> On 1/9/13 2:00 PM, "DJB International" <<a href="mailto:djbinter@gmail.com">djbinter@gmail.com</a>> wrote:<br>
> > 1800336940 is 10-digits; therefore, it will match (\d{10}), which will be<br>
> > $1.<br>
> ><br>
> > $1 = 1800336940<br>
> ><br>
> > Then, in your bridge you add 1 in front, so it is correct.<br>
> ><br>
> > What behaviors are you looking for in this case?<br>
> ><br>
> > -djbinter<br>
> ><br>
> > On Wed, Jan 9, 2013 at 11:48 AM, Sean Devoy <<a href="mailto:sdevoy@bizfocused.com">sdevoy@bizfocused.com</a>> wrote:<br>
> >> HI,<br>
> >><br>
> >> I really hope this question is not as dumb as some of my recent questions<br>
> >> (Anybody else wiped out you O/S lately?)!<br>
> >><br>
> >> Anyway, I have an xml dial plan:<br>
> >> <extension name="ten_or eleven_digiti_dial" ><br>
> >> <condition field="destination_number" expression="^1?(\d{10})$"><br>
> >> <action application="set" data="ringback=${us-ring}"/><br>
> >> <action application="set"<br>
> >> data="effective_caller_id_number=${outbound_caller_id_number}"/><br>
> >> <action application="set" data="ani=${outbound_caller_id_number}"/><br>
> >> <action application="set"<br>
> >> data="effective_caller_id_name=${outbound_caller_id_name}"/><br>
> >> <action application="set" data="hangup_after_bridge=true"/><br>
> >> <action application="bridge"<br>
> >> data="sofia/gateway/vitelity-inbound/1$1"/><br>
> >> </condition><br>
> >> </extension><br>
> >><br>
> >> I thought that would accept either 10 or 11 digit numbers starting with 1<br>
> >> and bridge to the gateway always using 1 plus the 10 digits.<br>
> >><br>
> >> In fact in my log I can see:<br>
> >> Dialplan: sofia/external/<a href="mailto:220@fs_bfis.bizfocused.com">220@fs_bfis.bizfocused.com</a> Regex (PASS) [ten_or<br>
> >> eleven_digiti_dial] destination_number<a href="tel:%2814104207777" value="+14104207777">(14104207777</a> <tel:%2814104207777> )<br>
> >> =~ /^1?(\d{10})$/ break=on-false<br>
> >> Dialplan: sofia/external/<a href="mailto:220@fs_bfis.bizfocused.com">220@fs_bfis.bizfocused.com</a> Action<br>
> >> set(ringback=${us-ring})<br>
> >> Dialplan: sofia/external/<a href="mailto:220@fs_bfis.bizfocused.com">220@fs_bfis.bizfocused.com</a> Action<br>
> >> set(effective_caller_id_number=${outbound_caller_id_number})<br>
> >> Dialplan: sofia/external/<a href="mailto:220@fs_bfis.bizfocused.com">220@fs_bfis.bizfocused.com</a> Action<br>
> >> set(ani=${outbound_caller_id_number})<br>
> >> Dialplan: sofia/external/<a href="mailto:220@fs_bfis.bizfocused.com">220@fs_bfis.bizfocused.com</a> Action<br>
> >> set(effective_caller_id_name=${outbound_caller_id_name})<br>
> >> Dialplan: sofia/external/<a href="mailto:220@fs_bfis.bizfocused.com">220@fs_bfis.bizfocused.com</a> Action<br>
> >> set(hangup_after_bridge=true)<br>
> >> Dialplan: sofia/external/<a href="mailto:220@fs_bfis.bizfocused.com">220@fs_bfis.bizfocused.com</a> Action<br>
> >> bridge(sofia/gateway/vitelity-inbound/<a href="tel:14104207777" value="+14104207777">14104207777</a> <tel:<a href="tel:14104207777" value="+14104207777">14104207777</a>> )<br>
> >><br>
> >> BUT<br>
> >> It does not work for my customer :<br>
> >> Dialplan: sofia/external/<a href="mailto:101@fs_alst.bizfocused.com">101@fs_alst.bizfocused.com</a> Regex (PASS)<br>
> >> [ten_or_eleven_digiti_dial] destination_number(1800336940) =~<br>
> >> /^1?(\d{10})$/ break=on-false<br>
> >> Dialplan: sofia/external/<a href="mailto:101@fs_alst.bizfocused.com">101@fs_alst.bizfocused.com</a> Action<br>
> >> set(ringback=${us-ring})<br>
> >> Dialplan: sofia/external/<a href="mailto:101@fs_alst.bizfocused.com">101@fs_alst.bizfocused.com</a> Action<br>
> >> set(effective_caller_id_number=${outbound_caller_id_number})<br>
> >> Dialplan: sofia/external/<a href="mailto:101@fs_alst.bizfocused.com">101@fs_alst.bizfocused.com</a> Action<br>
> >> set(ani=${outbound_caller_id_number})<br>
> >> Dialplan: sofia/external/<a href="mailto:101@fs_alst.bizfocused.com">101@fs_alst.bizfocused.com</a> Action<br>
> >> set(effective_caller_id_name=${outbound_caller_id_name})<br>
> >> Dialplan: sofia/external/<a href="mailto:220@fs_bfis.bizfocused.com">220@fs_bfis.bizfocused.com</a> Action<br>
> >> set(hangup_after_bridge=true)<br>
> >> Dialplan: sofia/external/<a href="mailto:101@fs_alst.bizfocused.com">101@fs_alst.bizfocused.com</a> Action<br>
> >> bridge(sofia/gateway/vitelity-inbound/11800336940) NOTE THE EXTRA<br>
> >> LEADING 1<br>
> >> So, what am I missing?<br>
> >><br>
> >> Thanks,<br>
> >> Sean<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>
> ><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>
<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>