I have created a very nice script that runs when a member of a queue picks up a call. The problem is, the script, which makes API calls to a third-party application, takes about 5-10 seconds to complete. While the dialplan is waiting for the Return() it does nothing, and the the call is not connected. The agent and the caller both hear 5-10 seconds of silence.
Is there a way to execute the system script without waiting for an exit code? I tried a couple different variations of:
exten => s,1,System(/usr/scripts/script.sh ${FROMEXTEN} EXT=${CALLERID(num)})
exten => s,1,System(/usr/scripts/script.sh ${FROMEXTEN} EXT=${CALLERID(num)} &)
exten => s,1,System("/usr/scripts/script.sh ${FROMEXTEN} EXT=${CALLERID(num)} &")
none of which displayed the desired behavior.
As a compromise, I tried doing a system beep when the script was done executing by doing
exten => s,1,System(/usr/scripts/script.sh ${FROMEXTEN} EXT=${CALLERID(num)})
same => s,1,Playback(beep)
same => n,Return()
but all that did was execute the script, beep, then wait for the script to end before running the Return()
I also tried several methods of adding additional commands to the QGOSUB= in the globals_custom.conf, but I couldn’t get anything to work like I expected.
Any help is much appreciated. Thank you!