How to detect incoming calls immediately after answering calls using asterisk node ari client. Does asterisk ARI have an event to detect incoming calls or do we have to make a request every few seconds to view channels with answered status?
Yes, ARI have "ARI events" and you can look for "NEW_CHANNEL" event. After that do redirect
However you will need dialplan support anyway, otherwise system will become not supportable in very short time.
You will need not ARI but AMI ( Asterisk Manager Interface ) for that. You don't need to modify the dialplan, just open a socket to the AMI port (default 5038) and listen to the events there. You can find a list will all emitted events on the official documentation .
If you need to check a call after the answer event, then you probably need to listen for the NewState event , having the ChannelStateDesc
property equal to Up
.
If you are using Queues, then it is even easier, as you can just listen for the AgentConnect event.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.