Text to Speech from Database


I liked to get help for the following problem.
I want to make a text to speech from a database:

The idea is a user dial the extension 1234 to obtain the result by voice.

Table Example:
extension B
1 45
2 53
4 53
7 56

If for example the extension 7 dial 1234 should get the result 56 through voice.

I have the following code:
exten => 1234.1, Answer
exten => 1234.2, Wait (1)
exten => 1234.3, Authenticate (1234)
exten => 1234.4, Goto (myapp, s, 1)

exten => s,1,MYSQL(Connect connid XXXX XXXX XXXXXXXXX)
exten => s,2,MYSQL(Query resultid ${connid} SELECT b FROM tableexample WHERE (${CALLERID(num)} = extension}))
exten => s,3,SayDigits(${resultid})
exten => s,4,MYSQL(Clear ${resultid})
exten => s,5,Hangup
exten => h,1,Hangup

Unfortunately not result …
Just this week I started to experience this kind of stuff: (
What is wrong?

Very many thanks for your help.

i did it, using PHPAGI and Google TTS

1 Like

it works 5*,

Thanks for your help :smile:

Could you pleaz send me php file and dialplan