<div dir="ltr">"<span style="font-size:12.8px">local: </span><span style="font-size:12.8px">333 4444" is the one that's going to cause you problems really. It's easy enough to spot a prefix, but hard to spot no prefix (eg 3334444 a local number or an international call to France?)</span><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">You could spot the international and national dialing prefixes, and treat anything else as local perhaps?<br></span><div><div><span style="font-size:12.8px"><br></span></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 3 July 2017 at 12:44, Vallimamod Abdullah <span dir="ltr"><<a href="mailto:vma@vallimamod.org" target="_blank">vma@vallimamod.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
IMHO, instead of trying to find a single complicated regex working in all cases, a more readable way is to use condition regex="any" to stack all your possible matching regexes and let freeswitch try them one by one:<br>
<br>
<condition regex="any"><br>
  <regex field="destination_number" expression="^(\+6422\d{7})$"/><br>
  <regex field="destination_number" expression="^(022\d{7})$"/><br>
  <regex field="destination_number" expression="^(\d{7})$"/><br>
  <action ...><br>
</condition><br>
<br>
Hope this helps.<br>
<br>
Best Regards,<br>
<span class="HOEnZb"><font color="#888888">--<br>
Vallimamod Abdullah<br>
SIP Solutions<br>
<a href="mailto:vma@sipsolutions.fr">vma@sipsolutions.fr</a><br>
.<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
> On 3 Jul 2017, at 05:24, Nate <<a href="mailto:nathan.port@gmail.com">nathan.port@gmail.com</a>> wrote:<br>
><br>
> Hi Roy, many thanks for responding.<br>
><br>
> I am simply trying to finishing configuring the server to make/receive calls from the PSTN.<br>
><br>
> My reference to the regex is from trying to configure an outbound route.<br>
><br>
> Can anyone offer any advice on a regex that will work for me to reach any of the following phone numbers:<br>
><br>
> International: <a href="tel:%2B64%2022%20333%204444" value="+64223334444">+64 22 333 4444</a><br>
> non-local: 022 333 4444<br>
> local: 333 4444<br>
><br>
> From the number assigned to my account? +64 9 xxx yyyy<br>
><br>
> Many many thanks!<br>
><br>
> Nate.<br>
><br>
> On Sat, Jul 1, 2017 at 9:17 AM, <<a href="mailto:royj@yandex.ru">royj@yandex.ru</a>> wrote:<br>
> Not quite clear. What are you trying to achieve?<br>
><br>
> 30.06.2017, 11:11, "Nate" <<a href="mailto:nathan.port@gmail.com">nathan.port@gmail.com</a>>:<br>
>> Good day/evening everyone,<br>
>><br>
>> Apologies for not being able to figure this out on my own. I've been searching and trying for several days to get inbound/outbound working but have yet to see success.<br>
>><br>
>> At this stage I need help determining a proper regex expression for handling New Zealand phone numbers.<br>
>><br>
>> For instance, there are three different ways of expressing numbers here in NZ:<br>
>><br>
>> International: <a href="tel:%2B64%2022%20333%204444" value="+64223334444">+64 22 333 4444</a><br>
>> non-local: 022 333 4444<br>
>> local: 333 4444<br>
>><br>
>> A couple questions related to the SIP proxy:<br>
>><br>
>> If the SIP proxy is located in Hong Kong, but the phone number is a New Zealand number, does the location of the proxy have any impact on the number of characters in the string for inbound/outbound calls?<br>
>><br>
>> Again, apologies for the rudimentary nature of these questions, but having nearly exhausted all other options (docs, searches, IRC), I am now spending a large amount of time guessing and trial and error without any progress.<br>
>><br>
>> Many thanks for any feedback at all.<br>
>><br>
>> Nate<br>
>> ,<br>
>> ______________________________<wbr>______________________________<wbr>_____________<br>
>> Professional FreeSWITCH Consulting Services:<br>
>> <a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
>> <a href="http://www.freeswitchsolutions.com" rel="noreferrer" target="_blank">http://www.<wbr>freeswitchsolutions.com</a><br>
>><br>
>> Official FreeSWITCH Sites<br>
>> <a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
>> <a href="http://confluence.freeswitch.org" rel="noreferrer" target="_blank">http://confluence.freeswitch.<wbr>org</a><br>
>> <a href="http://www.cluecon.com" rel="noreferrer" 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.<wbr>freeswitch.org</a><br>
>> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/<wbr>mailman/listinfo/freeswitch-<wbr>users</a><br>
>> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.<wbr>freeswitch.org/mailman/<wbr>options/freeswitch-users</a><br>
>> <a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
>><br>
><br>
> ______________________________<wbr>______________________________<wbr>_____________<br>
> Professional FreeSWITCH Consulting Services:<br>
> <a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
> <a href="http://www.freeswitchsolutions.com" rel="noreferrer" target="_blank">http://www.<wbr>freeswitchsolutions.com</a><br>
><br>
> Official FreeSWITCH Sites<br>
> <a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
> <a href="http://confluence.freeswitch.org" rel="noreferrer" target="_blank">http://confluence.freeswitch.<wbr>org</a><br>
> <a href="http://www.cluecon.com" rel="noreferrer" 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.<wbr>freeswitch.org</a><br>
> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/<wbr>mailman/listinfo/freeswitch-<wbr>users</a><br>
> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.<wbr>freeswitch.org/mailman/<wbr>options/freeswitch-users</a><br>
> <a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
><br>
> ______________________________<wbr>______________________________<wbr>_____________<br>
> Professional FreeSWITCH Consulting Services:<br>
> <a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
> <a href="http://www.freeswitchsolutions.com" rel="noreferrer" target="_blank">http://www.<wbr>freeswitchsolutions.com</a><br>
><br>
> Official FreeSWITCH Sites<br>
> <a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
> <a href="http://confluence.freeswitch.org" rel="noreferrer" target="_blank">http://confluence.freeswitch.<wbr>org</a><br>
> <a href="http://www.cluecon.com" rel="noreferrer" 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.<wbr>freeswitch.org</a><br>
> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/<wbr>mailman/listinfo/freeswitch-<wbr>users</a><br>
> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.<wbr>freeswitch.org/mailman/<wbr>options/freeswitch-users</a><br>
> <a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
<br>
<br>
______________________________<wbr>______________________________<wbr>_____________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" rel="noreferrer" target="_blank">http://www.<wbr>freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" rel="noreferrer" target="_blank">http://confluence.freeswitch.<wbr>org</a><br>
<a href="http://www.cluecon.com" rel="noreferrer" 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.<wbr>freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/<wbr>mailman/listinfo/freeswitch-<wbr>users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.<wbr>freeswitch.org/mailman/<wbr>options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a></div></div></blockquote></div><br></div>