Regular Expression for site number plan routing of internal numbers

Underlining issue:
We have some Internal Genesys numbers in the format +19507XXXXXX.
We have our enterprise internal numbers which are any 10 digit number that begins with 950, except the numbers that begin with 9507.
If a Genesys agent dials an enterprise internal number, it is sent to our private SIP trunk between Genesys and our enterprise.
Our employees do not dial a +1 in front of the numbers they are dialing.

Current Site number plan:
We have a site number plan that catches the 950 numbers dialed and sends them to our enterprise trunk, this works great.
The issue is it also catches the 9507XXXXXX numbers that are dialed and doesn't flag it as a local number since the local numbers have a +1 in front and the agents don't add the +1 in front when they dialed the number.
(^950|^+1950|^950)(\d{6})$
950$2

National number plan is the goal for 9507XXXXXX numbers.
If the 9507XXXXXX numbers hit the national number plan they work and are recognized as a local number, looks like the national plan somehow adds the +1 before searching the local database while the one we created does not, even if we include the +1 in the normalized number expression.

What I think I need
What I'm trying to do is create a single regular expression number plan that will include all the 950XXXXXX except the 9507XXXXXX numbers.

Here are the options I have tried:
(^950[^7]|^+1950|^950)(\d{6})$
9505$2

(^950[0-6,8,9]|^+1950|^950)(\d{6})$
9505$2
The public regular expression tester says either of these options should work.
But when I simulate a call it shows all 950 calls bypassing the new 950 number plan and hitting the national plan.

Alternate solution that works
I can make this work by adding 9 dial plans, one for each of the enterprise possibilities, such as one for each 9500XXXXXXXX through 9509XXXXXXXX
Like this:
(^9505|^+19505|^9505)(\d{6})$
9505$2
then make a separate number plan for each 9500, 9501, 9502, 9503,9504,9505,9506,9508,9509.

I'm looking for a better solution, maybe if Genesys would allow me to add DID numbers without the +1, this would not be an issue. Perhaps there is a different solution, that I'm overlooking.

Sorry this is so long.

Hello,

I am definitely not an expert in Regex - I don't use them often. But I just tried the following Number Plan rules which may work for you.

Using a negative condition on 7:
Match Expression: ^(sip[s]?:|tel:)?(\+1)?(950)([^7])(\d{6})$
Normalized Number Expression: $1$2$3$4$5

Using a positive condition on 0,1,2,3,4,5,6,8,9:
Match Expression: ^(sip[s]?:|tel:)?(\+1)?(950)([0,1,2,3,4,5,6,8,9])(\d{6})$
Normalized Number Expression: $1$2$3$4$5

This will match 950XXXXXXXX (950 and 7 digits) and +1950XXXXXXX (+1950 and 7 digits) - except 9507XXXXXX (9507 and 6 digits) and +19507XXXXXX (+19507 and 6 digits)

Regards,

Thanks that did it, this works perfectly!

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.