Include default dial code on numbers with no dial code

The users at one particular office here insist on dialing local numbers with no dial code, and then calling us up and complaining the phones dont work.

It’s because their old analogue system allowed this.

Is there a way we can easily create a dial rule that checks whether inserts “01234” if the first digit doesn’t begin with a “0” or a “9” or a “1” ?


What would you prefer they do?
a seven digit number implies dialing locally so if you’re in area code 212
Prepend 1212 strip nothing if you match NXXXXXX for anyone

You can do it on the phones (labor intensive unless provisioning), on the outbound routes (correct) or on the trunks (naughty)

Its a little trickier. Here in the uk we have legacy number (5 digits), 6 digit ones and newer 7 digit ones.

But yes,on the outbound route sounds ideal.

Got any tips on how to structure the dial plan adjustment?


Just find out what comes naturally to the users and accomodate…

Routes in FreePBX present the Asterisk dialplan very simply:
prepend -> prefix -> match-pattern -> CallerID
So: instead of a cryptic string like 212+NXXXXXXX and possibly 1+NXXNXXXXXXX that I suggested in a previous message there are fields for these (and more) - then FreePBX builds the string.

You have to keep in mind this is a theoretical discussion but which lines are these calls going to use? so in the route, you should insert things so they conform to whatever you’re being asked to provide. Few of the service providers I’ve dealt with have asked for a full ITU expression of the number but that’s where I normally start then take shortcuts when they’re available.

Some service providers ask for the entire ITU string without the international prefix - users shouldn’t be forced to do that so you would strip that:

example some user on a “smart” phone might have the number in their directory as (say) +201001233333 (which splits out to +20 10 01233333) and I might have a method of delivering that call that would choke over the country code… so I’d put it as
no insert/strip +20/insert 0/match 1XXXXXXXXX for all users and then pass that to the line…

There will be a UK national numbering plan that you may take advantage of but your best bet is the user.

My PBX is at home and my “users” think of the telephones as they’ve always used them… all cell phone directory numbers are handled. in fact, I allow them to call into other countries without even inserting the country code (not suggesting you do this but the origins of that was a tie-line).

easily done. use Dialed Number Manipulation Rules on the trunk.

(44 ) + 0 | XXXXXXXXXX
(441234) + | XXXXXX