Asterisk AMI - pickup call

我的梦境 提交于 2019-11-29 11:54:29

You can't answer a call directly via AMI. This is because a new call will "arrive" at the given context/priority/extension configured in the dialplan (or it will be rejected if cant find one that applies). So whatever happens with that call will start at the given context/priority/extension in the dialplan.

If you want to handle calls via AMI, try using asynchronous AGI, like this:

exten => _X.,1,AGI(agi:async)

This will handle all calls to any extension that has at least 1 digit, by issuing an event (AsyncAGI) that you can handle with your AMI client.

Then, from your AMI client, you can send AGIAction's, like:

Action: AGI
Channel: SIP/adevice
Command: ANSWER
CommandID: MyCommandID

This will effectively allow you to run AGI commands (and handle a call like you would normally do in any AGI script) from your AMI client.

Hope it helps!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!