Summary:ASTERISK-18531: Asterisk 1.8.6 - MySQL Realtime - "language" variable is useless
Reporter:Inaki Osuna (iosmal)Labels:
Date Opened:2011-09-13 03:53:54Date Closed:2011-09-27 10:40:15
Versions: Frequency of
Environment:Using asterisk dynamic realtime configuration for sippeers, extensions and voicemail users. Using MySQL as database. Debian 6.Attachments:
Description:We have customers from several countries, so we define a row "language" in the sippeers database to listen the default message in every different language, depending on the requirements of our customer.
We don't have a "language" entry in [general] area of sip.conf file to customize each extension with the parameter in realtime database.

The problem is that any time we call to a customer and he's not available, the voice is in english, even if that sip peer is configured as spanish in the realtime database. So we have no way to customize the language prompt for every extension.

I've checked if it's a problem of file permissions of the /var/lib/asterisk/sounds/en... /es... /de... files/folders but it seems everything correct.

If we call to our own VoiceMail from the Dialplan, the language seems to be correct, depending on what we have configured in the realtime database previously. But the initial prompt ("The extension ... is not available, please, leave your message after the tone..) is always in the asterisk default language.
If we add in [general] language=es in sip.conf, all that initial prompts are in Spanish, but still no way to configure every extension independently.

Regards and thanks in advance.
Comments:By: Leif Madsen (lmadsen) 2011-09-14 10:04:39.155-0500

Does this work for peers statically defined?

By: Inaki Osuna (iosmal) 2011-09-14 17:31:55.176-0500

As you required, we've changed that peer from realtime sip database to static, and the problem is still there. We have all the asterisk core reloaded after the changes...

Just to test, I've changed the voicemail entry from dynamic to static to know if the problem is related with voicemail configuration, but i've got the same problem.

We told the customer to save a customized message in his mailbox, and the asterisk logs shows the file "unavail.wav" as english. That file is recorded in /var/spool/asterisk/voicemail/residential/extension

<SIP/entice-0000262b> Playing '/var/spool/asterisk/voicemail/residencial/XXXXXXXXX/unavail.slin' (language 'en')
<SIP/entice-0000262b> Playing 'vm-intro.alaw' (language 'en')

By: Leif Madsen (lmadsen) 2011-09-20 16:28:34.282-0500

OK issue acknowledged. Thanks!

By: Tilghman Lesher (tilghman) 2011-09-22 11:27:24.938-0500

Language is not supposed to do that.  The language is set for the owner of the channel.  When you call a SIP peer, your preferred language does not (and should not) change.  If you want your preferred language to change when you call a SIP realtime peer, then you need to add extra logic to your dialplan to query the language for that peer and then change your OWN language.

This is simply a misunderstanding of the language attribute and NOT a bug in Asterisk.

By: Inaki Osuna (iosmal) 2011-09-22 12:27:16.570-0500

If I have an English spoken customer, and he wants to have his VoiceMail in English... it's logical to think that he wants that people that calls him receives the unavailable message in English... it's not a problem to add logic to dialplan, but it's not the logic behaviour, in my opinion... that's because i've thought it was a bug.

In that case... which is the purpose for the language setting? None?

By: Tilghman Lesher (tilghman) 2011-09-27 10:39:26.787-0500

The purpose of the setting is to set the language for the origination of calls, to play prompts in that chosen language.  It has no bearing on the destination channel.  When the SIP peer places a call, any prompts played for the duration of that call will be in the set language.

Just because you call someone who prefers to hear prompts in Klingon does not mean that all callers should have to know Klingon in order to understand the prompts when they leave a message on her voicemail.

By: Inaki Osuna (iosmal) 2011-09-27 14:15:40.352-0500

That's exactly what I'm saying. If my asterisk is in Spain, I've placed in [general] section language=es because 99% of my customers speaks Spanish, but what if i have an English customer? the problem is that if this guy receives a call from a pal in England, the caller from England is going to receive a message in Spanish, even if the prefered language for that peer is English.

The logical thing, in my  opinion, and I think it's nothing crazy as you can set the language in general section and in every sip peer definition, is that if I set just a peer in language=KL (klingon)... incoming and outgoing calls since/from that peer are in Klingon... even if the default language for the rest of peers are in Elvish or any other language of the United Federation of Planets.

The problem is not in the voicemail of every peer... every customer listen his voicemail in the language defined in his peer... it's correct. The problem is in the incoming calls to a peer... if nobody picks up the phone, the language for that prompts as in the default language, not in the specific peer language...

Now it's solved adding an extra line to my dialplan... but even if i have solved this situation, I'm still thinking that the behaviour of the language setting is not 100% correct.