Tuesday, June 7, 2011

Dialing Rule Optimizer Goes International

Since the Dialing Rule Optimizer was extended to create a total end-to-end Powershell script for North American users, it was relatively trivial to add similar functionality for other countries.

Now, the Dialing Rule Optimizer can provide a Powershell script that will create all the rules necessary for an Enterprise Voice deployment for users in Australia, Germany, Netherlands, Norway, Sweden and the United Kingdom with more on the way.  I've even attempted to convert English to German (thanks to Google Translate...so any blame on translation accuracy can be pushed that way). 

Having never dialed a phone in the UK or Germany, I've had to make some assumptions:
  • any local phone number dialed from within a given area code does not have to include the area code
  • phone numbers outside the local area code must start with 0, followed by the area code, then the local number
  • international numbers must be preceded by 00 then the country code/area code/local number
Because of those assumptions, I didn't have to perform any of the complex calculations necessary for North American numbers.  Since the dialing rules aren't expected to change over time, you can't enter an email address for non-North American rule updates.  Also, since this is designed as a Lync-only feature, you can't (nor should you need to) create rulesets for the Dialogic or Audiocodes gateways.

Please let me know if my assumptions are incorrect, or if you can offer corrections to my German translations. 

If the demand is there, I will create dialing rules for other countries as long as someone can help me understand the local dialing rules and can help with language translation.  Things I would need to know:

  • Local number format
  • National number format
  • International number format
  • Service number format
  • Premium-rate number format

For anyone interested in helping with language translation, here is a list of words/phrases I would need translating:

"Internal"
"Local"
"National"
"International"
"Service"
"Invalid site ID"
" number normalization for "
" routing for "
"Normalization rules for "
"Enter the Site ID to apply the dialing rules for "
"Multiple application pools found. Please select the application pool to apply call block/park"
"No default PSTN gateway found. You must define a PSTN gateway in your topology and assign it to this site before running this script."
"Removes"
"Adds"
"and"
"for"
"country/area code"
"country code"
"calls from"
"The number you have dialed is prohibited due to corporate policy. If you need to reach this number, please notify your manager."

