### Lync Dial Plan and Phone Words

So this is something new that I came across the other day, it has been around for a while but it actually affected a client, so had to figure out a way around it.
Phone Words, according to ACMA are:

Phonewords are made up from the letters of the alphabet that appear on a telephone keypad. These letters can be used to form a word, or a part word/part number combination, which can then be dialled as a telephone number to access a particular service. One example is '1300 FLIGHT'. Every phoneword has a primary underlying phone number, or in some cases more than one number, used by the telecommunications network as an 'address' for delivering the call.
The types of numbers that are most commonly used for phonewords include those beginning with the prefixes '1300', and '1800', which are 10 digits in length, and numbers beginning with '13', which are generally six digits in length.
When you think about it its actually pretty easy to solve, but first i had to get my head around what it all meant.

My original dialplan normalisation rule for 1300 or 1800 numbers was a simple
^(1[38]00\d{6})\$ --> +\$1
But as soon as a phone word was over the 10 total digits in length the call would fail. As a side note the number that was found to be the issue was the RSPCA number 1300 CRUELTY (1300 278 358).

So 1st plan was to remove the \$ in the normalisation rule, and change it to
^(1[38]00\d{5}\d+) --> +\$1
This worked, until the call hit the gateway and was sent out with too many digits was rejected by the carrier.

So next plan was to only send the 10 digits to the gateway, this resulted in
^(1[38]00\d{6})\d* --> +\$1

This only send the first 10 digits of the normalised number to the gateway and allows for the call to proceed to the carrier.

As with all pattern matching there is always more than one way to do this, so if you have a better way, please leave a comment.

Link to ACMA phone works fact sheet:
http://www.acma.gov.au/WEB/STANDARD/pc=PC_1682