问题
I have followed the instructions in this thread: Asterisk AMI - pickup call. However, I am still unable to answer calls via AMI. I can make the call to the extension, but corresponding phone for that extension doesn't ring. I can then run the AMI command to answer that call, it does answer, but obviously there isn't any actual response.
Dialplan (testing with extension 116):
exten => 116,1,AGI(agi:async)
Any ideas what I am doing wrong here?
回答1:
Use
exten => 116,1,Answer
exten => 116,2,AGI(agi:async)
or use Answer action via ami.
http://www.voip-info.org/wiki/view/Asterisk+manager+API
You need listen event, when see agi-async event issue Answer on same channel. For example you can do playback command with answer.
Very likly you need start with AGI interface, which is much more simpler for understanding. Not use agi:async, it require understanding of asterisk internals.
回答2:
Found the Answer. For those wanting to answer with API Manager you can use the following -
http://ip-address:port/asterisk/rawman?action=Originate&Channel=Local/(exten you want to answer with)@(context)&Application=Exec&Data=Pickup((exten you want to answer with)@PICKUPMARK)
I am of course using http to send my requests, if you are using something else you will need to change the format.
Or you can use the bridge command. Two channels will be created when you make a call from one extension to the other, bridge those channels and you will have better overall functionality than pickup.
来源:https://stackoverflow.com/questions/25356491/asterisk-ami-agi-not-able-to-answer-call