Call directing based on phone number location

Hello, I am currently setting up a phone system for my campsite in France. Is there a way to direct a call from a UK phone number to an English IVR and a French phone number to a French IVR etc. ? I have it currently set up where the announcement is in French then English but its too long for english speakers to wait for the french announcement to lapse.

Thanks :slight_smile:

U.K callers CallerID(number) probably start with +44 (possibly 0044), french ones start with +33 (possible 0033), write a custom context to differentiate

1 Like

How do I do a custom context? I’ve been looking everywhere on google and in the GUI but I can’t find anything

You add the code to /etc/asterisk/extensions_custom.conf and set Context for your trunk to the name of your new context.

However, you may find a dynamic route easier. For example, see Using Dynamic Routes for Call Flow Control , or search for other examples.

In any case, you should allow easy manual language selection. For example:
“Bienvenue au camp de l’utopie. For English, please press 9. (Instructions continue in French.)”

1 Like

To construct all this as @Stewart1 suggested, ChanDump() early in the context will reveal language and caller/callee variables.

Couldn’t you just duplicate the inbound route to test the CID for +44X and send the destination to languages (English) then next destination the English IVR all asterisk messages will be English
The next inbound route for CID any will be French and default language French

You could just do what a lot of other multilingual companies do, have a general IVR that plays “For English press 1, for French press 2” then repeat that in French in the greeting recording.

There’s an option in Inbound Routes to set the preferred language, so you could create an inbound route for all UK calls based on CID number, set the language on the other tab:


After that, you would setup a single IVR announcement with multiple languages, and the language played will be the one selected in the inbound route.

1 Like