[Freeswitch-users] Sane Dialplan Regex

Michael Collins msc at freeswitch.org
Tue Apr 5 19:56:13 MSD 2011


On Tue, Apr 5, 2011 at 8:26 AM, Max Clark <max.clark at gmail.com> wrote:

> Hello,
>
> I am trying to clean up the number of invalid calls being sent
> upstream to PSTN gateways. I've been researching numbering formats and
> could use some guidance/clarification.
>
> Currently I'm matching NADP calls looking by looking for a destination
> number matching 1 + 10 digits:
>
> <condition field="destination_number" expression="^(1\d{10})$">
>
> >From what I've found NPA should be 201-999 and NXX should be 200-999
> (ugly regex):
>
> <condition field="destination_number"
> expression="^(1[2-9][0-9]{2}[2-9]\d{2}\d{4})$">
>

I don't believe that regex is correct. You might want to base your pattern
off the one listed here:
http://wiki.freeswitch.org/wiki/Regex#NANPA_.2B1NxxNxxXXXX_E.164_Dialstring

>
> Are there any cases where the NPA & NXX would not conform to this list?
>
Not unless NANPA decides to make some changes...
-MC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20110405/a2991d3f/attachment.html 


More information about the FreeSWITCH-users mailing list