[asterisk-users] [1.4] Reading phone number the French way?
Gilles
codecomplete at free.fr
Wed Mar 9 07:56:46 CST 2011
On Wed, 9 Mar 2011 12:43:37 +0200, Tzafrir Cohen
<tzafrir.cohen at xorcom.com> wrote:
>On Tue, Mar 08, 2011 at 02:58:02PM -0600, Tilghman Lesher wrote:
>> On Tuesday 08 March 2011 06:49:55 Faisal Hanif wrote:
>> > You can also set it in dialplan using "Set(LANGUAGE=FR)"
>>
>> Actually, the right way to do this is:
>> Set(CHANNEL(language)=fr)
>>
>> The "LANGUAGE" pseudo-variable is read-only.
>
>Also note that Asterisk will use French number saying rules as long as
>the language (the "LANGUAGE" pseudo variable) is "fr" or its prefix
>(anything up to the first '_') is "fr".
Thanks for the information. With say.conf in /etc/asterisk, I used the
following dialplan:
==================
exten => 2222,1,NoOp(Pseudo LANGUAGE is ${LANGUAGE})
exten => 2222,n,Set(CHANNEL(language)=fr)
exten => 2222,n,Set(NBR2CALL=0142928100)
exten => 2222,n,SayNumber(${NBR2CALL})
exten => 2222,Hangup
==================
Unfortunately, the LANGUAGE variable is empty, and Asterisk still
reads the number as "142 million, 928 thousand, one hundred":
==================
-- Executing [2222 at internal:1] NoOp("SIP/xlite-03640004", "Pseudo
LANGUAGE is ") in new stack
-- Executing [2222 at internal:2] Set("SIP/xlite-03640004",
"CHANNEL(language)=fr") in new stack
-- Executing [2222 at internal:3] Set("SIP/xlite-03640004",
"NBR2CALL=0142928100") in new stack
-- Executing [2222 at internal:4] SayNumber("SIP/xlite-03640004",
"0142928100") in new stack
-- <SIP/xlite-03640004> Playing 'digits/hundred' (language 'fr')
-- <SIP/xlite-03640004> Playing 'digits/40' (language 'fr')
-- <SIP/xlite-03640004> Playing 'digits/2' (language 'fr')
-- <SIP/xlite-03640004> Playing 'digits/million' (language 'fr')
-- <SIP/xlite-03640004> Playing 'digits/9' (language 'fr')
-- <SIP/xlite-03640004> Playing 'digits/hundred' (language 'fr')
-- <SIP/xlite-03640004> Playing 'digits/20' (language 'fr')
-- <SIP/xlite-03640004> Playing 'digits/8' (language 'fr')
-- <SIP/xlite-03640004> Playing 'digits/thousand' (language 'fr')
==================
FYI, I put "language=fr" in zapata.conf and sip.conf. Do I need to use
another function than SayNumber() in the diaplan?
Thank you.
More information about the asterisk-users
mailing list