[asterisk-users] AGI: blocking script until playback complete
Ron Bergin
rkb at i.frys.com
Wed Feb 22 09:39:47 CST 2012
Chris Bagnall wrote:
> Greetings list,
>
> I've done AGI scripting before, but in the past I've always wanted
> control to be returned to the dialplan as soon as possible.
>
> However, today I have a scenario where I want the script to remain
> running during the playback of a file so that I can read DTMF at the end
> of playback. However, doing this:
>
> GET DATA en_welcome 5000 6
>
> Results (correctly) in the following in the asterisk console:
> -- <SIP/a.b.c.d-dc027b50> Playing 'en_welcome' (language 'en')
>
> But the AGI continues to run on after this point, not waiting for either
> the sound file to be played, nor for the expected 6 DTMF digits.
>
> Adding a simple 10 second sleep/wait to the AGI allows the sound file to
> be successfully played back.
>
> I'm sure I must be missing something very obvious, buy my google-fu is
> failing me this afternoon.
>
> Suggestions gratefully received :-)
>
> Thanks in advance.
>
> Kind regards,
>
> Chris
> --
Have you tried increasing the timeout value in the command? To me, it
appears to be too short. Try setting it to 50000.
--
Ron Bergin
More information about the asterisk-users
mailing list