16 comments:

  1. Thanks Ken, I've looked forward to seeing dialing rules for other countries.

    Would it be possible for you to add Sweden to the list?

    It's the same rules as you used for UK.
    - any local phone number dialed from within a given area code does not have to include the area code
    - phone numbers outside the local area code must start with 0, followed by the area code, then the local number
    - international numbers must be preceded by 00 then the country code/area code/local number

    The minimum number length (excluding the country code) is 7 digits
    The maximum number length (excluding the country code) is 13 digits

    An area code starts with 0 followed by one, two or three numbers ie 08-xxxxxxxx, 021-xxxxxxx or 0220-xxxxx.
    Local numbers can be 5-8 digits.

    Here is some english info about the Swedish dialplans. http://www.pts.se/upload/Ovrigt/Tele/Nummerfragor/Sv_nrplan_telefoni_enl_TU-T_rek_E.164.pdf

    Any additional info I can provide you with? :)

    ReplyDelete
  2. Thanks for the details Markus. That's exactly the sort of info I need.

    Additional info I still need:
    Emergency/service number format
    Language translation (see addition to post)
    Somewhere I can find a list of valid area codes and the city/area they're associated with (preferably in table format so I can easily translate to CSV)

    Thanks!
    Ken

    ReplyDelete
  3. "Lokalt"
    "Nationellt"
    "Internationellt"
    "Tjänsten"
    " nummernormalisering för "
    " dirigering för "
    "Normaliseringsregler för "
    "Ange platsens ID att tillämpa dirigerinsregler för minsta kostnad"
    "Ingen standard PSTN-gateway hittades. Det rekommenderas starkt att man definierar en PSTN gateway i topologin och kopplar den till denna plats innan du kör det här programmet. Ändringarna kan fortsätta, men du måste då manuellt tilldela de linjer och dirigeringsregler när PSTN-gateway har tilldelats platsen. "
    "Ta bort"
    "Lägger till"
    "och"
    "för"
    "Land / riktnummer"
    "Landskod"
    "Samtal från"

    Emergency/service number format: Emergency number is: 112
    I've not been able to locate any better document/list with all Area Codes and Cities than the one I liked to in my post.

    ReplyDelete
  4. Ken

    Thought you might like the full set of matches and translations for the UK phone system. These conform to the current standards from OfCom (government dept responsible for telecoms).

    Thanks for the great work on your blog.
    Regards
    Mike Hurley



    UK-Exchange-Local
    Match: ^([2-8]\d{5})$
    Translation: +44xxxx$1 (where xxxx is the local exchange minus the 0!)


    UK-National
    Match: ^(0|\+44)([1235789]\d{8,})$
    Translation: +44$2


    UK-International
    Match: ^(\+|00)?(\d{8,})$
    Translation: +$2


    UK-Service-Emergency
    Match: ^(112|999)$
    Translation: +999 (Note that the emergency number should be translated to 999, but EU requires 112 to be recognised. It will be translated at the exchange if you don't do it.)


    UK-Service-Exchange-Services - These allow for line services such as call divert at the exchange level
    Match: ^([\#\*][\#\*]?[0-9][0-9]?[0-9]?[\#|\*]?)((\d*)?(\#|\*)?(\d*)?(\#|\*)?(\d*)?(\#|\*)?)
    Translation: +$1$2


    UK-Service-Line-Features - These allow for line services such as operator (100) or directory enquiries (118118) fault reporting (151) etc
    Match: ^([1])(\d+)
    Translation: +$1$2

    ReplyDelete
  5. Thanks for the update, Mike. I've updated the rules to include the additions. One question, I don't understand the UK-Service-Exchange-Service rule. Can you give me some examples?

    ReplyDelete
  6. Ken - These codes allow access to features such as Call Waiting, Caller Display, Call Barring, Call Divert. Examples below:

    Call Divert on Busy
    Set - *67*[Phone Number to Divert To]#
    Check - *#67#
    Cancel - #67#

    Remote Call Divert (when you're remote to the exchange line)
    Set - *44*[PIN]*[Exchange line]*[Phone Number to Divert To]#
    Check - *#44*[PIN]*[Exchange line]#
    Cancel - #44*[PIN]*[Exchange line]#

    These allow POTS lines to be diverted at the exchange before getting anywhere near the customer premises. Lots of SMEs in the UK use these features (they're also extemely useful if you have a trunk line playing silly beggers).

    HTH
    Mike

    ReplyDelete
  7. Hey Mike,
    I've shortened your rule to this:
    ^([\*\#][\*\#\d]*\#)$ --> +$1

    It will take any combination of numbers or * or # as long as it starts with * or # and ends with #.

    Does that make sense?

    If it does, then I'll incorporate it into the Service norm rule for 1xx/999 like this:
    ^(1\d+|999|[\*\#][\*\#\d]*\#)$

    Ken

    ReplyDelete
  8. Hi Ken,

    Here's an input on the Norwegian dialplan as promised:
    The Norwegian country code is +47.
    most siptrunk providers accepts the fully e.164 numbering plan, and translations are not needed.
    Other PSTN providers (PRIs and BRIs) Expects to reicive the accurate number for the Norwegian numberplan, and 00 as a toll alert for all international calls.

    There are no difference in local or long distance calls in Norway, but special charges apply to certain number ranges (see list). Customers often seperate Mobile numbers and Premium services into different PSTN usages, to keep costs down.

    Emergency numbers are sent out the same gateway as any othe call.

    Norwegian numbering plan

    EMERGENCY
    110 - Fire dpt.
    112 - Police dpt.
    113 - Ambulance/Medical

    Other 3 digit
    120 - 179 ("Service numbers") local charges.

    4 digit extension ("yellow pages")
    1850 - 1899

    5 digit extension ("short numbers for certain services. May or may not charge extra cost)
    02000 - 09999

    6 digit extension (EU regulatory 2007/116/ef)
    116000 - 116999

    8 digit extension
    20 00 00 00 - 99 99 99 99

    Number series 0xxxx (5 digits) are service numbers used by large corporations, banks, police etc. and must all be reachable from abroad

    Number ranges 2x, 3x, 5x (except 58, 59), 6, 7, 85x terminate in fixed and/or IP telephony networks.

    Number ranges 4x and 9x terminate in mobile networks

    Number ranges 58x and 59x are machine to machine numbers

    Number ranges 8x except 85x and 87x are non-geographic numbers and are redirected by intelligent network, mostly to larger companies

    Number ranges 82x are premium rate numbers and should not be available from abroad

    This is taken from: http://www.npt.no/portal/page/portal/PG_NPT_NO_EN/PAG_NPT_EN_HOME/PAG_RESOURCE_TEXT?p_d_i=-121&p_d_c=&p_d_v=111848

    Translations (as best as I could do, as it is a bit difficult to get the correct wording without the entire context).

    "Lokal"
    "Nasjonal"
    "Internasjonal"
    "Service"
    "Ugyldig lokasjons ID"
    "Kunne ikke finne angitte lokasjons prefix for "
    " nummer normalisering for "
    " rute for "
    "Normaliseringsregler for "
    "Legg inn lokasjons navnet for lavest kost ruting for "
    "Kunne ikke finne en standard PSTN gateway. Det er anbefalt å definere en PSTN gateway i topologien din før du kjører dette programmet. Du kan fortsette uten en Gateway, men du må senere legge rutene og nummermanipuleringen til gatewayene dine manuelt. Etter at du har lagt dem til i topologien."
    "Fjerner"
    "Legger til"
    "Og"
    "For"
    "Land/område kode"
    "Lands kode"
    "Inkommende samtaler fra"

    Hope this helps,
    KR,
    Lasse Wedø

    ReplyDelete
  9. Hi,
    would it be possible to add a danish version?

    Here are the specifications:

    Country Code: +45
    International Call Prefix: 00

    Denmark generally uses an eight digit closed telephone numbering plan with no area codes.

    Numbering plan:

    Emergency Services: 112
    Police: 114
    Carrier Select codes: 10xx
    Service numbers (such as directory enquiries): 18xx
    Carrier select codes for data: 16xxx
    Services of public interest: 116xxx


    Mobile phones: 20-xx-xx-xx - 31-xx-xx-xx
    40-xx-xx-xx - 42-xx-xx-xx
    50-xx-xx-xx - 53-xx-xx-xx
    60-xx-xx-xx - 61-xx-xx-xx
    71-xx-xx-xx
    81-xx-xx-xx

    Landlines/ISDN: 32-xx-xx-xx - 36-xx-xx-xx
    38-xx-xx-xx - 39-xx-xx-xx
    43-xx-xx-xx - 49-xx-xx-xx
    54-xx-xx-xx - 59-xx-xx-xx
    62-xx-xx-xx - 66-xx-xx-xx
    69-xx-xx-xx
    72-xx-xx-xx - 79-xx-xx-xx
    82-xx-xx-xx
    86-xx-xx-xx - 89-xx-xx-xx
    96-xx-xx-xx - 99-xx-xx-xx

    Spare numbers: 13-xx-xx-xx - 15-xx-xx-xx
    17-xx-xx-xx
    19-xx-xx-xx
    37-xx-xx-xx
    67-xx-xx-xx - 68-xx-xx-xx
    83-xx-xx-xx - 85-xx-xx-xx
    91-xx-xx-xx - 95-xx-xx-xx

    Split charge numbers: 70-xx-xx-xx (Split charge is not generally used in Denmark anymore; calls to 70 numbers are usually charged as regular landline calls. A few exceptions do exist, e.g., 70 10 11 55 (the TDC talking clock service))
    Freephone: 80-xx-xx-xx
    Premium Rate: 90-xx-xx-xx



    Translation:

    "Lokal"
    "National"
    "International"
    "Service"
    "Ugyldig lokations ID"
    "Kunne ikke finde angivne lokations prefix for "
    " nummer normalisering for "
    " rute for "
    "Normaliseringsregler for "
    "Indtast lokations navnet for billigste rutning for "
    "Kunne ikke finde en standard PSTN-gateway. Det anbefales at definerer en PSTN gateway i topologien før du kører dette program. Du kan fortsætte uden en gateway, men du er nødt til senere tilføje ruter og nummer manipulation til gateways når du har tilføjet dem til topologien."
    "Fjerner"
    "Tilføjer"
    "Og"
    "For"
    "Land/område kode"
    "Lande kode"
    "Indkommende samtaler fra"

    Thanks in advance :)

    BR
    Mikkel Bach Nielsen

    ReplyDelete
  10. Thanks Mikkel!

    It's done. Check it out and let me know how it works.

    Ken

    ReplyDelete
  11. Ken just wanted to say thanks this tool is fantastic, however however i have a question how does your tool handle area codes that for local calls you don't need the +1 and for other calls to the same area code they require +1. I'm also running into issues with regards to missed calls or voicemails that show with a +1 so when you click the link in the mail it does not require it for that type of local call.

    Not sure i've made any sense. But let me know if you need further info.

    Thanks
    Habib

    ReplyDelete
  12. Hi Habib,
    The main purpose of the Lync Optimizer is to deal with exactly the scenario that you describe. It builds the necessary translation rules to strip the +1 for local calls within the same area codes, but to leave the 1 for long distance calls within the same area code.

    The key is that EVERYTHING needs to normalize to full 11-digits, including your numbers in AD and your dialing rule groups in Exchange UM. Read through my posts on Enterprise Voice Best Practices for more info.

    Ken

    ReplyDelete
  13. For worldwide data you might be interested in the PhoneNumberMetaData.xml file found at:

    http://code.google.com/p/libphonenumber/source/list?path=/trunk/resources/PhoneNumberMetaData.xml

    It's likely not in the right format for some of the data you need.

    (Disclaimer: I'm one of the editors of that metadata file).

    ReplyDelete
  14. @Mike Hurley

    This pattern is incomplete:

    UK-Exchange-Local
    Match: ^([2-8]\d{5})$
    Translation: +44xxxx$1 (where xxxx is the local exchange minus the 0!)


    It fails to match:
    * local numbers that begin with a 9 as used in most area codes these days,
    * 4-digit local numbers beginning 2 or 3 as used in the 016977 area code,
    * 5-digit numbers used in the twelve 5-digit 01xxxx area codes.
    * 5-digit numbers used in forty of the 4-digit 01xxx area codes,
    * 7-digit numbers used in the twelve 3-digit 011x and 01x1 area codes, and,
    * 8-digit numbers used in the five 2-digit 02x area codes.

    UK area codes are not exclusively 4 digits long. Area codes can be 2, 3, 4, or 5 digits long. Local numbers can be 8, 7, 6, 5 or 4 digits long, for a total number length of (mostly) 10 or (occasionally) 9 digits.

    There's useful information here:
    http://www.aa-asterisk.org.uk/index.php/01_numbers
    http://www.aa-asterisk.org.uk/index.php/Mixed_areas
    and other pages.

    ReplyDelete
  15. @Mike Hurley,
    Thank you very much for the information on that XML file. Its very interesting, and I will see about incorporating it into my program.

    As for the UK patterns, I'm working with Ian Galpin to correct the deficiencies in the rules. Having never been to the UK, its a bit tricky to find the right info for UK dialing rules (until now).

    Ken

    ReplyDelete
  16. Thanks for providing such useful information. I really appreciate your professional approach.

    ReplyDelete