<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">&lt;<a href="mailto:bdfoster@endigotech.com" target="_blank">bdfoster@endigotech.com</a>&gt;</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&#39;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 &lt;<a href="mailto:steveayre@gmail.com">steveayre@gmail.com</a>&gt; wrote:<br>
<br>
&gt; They&#39;re dialing 10 digits including the 1.<br>
&gt;<br>
&gt; &#39;1&#39; plus 10 digits can&#39;t match, it&#39;s not long enough,<br>
&gt;<br>
&gt; So the regex instead ignores the optional &#39;1&#39; and tries to match just<br>
&gt; \d{10}, which does match since that allows the first digit to be a 1.<br>
&gt;<br>
&gt; If you want to handle &#39;1&#39; plus 9 digits differently, then your regex<br>
&gt; will need tweaking.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On 9 January 2013 19:48, Sean Devoy &lt;<a href="mailto:sdevoy@bizfocused.com">sdevoy@bizfocused.com</a>&gt; wrote:<br>
&gt;&gt; HI,<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; I really hope this question is not as dumb as some of my recent questions<br>
&gt;&gt; (Anybody else wiped out you O/S lately?)!<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Anyway,  I have an xml dial plan:<br>
&gt;&gt;<br>
&gt;&gt;  &lt;extension name=&quot;ten_or eleven_digiti_dial&quot; &gt;<br>
&gt;&gt;<br>
&gt;&gt;    &lt;condition field=&quot;destination_number&quot; expression=&quot;^1?(\d{10})$&quot;&gt;<br>
&gt;&gt;<br>
&gt;&gt;      &lt;action application=&quot;set&quot; data=&quot;ringback=${us-ring}&quot;/&gt;<br>
&gt;&gt;<br>
&gt;&gt;      &lt;action application=&quot;set&quot;<br>
&gt;&gt; data=&quot;effective_caller_id_number=${outbound_caller_id_number}&quot;/&gt;<br>
&gt;&gt;<br>
&gt;&gt;      &lt;action application=&quot;set&quot; data=&quot;ani=${outbound_caller_id_number}&quot;/&gt;<br>
&gt;&gt;<br>
&gt;&gt;      &lt;action application=&quot;set&quot;<br>
&gt;&gt; data=&quot;effective_caller_id_name=${outbound_caller_id_name}&quot;/&gt;<br>
&gt;&gt;<br>
&gt;&gt;      &lt;action application=&quot;set&quot; data=&quot;hangup_after_bridge=true&quot;/&gt;<br>
&gt;&gt;<br>
&gt;&gt;      &lt;action application=&quot;bridge&quot;<br>
&gt;&gt; data=&quot;sofia/gateway/vitelity-inbound/1$1&quot;/&gt;<br>
&gt;&gt;<br>
&gt;&gt;    &lt;/condition&gt;<br>
&gt;&gt;<br>
&gt;&gt;  &lt;/extension&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; I thought that would accept either 10 or 11 digit numbers starting with 1<br>
&gt;&gt; and bridge to the gateway always using 1 plus the 10 digits.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; In fact in my log I can see:<br>
&gt;&gt;<br>
&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; eleven_digiti_dial] destination_number<a href="tel:(14104207777" value="+14104207777">(14104207777</a>) =~ /^1?(\d{10})$/<br>
&gt;&gt; break=on-false<br>
&gt;&gt;<br>
&gt;&gt; Dialplan: sofia/external/<a href="mailto:220@fs_bfis.bizfocused.com">220@fs_bfis.bizfocused.com</a> Action<br>
&gt;&gt; set(ringback=${us-ring})<br>
&gt;&gt;<br>
&gt;&gt; Dialplan: sofia/external/<a href="mailto:220@fs_bfis.bizfocused.com">220@fs_bfis.bizfocused.com</a> Action<br>
&gt;&gt; set(effective_caller_id_number=${outbound_caller_id_number})<br>
&gt;&gt;<br>
&gt;&gt; Dialplan: sofia/external/<a href="mailto:220@fs_bfis.bizfocused.com">220@fs_bfis.bizfocused.com</a> Action<br>
&gt;&gt; set(ani=${outbound_caller_id_number})<br>
&gt;&gt;<br>
&gt;&gt; Dialplan: sofia/external/<a href="mailto:220@fs_bfis.bizfocused.com">220@fs_bfis.bizfocused.com</a> Action<br>
&gt;&gt; set(effective_caller_id_name=${outbound_caller_id_name})<br>
&gt;&gt;<br>
&gt;&gt; Dialplan: sofia/external/<a href="mailto:220@fs_bfis.bizfocused.com">220@fs_bfis.bizfocused.com</a> Action<br>
&gt;&gt; set(hangup_after_bridge=true)<br>
&gt;&gt;<br>
&gt;&gt; Dialplan: sofia/external/<a href="mailto:220@fs_bfis.bizfocused.com">220@fs_bfis.bizfocused.com</a> Action<br>
&gt;&gt; bridge(sofia/gateway/vitelity-inbound/<a href="tel:14104207777" value="+14104207777">14104207777</a>)<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; BUT<br>
&gt;&gt;<br>
&gt;&gt; It does not work for my customer :<br>
&gt;&gt;<br>
&gt;&gt; Dialplan: sofia/external/<a href="mailto:101@fs_alst.bizfocused.com">101@fs_alst.bizfocused.com</a> Regex (PASS)<br>
&gt;&gt; [ten_or_eleven_digiti_dial] destination_number(1800336940) =~ /^1?(\d{10})$/<br>
&gt;&gt; break=on-false<br>
&gt;&gt;<br>
&gt;&gt; Dialplan: sofia/external/<a href="mailto:101@fs_alst.bizfocused.com">101@fs_alst.bizfocused.com</a> Action<br>
&gt;&gt; set(ringback=${us-ring})<br>
&gt;&gt;<br>
&gt;&gt; Dialplan: sofia/external/<a href="mailto:101@fs_alst.bizfocused.com">101@fs_alst.bizfocused.com</a> Action<br>
&gt;&gt; set(effective_caller_id_number=${outbound_caller_id_number})<br>
&gt;&gt;<br>
&gt;&gt; Dialplan: sofia/external/<a href="mailto:101@fs_alst.bizfocused.com">101@fs_alst.bizfocused.com</a> Action<br>
&gt;&gt; set(ani=${outbound_caller_id_number})<br>
&gt;&gt;<br>
&gt;&gt; Dialplan: sofia/external/<a href="mailto:101@fs_alst.bizfocused.com">101@fs_alst.bizfocused.com</a> Action<br>
&gt;&gt; set(effective_caller_id_name=${outbound_caller_id_name})<br>
&gt;&gt;<br>
&gt;&gt; Dialplan: sofia/external/<a href="mailto:220@fs_bfis.bizfocused.com">220@fs_bfis.bizfocused.com</a> Action<br>
&gt;&gt; set(hangup_after_bridge=true)<br>
&gt;&gt;<br>
&gt;&gt; Dialplan: sofia/external/<a href="mailto:101@fs_alst.bizfocused.com">101@fs_alst.bizfocused.com</a> Action<br>
&gt;&gt; bridge(sofia/gateway/vitelity-inbound/11800336940)  NOTE THE EXTRA LEADING 1<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; So, what am I missing?<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Thanks,<br>
&gt;&gt;<br>
&gt;&gt; Sean<br>
&gt;&gt;<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>
&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>
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>