Reise events

Apr 21, 2014 at 8:06 AM

I am very new in AsterNet, and am trying to rise events that I am registered to, but have no success, because, I think, of not having an agent logged in.

I make a connection
SetConnection("***", ***, "***", "***");


 static void RegisterToEvents()
            Connection.AgentCalled += testConnection_AgentCalled;
            Connection.UnhandledEvent += testConnection_UnhandledEvent;
            Connection.AgentComplete += testConnection_AgentComplete;
            Connection.AgentConnect += Connection_AgentConnect;
            Connection.AgentLogin += Connection_AgentLogin;
            Connection.AgentLogoff += Connection_AgentLogoff;
            Connection.Dial += Connection_Dial;
            Connection.Hangup += Connection_Hangup;
            Connection.AgentDump += Connection_AgentDump;
I connect successfully, but none of events is raised when i receive a call.
Can anyone guide me?
Apr 21, 2014 at 1:34 PM
Try this,
manager.PeerStatus += new PeerStatusEventHandler(manager_Events);

void manager_Events(object sender, EventArgs e)
                Debug.WriteLine("Event : " + e.GetType().Name);
Apr 21, 2014 at 8:01 PM
Also, be sure you have agent events turned on in Asterisk!

Apr 22, 2014 at 6:09 AM
Could you please post a sample?
Apr 22, 2014 at 10:22 AM
The AstTray project, while not very complete, serves as a good example of using AMI to pickup call events.

See the 'public AstTray()' method for details on setting up the AMI connection, and attaching to events.
Marked as answer by megibyan on 4/22/2014 at 5:11 AM
Apr 22, 2014 at 10:24 AM
Also, have you setup your manager account correctly? You should maybe read the guide on manager.conf also.

It sounds very much like the issues you are having are more Asterisk related than AsterNET and may well be down to the fact the manager account you're using isn't subscribed to the class of events you're trying to catch from AsterNET.


Hope this helps!