VoIP Mailing List Archives
Mailing list archives for the VoIP community |
|
View previous topic :: View next topic |
Author |
Message |
lardconcepts at gmail.com Guest
|
Posted: Mon Oct 03, 2016 2:49 pm Post subject: [asterisk-users] Synchronous dialplan execution for feedback |
|
|
I've got an agi that recognises speech (via Google) and another that turns text into speech (tts) (via Microsoft Translate).
Both are web APIs, both called via seperate python AGIs.
I've googled and I'm probably missing something pretty newbie 101 here, but is there any way, or fiddle, that I can play some audio to let the caller know that their weather forecast is being fetched, which the two agis are first recognising and then synthesizing the speech? I thought "background" might do it, but it doesn't seem to work like that.
Both agis take about 2.5 seconds, so that's 5 seconds of silence.
Yes, I'm aware of software applications that will quickly recognise and synthesize speech on the local machine, but they're not suitable for the application.
I realise there's probably a pythonic way of forking processes, but the way it is now, both agis are nice seperate single purpose functions and it all just looks quite neat as it is.
Many thanks. |
|
Back to top |
|
|
asterisk.org at sedwar... Guest
|
Posted: Mon Oct 03, 2016 5:48 pm Post subject: [asterisk-users] Synchronous dialplan execution for feedback |
|
|
On Mon, 3 Oct 2016, Jonathan H wrote:
Quote: | I've googled and I'm probably missing something pretty newbie 101 here,
but is there any way, or fiddle, that I can play some audio to let the
caller know that their weather forecast is being fetched, which the two
agis are first recognising and then synthesizing the speech? I thought
"background" might do it, but it doesn't seem to work like that.
|
Did something similar a decade ago
I had a credit card processing AGI for an adult audiotext line. The owner
was a real stickler for the 'caller experience' and didn't like the dead
air waiting for the auth back from the card processor.
My solution was to kick off a thread (the AGI was written in C, so I used
pthreads) to play 'and get ready for a good time' and then issue the
request to the card processor and waiting for the response in the mainline
code.
By the time the prompt finished, I had the response so pthread_join would
'finish' off the thread cleanly and the dead air magically disappeared.
The only 'warning' is not to do any I/O to STDIN/STDOUT in the mainline --
that would violate the AGI protocol and lead to things breaking in weird
ways.
--
Thanks in advance,
-------------------------------------------------------------------------
Steve Edwards sedwards@sedwards.com Voice: +1-760-468-3867 PST
https://www.linkedin.com/in/steve-edwards-4244281
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
Join the Asterisk Community at the 13th AstriCon, September 27-29, 2016
http://www.asterisk.org/community/astricon-user-conference
New to Asterisk? Start here:
https://wiki.asterisk.org/wiki/display/AST/Getting+Started
asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users |
|
Back to top |
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|