Async AGI dialplan command to script

Ok, I’m a noob at AMI.
I’m creating feature that plays live mpeg stream through ffmpeg and I’ve given advice that it’s implemented through Async AGI.
So I’ve encountered exmaple like

[audio-player]
exten => _X.,1,Verbose(entering audio player)
exten => _X.,n,AGI(agi:async,audio-player)
exten => _X.,n,Verbose(exiting audio player)
exten => _X.,n,Hangup()

that dialplan execute script ami+agi_audio_player_async
(Files · master · Lawrence D’Oliveiro / seaskirt_examples · GitLab)

My question is what exactly does AGI(agi:async,audio-player)?
Where do I place my scipt and how do I make that AGI(agi:async,audio-player) executes script?

If you look at the docs, you will see that this form of AGI command will send an AsyncAGIStart event. Your script needs to be watching for that. And then you can send an AGI action via AMI on that channel, to do the usual AGI stuff.

Hope that helps.

But how I make my ami+agi_audio_player_async script to watch for AsyncAGIStart event?

When you set up your AMI connection, you specify whether whether you want to receive events or not. If you don’t say “events: off”, then the answer is assumed to be yes.

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