'Asterisk AMI Event AgentComplete is incomplete
I'm using AMi to connect to my Asterisk box (18.6.0) and capture some events that i need to process. In particular i need to capture two events, when an agent answer a call in a queue, for this i'm using "Event: AgentConnect" which has a lot of inofrmation about the answered call. And i need to capture when the call is Hangup by the agent (or the caller). For this i'm using "Event: AgentComplete". which is something like this:
Event: AgentComplete
Privilege: agent,all
Channel: PJSIP/PROV.ST.02-0000001c
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum: 11223344556
CallerIDName: 11223344556
ConnectedLineNum: 120
ConnectedLineName: Ricardo Martinez
Language: en
AccountCode:
Context: ext-queues
Exten: 755
Priority: 16
Uniqueid: 1647613911.79
Linkedid: 1647613911.79
DestChannel: Local/120@queue-call-to-agents-00000011;1
DestChannelState: 6
DestChannelStateDesc: Up
DestCallerIDNum: 120
DestCallerIDName: Ricardo Martinez
DestConnectedLineNum: 11223344556
DestConnectedLineName: 11223344556
DestLanguage: en
DestAccountCode:
DestContext: queue-call-to-agents
DestExten: 755
DestPriority: 1
DestUniqueid: 1647613911.80
DestLinkedid: 1647613911.79
Queue: Q755
Interface: Local/120@queue-call-to-agents/n
MemberName: 120
HoldTime: 6
TalkTime: 9
Reason: agent
The problem is that for certain calls the event AgenComplete does not have all the information, it does not even has the "Uniqueid" or the "Linkedid"... which is s problem to match the initial call. This is an example :
Event: AgentComplete
Privilege: agent,all
Queue: Q755
Interface: Local/120@queue-call-to-agents/n
MemberName: 120
HoldTime: 8
TalkTime: 37
Reason: agent
So far i was able to reproduce the "problem" consistently by having calls for more than 30 second up. So, for calls under 30 seconds the event "AgentComplete" has all the information, but for calls over 30 seconds the AgentComplete event is missing a lot of info.
What could be happening here?
Thanks for your help!
Solution 1:[1]
EVERY event in asterisk SHOULD have uniqueid field.
If you not see that field, something wrong with your library or program. If you see it, you always can catch info from join event based on uniqueid.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | arheops |