Thanks Eric,
Well, with your guidance and after a fair bit of Googling, experimentation
and headscratching, here is the Python version for anyone who wants it
Also works with other long AGI background tasks to quickly return to the
dialplan when something else is being processed.
import os,
Asterisk (after 1.4?) sends the AGI a HUP when the call hangs up.
Try setting your script to ignore the HUP signal and make it fork and go
into the background so Asterisk thinks the process has completed.
In PHP ignore HUP:
pcntl_signal(SIGHUP, SIG_IGN);
In PHP fork and become a short
I know that hangup handlers (
https://wiki.asterisk.org/wiki/display/AST/Hangup+Handlers) have to finish
quickly.
So it's no surprise that my speech to text agi which takes 8 seconds gets
killed.
However, can anyone think of a way round this? So, once the caller has hung
up, I need to take one