Asterisk AMI Events: Incoming Call for CRM


Im currently working on a CRM features called Incoming call popup display using Asterisk Manager Interface AMI which contains the callers information in case the number exists to our database but my problem is I don’t know the Events of Incoming Call.

I need to find out the name for the following events:

  1. Incoming call

  2. When someone pickup/answer the call

  3. When user or agent end the call

Or are there any documentations showing the incoming call process which indicate the events name?

I tried to log the events and it gives me a tons of information so Im just hoping someone may help me.




You might be interested to see the states

CONNECT event will help with your CTI thing.

Thanks for your response.

Already read the AMI events but I cannot connect the right sequence of events being triggered.

For example:
Incoming call then someone answer the call, then call is being transferred and the call has been end.

If of this accion generate a different and unique events

Most people wanting to do this simply look at the event they actually receive to work out what they need to look for. Most of the information an probably be obtained from newchannel and newstate events, with the values for the latter being as listed at:

However, you may have to take account of dialplan execution, specific to your dialplan, as well.

Remember that Asterisk is a toolkit, so the high level events you list don’t exist in Asterisk, and you need to look at lower level events and their context.


First of all, I would like to say thank you for all of your response.

I analyzed the incoming call events and this is what I got so far and made the Call popup feature work.

//Newchannel and State is ringing
if($event->getName() == “Newchannel” && ChannelState == 4){
//Connected to Trunkline

//Caller has been registered
if($event->getName() == “NewCallerid” && ChannelState == 4){
//Send data to CRM to show popup call window

//User pickup the call
if($event->getName() == “UserEvent” && ChannelState == 6){
//Send data to CRM to hide popup call window but not the user who answered the call




Yeastar Support gave me this link to check.

Its an API. Hope others can help this link



The key to the channel state numbers is in the below (you will have to do a bit of counting; the first is either 0 or 1).

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