Skip to content

None of Asterisk Events are triggering after I receive Call #290

Description

@snippylab

Hey,

My code can successfully connect to Asterisk.

It can add queues, remove queues, pause queues and can perform Hangup on Asterisk

But I can't get any event response back to my code.
I am registering Hangup and Bridge events but they are not getting triggered when call is answered or Hangup is clicked on SIP phone

I have enabled settings in manager.conf
read = all,
write = all

Below is my code

public PbxActionResponse Connect()
 {
     try
     {
         ManagerConnection _amiConnection = new ManagerConnection(serverIp
                                                port,
                                                username
                                                password);

         _amiConnection.KeepAlive = true;
         _amiConnection.PingInterval = 1000;
         _amiConnection.Hangup += AmiConnection_Hangup;
         _amiConnection.Bridge += AmiConnection_Bridge;            
         _amiConnection.Login();

         return new(true, "Connected to Asterisk");
     }
     catch (Exception ex)
     {
         return new(false, ex.ToExceptionMessage(), ex.ToExceptionMessage());
     }
 }

private void AmiConnection_Bridge(object sender, BridgeEvent e)
{
    Log($"Bridge Event: {e.CallerId1} - Channel: {e.Channel}");
}
private void AmiConnection_Hangup(object sender, HangupEvent e)
{
    Log($"Hangup Event: {e.CallerId} - Channel: {e.Channel}");
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions