Update ManagerConnection.cs

This commit is contained in:
DaveTTS 2017-05-03 16:00:27 +01:00 committed by GitHub
parent 79225ac04d
commit d85af14814

View file

@ -47,6 +47,7 @@ namespace AsterNET.Manager
public delegate void MeetMeJoinEventHandler(object sender, Event.MeetmeJoinEvent e); public delegate void MeetMeJoinEventHandler(object sender, Event.MeetmeJoinEvent e);
public delegate void MeetMeLeaveEventHandler(object sender, Event.MeetmeLeaveEvent e); public delegate void MeetMeLeaveEventHandler(object sender, Event.MeetmeLeaveEvent e);
public delegate void MeetMeTalkingEventHandler(object sender, Event.MeetmeTalkingEvent e); public delegate void MeetMeTalkingEventHandler(object sender, Event.MeetmeTalkingEvent e);
public delegate void MessageWaitingEventHandler(object sender, Event.MessageWaitingEvent e); public delegate void MessageWaitingEventHandler(object sender, Event.MessageWaitingEvent e);
public delegate void NewCallerIdEventHandler(object sender, Event.NewCallerIdEvent e); public delegate void NewCallerIdEventHandler(object sender, Event.NewCallerIdEvent e);
public delegate void NewChannelEventHandler(object sender, Event.NewChannelEvent e); public delegate void NewChannelEventHandler(object sender, Event.NewChannelEvent e);
@ -100,7 +101,11 @@ namespace AsterNET.Manager
public delegate void QueueCallerJoinEventHandler(object sender, Event.QueueCallerJoinEvent e); public delegate void QueueCallerJoinEventHandler(object sender, Event.QueueCallerJoinEvent e);
public delegate void QueueCallerLeaveEventHandler(object sender, Event.QueueCallerLeaveEvent e); public delegate void QueueCallerLeaveEventHandler(object sender, Event.QueueCallerLeaveEvent e);
public delegate void QueueMemberPauseEventHandler(object sender, Event.QueueMemberPauseEvent e); public delegate void QueueMemberPauseEventHandler(object sender, Event.QueueMemberPauseEvent e);
public delegate void ChallengeResponseFailedEventHandler(object sender, Event.ChallengeResponseFailedEvent e);
public delegate void InvalidAccountIDEventHandler(object sender, Event.InvalidAccountIDEvent e);
public delegate void DeviceStateChangedEventHandler(object sender, Event.DeviceStateChangeEvent e);
public delegate void ChallengeSentEventHandler(object sender, Event.ChallengeSentEvent e);
public delegate void SuccessfulAuthEventHandler(object sender, Event.SuccessfulAuthEvent e);
#endregion #endregion
@ -519,6 +524,31 @@ namespace AsterNET.Manager
/// </summary> /// </summary>
public event QueueMemberPauseEventHandler QueueMemberPause; public event QueueMemberPauseEventHandler QueueMemberPause;
/// <summary>
/// A ChallengeResponseFailed is triggered when a request's attempt to authenticate has been challenged, and the request failed the authentication challenge.
/// </summary>
public event ChallengeResponseFailedEventHandler ChallengeResponseFailed;
/// <summary>
/// A InvalidAccountID is triggered when a request fails an authentication check due to an invalid account ID.
/// </summary>
public event InvalidAccountIDEventHandler InvalidAccountID;
/// <summary>
/// A DeviceStateChanged is triggered when a device state changes.
/// </summary>
public event DeviceStateChangedEventHandler DeviceStateChanged;
/// <summary>
/// A ChallengeSent is triggered when an Asterisk service sends an authentication challenge to a request..
/// </summary>
public event ChallengeSentEventHandler ChallengeSent;
/// <summary>
/// A SuccessfulAuth is triggered when a request successfully authenticates with a service.
/// </summary>
public event SuccessfulAuthEventHandler SuccessfulAuth;
#endregion #endregion
#region Constructor - ManagerConnection() #region Constructor - ManagerConnection()
@ -634,6 +664,12 @@ namespace AsterNET.Manager
Helper.RegisterEventHandler(registeredEventHandlers, 96, typeof(QueueCallerLeaveEvent)); Helper.RegisterEventHandler(registeredEventHandlers, 96, typeof(QueueCallerLeaveEvent));
Helper.RegisterEventHandler(registeredEventHandlers, 97, typeof(QueueMemberPauseEvent)); Helper.RegisterEventHandler(registeredEventHandlers, 97, typeof(QueueMemberPauseEvent));
Helper.RegisterEventHandler(registeredEventHandlers, 98, typeof(ChallengeResponseFailedEvent));
Helper.RegisterEventHandler(registeredEventHandlers, 99, typeof(InvalidAccountIDEvent));
Helper.RegisterEventHandler(registeredEventHandlers, 100, typeof(DeviceStateChangeEvent));
Helper.RegisterEventHandler(registeredEventHandlers, 101, typeof(ChallengeSentEvent));
Helper.RegisterEventHandler(registeredEventHandlers, 102, typeof(SuccessfulAuthEvent));
#endregion #endregion
this.internalEvent += new ManagerEventHandler(internalEventHandler); this.internalEvent += new ManagerEventHandler(internalEventHandler);
@ -1281,6 +1317,41 @@ namespace AsterNET.Manager
QueueMemberPause(this, (QueueMemberPauseEvent)e); QueueMemberPause(this, (QueueMemberPauseEvent)e);
} }
break; break;
case 98:
if (ChallengeResponseFailed != null)
{
ChallengeResponseFailed(this, (ChallengeResponseFailedEvent)e);
return;
}
break;
case 99:
if (InvalidAccountID != null)
{
InvalidAccountID(this, (InvalidAccountIDEvent)e);
return;
}
break;
case 100:
if (DeviceStateChanged != null)
{
DeviceStateChanged(this, (DeviceStateChangeEvent)e);
return;
}
break;
case 101:
if (ChallengeSent != null)
{
ChallengeSent(this, (ChallengeSentEvent)e);
return;
}
break;
case 102:
if (SuccessfulAuth != null)
{
SuccessfulAuth(this, (SuccessfulAuthEvent)e);
return;
}
break;
default: default:
if (UnhandledEvent != null) if (UnhandledEvent != null)
UnhandledEvent(this, e); UnhandledEvent(this, e);