AMI's AgentConnect event rarely being fired

Hi. I’m developing a .NET application that utilizes AsterNet to register to AMI’s events like NewChannel event, AgentConnect event and HangUp event. Our company’s asterisk guy has set up a dev asterisk server (version 13) , a call queue, and two extensions associated with that queue. When i debug the application, and call the queue, i get the NewChannel event always fired, but when i pick up one of the two extension’s phones i dont always get the AgentConnect event fired, actually most of the times i don’t. The HangUp even is also always fired. can someone elaborate on when AgentConnect event supposed to be fired, or suggest any misconfigurations i must have applied to my environment ? my AsterNet version is version 1.0.0. Thanks in advance.

AgentConnect
Raised when a queue member answers and is bridged to a caller in the queue.

https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+ManagerEvent_AgentConnect

well, but the event isn’t fired when I debug it this way, im calling my queue and picking an agent extension, and only sometimes the event is being fired. i noticed that if i wait several seconds and then pick up the phone then the event is more likely to be fired. maybe the bug is on AsterNet side, ill try to debug it using a simple Telnet client.

1 Like

I just made a test on my development server, and the event is fired immediately the call is answered by an agent in the queue.

0 : Event: AgentConnect
1 : Privilege: agent,all
2 : Channel: PJSIP/6001-00000005
3 : ChannelState: 6
4 : ChannelStateDesc: Up
5 : CallerIDNum: 6001
6 : CallerIDName:
7 : ConnectedLineNum: 102
8 : ConnectedLineName: Ambiorix
9 : AccountCode:
10 : Context: internal
11 : Exten: 200
12 : Priority: 2
13 : Uniqueid: 1457156880.55
14 : DestChannel: SIP/102-0000001b
15 : DestChannelState: 6
16 : DestChannelStateDesc: Up
17 : DestCallerIDNum: 102
18 : DestCallerIDName: Ambiorix
19 : DestConnectedLineNum: 6001
20 : DestConnectedLineName:
21 : DestAccountCode:
22 : DestContext: internal
23 : DestExten: 200
24 : DestPriority: 1
25 : DestUniqueid: 1457156880.56
26 : Interface: SIP/102
27 : Queue: support
28 : HoldTime: 8
29 : MemberName: SIP/102
30 : RingTime: 7

did you use AsterNet as the client to AMI ? what Asterisk version do you use ?

thanks

Asterisk Call Manager/2.5.0

I made my own code base on PHP.

ok thanks for your time, but i dont think we can help each other and isolate the source of my problem if we are using both a different dev platform and asterisk server. i have just posted this issue also on AsterNet’s github issues page.
thanks a lot.

1 Like