<div dir="ltr">@Brian that unnecessarily complicates things, if you check my previous email you can easily do it in one extension.<div><br clear="all"><div><div dir="ltr"><span style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:small">-Avi Marcus</span><br>
BestFone</div></div>
<br><br><div class="gmail_quote">On Wed, Jan 9, 2013 at 10:53 PM, Brian Foster <span dir="ltr"><<a href="mailto:bdfoster@endigotech.com" target="_blank">bdfoster@endigotech.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
We have two different regex's/dialplans to handle this issue. One that matches 10 digits and one that matches 11. I think freeswitch example configs cover this.<br>
<br>
Sent from my iPhone<br>
<div class="HOEnZb"><div class="h5"><br>
On Jan 9, 2013, at 3:36 PM, Steven Ayre <<a href="mailto:steveayre@gmail.com">steveayre@gmail.com</a>> wrote:<br>
<br>
> They're dialing 10 digits including the 1.<br>
><br>
> '1' plus 10 digits can't match, it's not long enough,<br>
><br>
> So the regex instead ignores the optional '1' and tries to match just<br>
> \d{10}, which does match since that allows the first digit to be a 1.<br>
><br>
> If you want to handle '1' plus 9 digits differently, then your regex<br>
> will need tweaking.<br>
><br>
><br>
><br>
><br>
><br>
> On 9 January 2013 19:48, Sean Devoy <<a href="mailto:sdevoy@bizfocused.com">sdevoy@bizfocused.com</a>> wrote:<br>
>> HI,<br>
>><br>
>><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>
>><br>
>><br>
>> Anyway, I have an xml dial plan:<br>
>><br>
>> <extension name="ten_or eleven_digiti_dial" ><br>
>><br>
>> <condition field="destination_number" expression="^1?(\d{10})$"><br>
>><br>
>> <action application="set" data="ringback=${us-ring}"/><br>
>><br>
>> <action application="set"<br>
>> data="effective_caller_id_number=${outbound_caller_id_number}"/><br>
>><br>
>> <action application="set" data="ani=${outbound_caller_id_number}"/><br>
>><br>
>> <action application="set"<br>
>> data="effective_caller_id_name=${outbound_caller_id_name}"/><br>
>><br>
>> <action application="set" data="hangup_after_bridge=true"/><br>
>><br>
>> <action application="bridge"<br>
>> data="sofia/gateway/vitelity-inbound/1$1"/><br>
>><br>
>> </condition><br>
>><br>
>> </extension><br>
>><br>
>><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>
>><br>
>><br>
>> In fact in my log I can see:<br>
>><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:(14104207777" value="+14104207777">(14104207777</a>) =~ /^1?(\d{10})$/<br>
>> break=on-false<br>
>><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>
>><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>
>><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>
>><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>
>><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>
>><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>)<br>
>><br>
>><br>
>><br>
>> BUT<br>
>><br>
>> It does not work for my customer :<br>
>><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) =~ /^1?(\d{10})$/<br>
>> break=on-false<br>
>><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>
>><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>
>><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>
>><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>
>><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>
>><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 LEADING 1<br>
>><br>
>><br>
>><br>
>> So, what am I missing?<br>
>><br>
>><br>
>><br>
>> Thanks,<br>
>><br>
>> Sean<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>
><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></div>