International offices - How can I set up the dial plan to help make it easier for them to call out?

Hello FreePBX community!

I wonder if someone could shed some light on a dialplan issue I’m having?

We have two corporate hub offices, one in California, and a new one in México City.

I have two trunks set up, and want to accomplish two things:

1.) When a team member in the México City office dials out (to a number in the U.S.) with a prefix of “9” for instance, I want them to be able to then just dial 10 digits… Example: “9, 310-555-1212”.

2.) When that same team member calls out to a number in México City for instance, I would like them to be able to instead place an “8” in front of the number, and then just dial the 10 digits to reach the number in México… Example: “8, 55-1234-5678”.

As it stands now, they can just dial out with 10 digits and will be routed to their U.S. number, but to call locally inside México, they have to lead with “011+52” (52 is the country code for México).

I have been able to configure the “9” to work, but I’m having some challenges on how to program in the “8” to place the “01152”.

I would like to eventually set up the “8” and “9” to use separate trunks in order to be able to use the caller ID’s of the respective trunks which are based in the respective countries, but I think that will be simple once I get this resolved.

Any insight/assistance is greatly appreciated!

Have a great day!

For routing out a single trunk, the patterns can be in the same list:

1 Like

I would suggest that quite easily

1NXXNXXXXXX goes to the US ( and you can always do 11 digit dialing from California)

[2-9]XXXXXXXXX goes to mexico (01152) (and all the Chicanos have dialed that since 2018)

That way both gringos and chicanos get to just pick up the phone and dial, no?


As it stands, they can also lead with 52.

I have a similar system with extensions in three countries. Calls are dialed starting with the country code (an initial + is optional). On incoming, caller ID is formatted starting with the country code (no +).

If you really want to do this, add a dial pattern with
prepend: +52, prefix: 8, match pattern: NXXXXXXXXX

However, I recommend against using prefixes such as 8 and 9. There are human issues; if dialing is different from a landline or mobile there will be more mistakes. Also technical issues; if you show an incoming caller ID without the 9, the user won’t be able to return the call from device history, it won’t match his contact or directory entry, etc. But if you do prefix the 9, the phone may not parse it correctly and it’s harder for the user to understand it.

Two possibilities come to mind:

  1. You dial all calls starting with the country code, but you also allow an initial 0 (instead of 52) for calls to México.

  2. You can dial 1 followed by 10 digits to call US/Canada, 0 followed by 10 digits to call México, but 10 digits (with no prefix) from a US extension will assume country code 1, while 10 digits from an extension in México will assume country code 52. To call elsewhere in the world, you must dial 00, 011 or +, followed by country code and number. This is more complex to make incoming caller ID work properly, unless you are willing to show the + on all incoming numbers.

You can set a caller ID on the Outbound Route that overrides the extension, so for example all calls to México from the US would show your México main number, while all calls to the US from México would show your US main number, all with just one trunk.

However, there are very few trunking providers that offer 911 service for both US and México. If you have one of those, you’re lucky and need only one trunk. Otherwise, you’ll need a second one. If so, make sure that you send regular traffic over both, so you can be confident that a 911 call will work if you need it. Also, set up your routing so 911 works both if dialed alone, or with any prefixes you implement.

Thanks, @dicko and @billsimon!

I think that it likely is better to go with a combination of the two… For now, the majority of calls that our Mèxico City office is making are to the U.S.; And I don’t forsee our U.S. based offices making a lot of calls into México other than intra-company, for which of course they can just press the BLF key on their devices to make.

@Stewart1 made a great point which I had not considered, which is the issue with redialing. I’m based 80% out of our Mèxico City office, so I can safely say that I’d hear a lot less grumbling from our team here than in the U.S. about the redialing issues.

I’m going to implement this morning and I will report back. Thanks, everyone for the assistance!

Thanks, @dicko and @Stewart1 - So I tried to match the config you both recommended… A hybrid; for the first line (BTW I decided after a couple of days to also program as per your recommendation of the “1”

I’m having difficulty now though getting the calls to connect in México by starting with the “8”

I have tried “8” followed by the number in México City (8)+(55+7889+1210) for example. The only thing that follows is the annoying as ever “all circuits are busy now”.

I will track down the logs tomorrow, but if anyone has any suggestions until then I’d love to get this fixed… it’s holding up and breaking all of my Follow Me programming. User revolt not exactly imminent, but an increasing possibility.

Thanks again, @dicko @billsimon @Stewart1

My idea was to not have 10 digit dialling from California, All area codes in California have ‘permissive’ 11 digit dialling enabled, Thus:-

Two dial rules needed to rule them all:-

1NXXNXXXXXX matches US (always 11 digits)

[2-9]XXXXXXXXX matches Mexico (always 10 digits) and the dial rules prepend 01152 to such a pattern.

The entry for México should be prepend +52 prefix 8 match pattern NXXXXXXXXX

I think you intended to have a leading digit 1 on that pattern, not an !character.

1 Like

typo fixed, thanks

The third rule (10 digit us dialing) will mess with the 4th rule as there are many areacodes that start with 8 and further , the prefix 1 wont ever be in a dialpattern starting with N

1 Like

The top three rules in your screenshot do not make sense. You do not want to remove the 1 and add a +; you do not want people to dial 11NXXNXXXXXX, and the third one removes 1 and adds it back in again. Take some time to read the pattern help and plan out what you want to do.

“Tracking down the logs” should be the very first thing you do before continuing to guess at the patterns, because the logs will show you what FreePBX is doing.

ps, if you can’t understand what dicko is saying, join the club. Just read the docs; it will be clearer!

Not surprising that I’ve buggered this up good. I’ve always struggled with dial patterns. I’ve never been able to find a good white paper or other source that explains them in a way that makes sense to me for some reason.

I see a “dial patterns for dummies” google search in today’s searches.

Please try this route:

The first pattern allows 10-digit US calling, e.g. 212 555 1212
The second allows 11-digit US calling, e.g. 1 212 555 1212
The third allows MX calling by first dialing 8, e.g. 8 55 7889 1210
The fourth allows calling other countries by dialing 011 + countrycode + number (though it will also work for US and MX).


Thanks @Stewart1 - I will try this. I was looking at @dicko’s messages and thinking I should eliminate the 8.

Today’s the day most of our users are going to migrate to the new deployment as the porting should complete this morning… I’ll have to have it figured out one way or another by the end of the day :slight_smile: :roll_eyes:

OK So after reading the suggestions above, I went back and hit the books on dial plans again, and found the areas that I was deficient that were hurting me the most.

I applied a blend of @Stewart1and @dicko’s suggestions. As I wanted to make it as easy for users as possible to return calls from their call history as well as dial easily from both counties, I needed to strike a balance between the two.

So I looked at how usage is playing out now rather than in the future. As a systems architect (thrown back into actual management of some systems due to Covid-19) I tend to look as far down the road as possible, and here I think that was holding me up.

In the actual usage now, most calls from the México City office are calls to the U.S., aside from the office manager dealing with vendors in the city. And in the U.S., 99% of calls are made within the United States.

Seeing as for now and at least the next 6 months that’s how it mostly will be, I went for the 8+ to dial within México, and made it possible for everyone to call within or to the U.S. by dialing a 1+, or just the area code and the number, etc.

As of right now, everyone is happy… And hopefully in 6 months we’ll have enough budget again to hire a new analyst to manage the servers again, please baby Jesus, thank you. :pray:

Thanks guys for the invaluable assistance! I appreciate people like yourselves who take the time out of their day to share their knowledge and experience with Asterisk and FreePBX.

1 Like

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