Reise events

Apr 21, 2014 at 7:06 AM
Hi,

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("***", ***, "***", "***");
RegisterToEvents();
Connection.Login(10);

***

 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 12:34 PM
Try this,
manager.PeerStatus += new PeerStatusEventHandler(manager_Events);

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

See: http://www.voip-info.org/wiki/view/Asterisk+config+queues.conf
Apr 22, 2014 at 5:09 AM
Could you please post a sample?
Coordinator
Apr 22, 2014 at 9: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.

https://asttray.codeplex.com/SourceControl/latest#AstTray/AstTray/FrmMain.cs
Marked as answer by megibyan on 4/22/2014 at 5:11 AM
Coordinator
Apr 22, 2014 at 9:24 AM
Also, have you setup your manager account correctly? You should maybe read the voip-info.org 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.

see: http://www.voip-info.org/wiki/view/Asterisk+config+manager.conf

Hope this helps!