Asterisk queue call

I create a queue and add queue memeber interfac sip/2133,when I call to queue, if queue member sip/2133 no answer,after call how can I get the channnel which call sip/2133 from AMI event

When an agent is called because of a call in queue, it is the app_queue application that is placing the call, not the actual call in queue. If the agent answers the call, then the agent leg and the caller leg are bridged together.

I am not sure what you are trying to accomplish, perhaps if you explain what your goal is, there is a way of doing what you want.

I want to get caller info which the queue member had no answer.

It is not clear to me if you are looking to get the information when the member does not answer or after the fact. Since you asked about AMI, I assume that you are referring to at the time of the Ring No Answer.

If that is the case, I know of no easy way to do what you want. The simple reason is the caller is not the call that the member did not answer. The member did not answer a call from the queue application which is unique from the original call. If the member had answered when their phone rang, then the queue application would bridge the call in queue to the call to the member. Therefore, the AMI events for ‘QueueMemberStatus’ does not contain any information about the caller in queue. That and the status updates are not only for calls from the queue application.

If the caller hangs up while in queue (abandon), there is an AMI event ‘QueueCallerAbandon’ which contains the uniqueID of the call which could be, after the fact, cross referenced to a CDR record if you have CDR set to record the uniqueID.

If you have the queue set to autopause the member, you could monitor for ‘QueueMemberPaused’ with a reason of ‘Auto-Pause’. The you could issue a 'queue show ’ command via the AMI and parse the result. If no other member has answered the call and the caller did not abandon between the pause and the queue show, then in theory the first channel in the queue should be the call that did not get serviced by the member. In theory.

Another way would be to monitor all the events in AMI and put together, there is a NewState ‘Ringing’ event which contains the device name which could be a member. If it is, it could be tracked for a ‘bridge’ or a ‘Hangup’ event.

If you do not need to do it in real time and instead can post processes. The queue_log record for the RINGNOANSWER contains the calls ‘calleid’ which can be cross referenced to the CDR record’s ‘uniqueid’.

thany you very much
My Engilish is poor,so you can not unstrand.
example:
the caller channel uniqueid is A,
call queuememeber ,then create member channel,it is uniqueid is B.

if B had not bridge A.

Then how can I get which channel had call B from AMI event?

I think people did understand.

They are saying it can’t be done in real time.

I’m not so sure about that, but I would assume it would have to be done by watching AMI events.

You will probably have to do the detailed research yourself, as it looks like no-one here has ever wanted to do it, so no-one here has done the necessary research.