Well, to anyone interested in this particular issue, I was able to solve it.
I simply changed the Stream File command to Exec Playback, which is essentially the same in Asterisk, but control goes over to Asterisk instead of the AGI script, if i recall correctly.


Hello. I'm currently developing an IVR system under Asterisk through the Asterisk Gateway Interface (AGI), connecting to a Mysql server using the Mysql C API.
The server returns a ticket number that I have to say to the client, so I developed a TTS (Text To Speech) algorithm to say a specific number (13000) to the client for testing, by using the AGI application Stream File, and playing two sound files back to back, thirteen.gsm and thousand.gsm, so the caller can hear the ticket number "Thirteen Thousand"
The problem is this: on the Asterisk debug console I can see that the Stream File ("thirteen") and Stream File("thousand") functions work, but can hear no sound whatsoever on the softphone. The sound files play fine on other sound players and so do other AGI applications using the Stream File function.

The code below basically copies the number returned by the server (13000 for this test) on the array 'numero', then checks the first and second numbers to be '1' and '3' (I omit the latter since I know they're zero) then play the files through the AGI functions Stream File.
I'm guessing it has to do with being connected to the server while playing files or something.
Any ideas?
[CODE]while ((row = mysql_fetch_row(res)) != NULL)
for (i=0; i<j; i++)
if (prueba[0][i]=='0' || prueba[0][i]=='1' || prueba[0][i]=='2' || prueba[0][i]=='3' || prueba[0][i]=='4' || prueba[0][i]=='5' ||
prueba[0][i]=='6' || prueba[0][i]=='7' || prueba[0][i]=='8' || prueba[0][i]=='9')

            //printf("El string comienza en posicion %i\n",i);
            for ...
jephthah commented: nice to see someone's first post, with properly formatted code. +5