[asterisk-users] [1.4] Reading phone number the French way?

Gilles codecomplete at free.fr
Thu Mar 10 05:55:18 CST 2011


On Tue, 08 Mar 2011 13:22:18 +0100, Gilles <codecomplete at free.fr>
wrote:
>I need to write a script which prompts the callee to type a number,
>and then read it back to them as confirmation:

Apparently, the right way to read a phone number back to the user is
not to use SayNumber() (which might be OK for US-style reading) but
rather Playback(<prefix>:<number>,say), which will then rely on
say.conf

For instance:
======= extensions.conf
exten => 2222,1,Set(NBR2CALL=0142928100) ;exten =>
2222,n,SayNumber(${NBR2CALL}) exten =>
2222,n,Playback(phone:${NBR2CALL},say)
======= 

Using this almost works:
======= say.conf
_pho[n]e:0[1-9]XXXXXXXX => num:${SAY:0:1}, num:${SAY:1:1},
num:${SAY:2:2}, num:${SAY:4:2}, num:${SAY:6:2}, num:${SAY:8:2}
======= 

The remaining problem is when a couple starts with a zero, eg. 01
(should be read "zero one"): In this case, Asterisk ignores the
leading zero and simply pronounces the second digit ("one")

Does someone know of a trick so that the pattern handles couples that
have a leading zero?

Thank you.




More information about the asterisk-users mailing list