Asterisk read entered digits, say user balance and convert all english IVRs to Spanish

Hi Asterisk community and developers, I have 3 questions to ask about delay in process after read digit function, Asterisk saying the user balance left and changing all IVRs to Spanish.

A) I have successfully done the Asterisk to read user input but the problem I have is it takes 9 to 12 seconds before the next action is being carried after user has finally entered the number. The numbers entered from the command below is a 8 digit numbers.

same => n,SIPDtmfMode(RFC2833)
same => n,Read(phonenumber,enter-number-voice,8,i,1,1) ; digit typed, sound, maxdigit, option, attempt, timeout
same => n,Read(phonenumber=${FILTER(0-9,${phonenumber})})
;same => n,SayDigits(${phonenumber})
same => n,set(__perfectnumber=${phonenumber})
same => n,Goto(checkotherfunctions,1)

B) I want the user to hear the balance left in their account. Something like saying You have 30 minutes left. I dont know how to achieve this.

C) I remember I selected some En sound files in the make menuselect command. Is that where I go to select sound files for Spanish also. And if I should that, will it overwrite the existing IVRs in /var/lib/asterisk/sounds/en/ or will it create a separate directory for Spanish IVRs in the sounds directory

A) The second Read should not be Read.

B) There are applications for saying times. You will probably have to record additional sound files. Finding and calculating the value depends on details of your application that you have not provided.

C) They will go in a directory with es replacing en.

Also, I think the i option on the Read is wrong.

What should go for the second statement I used READ. I want to filter the input values to make sure they are numbers

Also, should I remove the option i.

B) For the application saying something like you have 30 minutes left. What do you suggest I do?


(There is code in Asterisk that can deal with minutes and seconds (not sure about hours - it is for queue waiting times), but It looks like it isn’t exposed as an application in its own right.)

Okay, what about the wait in the value entered. Also I get some warning statement from CLI saying

Retransmission timeout reached on transmission 24372d640d67d6f093d7fc1efd1e18ae for seqno 1 (Critical Response) – See
Packet timed out after 31999ms with no response

Do you think this might cause it?

It should be Set and not Read

–Satish Barot

Did you follow the instructions in this message?

In any case, this generally indicates a NAT misconfiguration. You are sending the caller a contact address that is not routeable from their side.

Is there a way for Asterisk to say 30 in Spanish and not in English. I have tried to add Spanish sounds files using the Make Install but it didnt work. I want to change my Asterisk default IVR language to Spanish but I am not getting any luck

Set CHANNEL(language)=es

Then you should be able to use the normal SayNumber() command to speak your 30.

Like this?

same => n,CHANNEL(language)=es
same => n,Playback(/var/lib/asterisk/sounds/es/you_have)
same => n,Set(balmin=$[${balance} / 60])
same => n,Set(balmin=$[ROUND(${balmin})])
same => n,SayNumber(${balmin})

same => n,CHANNEL(language)=es

should be

same => n,Set(CHANNEL(language)=es)

I suggest you go through to get some idea on Asterisk Applications, Functions and how different components work

–Satish Barot

1 Like
same => n,Set(CHANNEL(language)=es)
same => n,Playback(vm-youhave)
same => n,SayNumber($[ROUND($[${balance} / 60])])
1 Like