TTS AGI Interruptible?


(Communication Technologies) #1

Used this amazing post to implement AWS Polly TTS engine, and it works great (wish this could be out of box). Thanks again @jersonjunior!

The dial plan that calls the TTS is:
exten => 1,n,AGI(propolys-tts.agi,"My name is Polly! Do you want a cracker? I do!",aws-polly,/usr/bin/node)

The only real problem we have is that the line above is not interruptible. Currently we break the TTS into smaller calls, but this is tedious. Is there a better way to execute this and allow the AGI call to be interrupted by a caller’s key press?

Thanks!


(Communication Technologies) #2

My fault for not reading more closely. @jersonjunior already answered this in the above thread.

exten => s,1,Progress()
 same => n,Set(audio=${SHELL(node /opt/aws-nodejs-sample/script.js --mp3=/home/asterisk/audio-${cpf}.mp3 --text=’${nome}’ --wav=/var/lib/asterisk/sounds/audio-${cpf})})
 same => n,Playback(audio-${cpf})

Replacing the Playback with Background does the trick. On the fly recordings that are customer interruptible.


(system) closed #3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.