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}");
}
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