Different voice messages dependent on the callers country(without IVR)?

Hi there,

I’am wondering if it will be possible to configure a voice mail to play a voice message in dependency of the callers country, without using a IVR to let the caller decide which one he/she would get. This should work with a single extiension.
For example:
A caller from home country who sends a country code +xx should get a voice mail in native language. A caller from neighboring country with country code +yy should get a voice message in his/her language and all others should get a voice message in english.
I’am aware that this need different sound recordings but I’m not sure how to configure this in free pbx.

Best regards,
Sablapet

You need to have different ivr for each language and then guide the call based on the cid value. In your inbound route you can use the cid option with a pattern to guide the calls e.g. _001XXXX.

You don’t need separate IVR’s, you just need to set the channels’ language as appropriate.

You need a full set of announcements/recordings you added in all of the /var/lib/asterisk/sounds/(LN)/custom directories and of course the base and additional sound files in /var/lib/asterisk/sounds/(LN)

where (LN) is the language, for example one for en-GB, one for fr, one for it, etc. they all need to have the same name, then just set the language for the channel on a custom inbound context

[my-custom-inbound-context]
exten => s/_00133X!,1,Set(CHANNEL(language)=fr)
exten => s/_00133X!,n,Goto(from-pstn,${EXTEN},1)
exten => s/_00144X!,1,Set(CHANNEL(language)=en-GB)
exten => s/_00144X!,n,Goto(from-pstn,${EXTEN},1)
exten => s,1,Goto(from-pstn,${EXTEN},1)

Add lines as appropriate. This should work in general for most anything in Asterisk , voicemail prompts, system announcements, etc.

Edit:-

I reread your original post, sorry but there is no real way to do that for comedian mail which is the asterisk voicemail subsystem, at least not in the dialplan, it gets it’s variables from flat-files and there is no way to “dynamically” change that behavior without patching that file

/etc/asterisk/voicemail.conf

and reloading the voicemail subsystem, that suggests an AGI solution as a likely solution as it enters the voicemail app and set the ${VMCONTEXT}, to one of several versions of the extensions voicemail box in a multilingual manner, but that isn’t trivial or pretty :slight_smile:

Dear @dicko thx for your reply. Do you know any commercial modul which can achive this task.

@astbox Thx for your recommendation, this would be the alternativ if no other solution is available.

Sorry, I don’t know of one. Comedian mail preceded Asterisk by quite some time, and asterisk took a long time to be “language aware” I would go the [email protected] [email protected] [email protected] multiple mailbox route route, add and steer as appropriate when the call hits the voicemail() app the channel language should be set if you followed my post ready for that concept. perhaps add for a custom dialplan appropriately :-

exten => blah,n,Set(DB(AMPUSER/${EXTEN}/voicemail)=${CHANNEL(language)})

don’t forget to reset it back to default after use.

Also, this isn’t a bad idea “in the large” so putting in a reasonable feature request that would include as much detail about how you thing the thing should work.

It might not happen soon, but if the request is in there, if more people ask for it, it might happen faster.

In FreePBX 13, setting channel language is all in the GUI and all pretty easy, and can be easily done based on inbound CID by setting an inbound route for each CID pattern. Install the core an extra recording files using Sound Languages (or manually) and then create multi-language system recordings for IVRs. Voicemail will automatically play the sound files of the set channel language as long as the files are present on the system.

That will change the prompts, but not the voicemail greetings as the OP requested. You can of course set the channel language by any convenient way, I obviously prefer mine as it does it globally and there is less GUI’ness involved (Thank good-ness for that, any old Brits around here to get that ? :slight_smile: )

I came up with this method to dynamically hard-link the greetings from a language specific vmail box to the standard default one. Just add to /etc/asterisk/extensions_override_freePBX.conf

exten => s,1,Set(VMLANGEXIST=${SHELL([ -d "/${ASTSPOOLDIR}/voicemail/${TOLOWER(${CHANNEL(language)})}/${ARG1}"  ] && echo -n $? || echo -n "no such directory ${TOLOWER(${CHANNEL(language)})} "})
exten => s,n,Set(UPDATED=${IF($[ "${VMLANGEXIST}" = "0" ]?${SHELL(ln -f  /${ASTSPOOLDIR}/voicemail/${TOLOWER(${CHANNEL(language)})}/${ARG1}/*.wav -t /${ASTSPOOLDIR}/voicemail/default/${ARG1}/ && echo -n $? )})})
exten => s,n,Set(UPDATED=${IF($[ "${VMLANGEXIST}" = "0" ]?${SHELL(ln -f  /${ASTSPOOLDIR}/voicemail/${TOLOWER(${CHANNEL(language)})}/${ARG1}/*.WAV -t /${ASTSPOOLDIR}/voicemail/default/${ARG1}/ && echo -n $? )})})
exten => s,n,Set(UPDATED=${IF($[ "${VMLANGEXIST}" = "0" ]?${SHELL(ln -f  /${ASTSPOOLDIR}/voicemail/${TOLOWER(${CHANNEL(language)})}/${ARG1}/*.gsm -t /${ASTSPOOLDIR}/voicemail/default/${ARG1}/ && echo -n $? )})})
exten => s,n,Set(VMCONTEXT=${DB(AMPUSER/${ARG1}/voicemail)})
exten => s,n,GotoIf($["foo${VMCONTEXT}" = "foo"]?200:300)
exten => s,200,Set(VMCONTEXT=default)
exten => s,300,noop()

It is totally benign unless you have that /var/spool/asterisk/voicemail/(your_language) directory.

At your convenience, create that /var/spool/asterisk/voicemail/(your_language) directory thusly . . . from the GUI, change the voicemail context of the relevant vmail box to each language you want to use , including your base language “en” (my “base” language) , “it”, “de” , “en_gb” etc and record the language specific greetings etc. (*97, then option 0, then 1 2 and 3 . . . ), when done return the voicemail context to “default”. You can add more later , but remember to return it to “default”.

a couple of quirks I ran into, yes it has to be “en_gb” NOT “en_GB” as the php code lowercases the voicemail context and no you can’t use *.{wav,WAV,gsm}" for the globbing because asterisk throws up on curly things in the wrong place (as do I :slight_smile: ), and you only need lines that match your "record = " line in voicemail.conf

Obviously don’t do this if you don’t understand it.

Dear all,

thanks for your replies and the recommendet solution.
Since I’m quite new with asterisk/free pbx this sounds a bit to complicated for me to achive it.
I’ve decided to merge the sound files and use it temporarily. I try to knowledge myself more with the system and will come back to this later.

Best regards,
Sablapet