The dialplan controls how calls are routed and execute dialplan applications or logic. AsyncAGI is one of those. I can’t tell you what to add, because I have no idea what your dialplan is currently.
Basically I am using a wrapper that let me use some functions of the AMI inside my Stasis. One of them let me “add an AGI command to execute by Async AGI”. The problem resides when I tried to execute this function and the message “res_agi.c:1583 add_agi_cmd: Channel PJSIP/default-00000006 is not setup for Async AGI” appeared in the Asterisk CLI.
I have a worked example of how to set up AsyncAGI in the ami+agi_audio_player_async script here. Basically, you set up an AMI listener that watches for AsyncAGIStart events. You might have several sources of such events going on at once. So what my example does is use the first AGI argument as an identifier for the event listener:
exten => _X.,n,AGI(agi:async,audio-player)
In this case, the identifier is “audio-player”. So my script looks for this:
if evt.get("Event") == "AsyncAGIStart" :
env = dict \
(
l.split(": ", 1)
for l in urllib.parse.unquote(evt["Env"]).rstrip("\x0a").split("\x0a")
)
if env["agi_arg_1"] == "audio-player" :
... do my stuff...
#end if