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 "some extra digits" is just that - a valid NANPA number with some extra digits. However, I wouldn't trust a handset that doesn'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"><<a href="mailto:krice@freeswitch.org" target="_blank">krice@freeswitch.org</a>></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's happening they<br>
need to update their handset... Its not 1985 any more<br>
<br>
<br>
On 1/9/13 3:44 PM, "Sergey Okhapkin" <<a href="mailto:sos@sokhapkin.dyndns.org">sos@sokhapkin.dyndns.org</a>> wrote:<br>
<br>
> It's better to remove trailing "$", there could be more digits on handset's<br>
> redial after entering DTMF codes on previous call.<br>
><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(14104207777 <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/14104207777 <tel:14104207777> )<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>
<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>