From 803576272115ce3d309100ce21c65182f660ce8f Mon Sep 17 00:00:00 2001 From: Craig Roberts Date: Wed, 29 Aug 2018 19:11:43 -0400 Subject: [PATCH] Add AgentRingNoAnswerEvent --- .../Manager/Event/AgentRingNoAnswerEvent.cs | 86 +++++++++++++++++++ .../Asterisk.NET/Manager/ManagerConnection.cs | 6 ++ 2 files changed, 92 insertions(+) create mode 100644 Asterisk.2013/Asterisk.NET/Manager/Event/AgentRingNoAnswerEvent.cs diff --git a/Asterisk.2013/Asterisk.NET/Manager/Event/AgentRingNoAnswerEvent.cs b/Asterisk.2013/Asterisk.NET/Manager/Event/AgentRingNoAnswerEvent.cs new file mode 100644 index 0000000..efe0b64 --- /dev/null +++ b/Asterisk.2013/Asterisk.NET/Manager/Event/AgentRingNoAnswerEvent.cs @@ -0,0 +1,86 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace AsterNET.Manager.Event +{ + /// + /// Raised when a queue member is notified of a caller in the queue and fails to answer. + /// + /// See https://wiki.asterisk.org/wiki/display/AST/Asterisk+16+ManagerEvent_AgentRingNoAnswer + /// + public class AgentRingNoAnswerEvent : AbstractAgentVariables + { + /// + /// Creates a new using the given . + /// + /// + public AgentRingNoAnswerEvent(ManagerConnection source) + : base(source) + { + } + + + /// + /// Gets or sets the queue. + /// + public string Queue { get; set; } + + /// + /// Gets or sets the name of the agent. + /// + public string AgentName { get; set; } + + /// + /// Gets or sets the agent called. + /// + public string AgentCalled { get; set; } + + /// + /// Gets or sets the channel calling. + /// + public string ChannelCalling { get; set; } + + /// + /// Gets or sets the destination channel. + /// + public string DestinationChannel { get; set; } + + /// + /// Gets or sets the Caller*ID of the calling channel. + /// + public string CallerId { get; set; } + + /// + /// Get/Set the Caller*ID number of the calling channel. + /// + public string CallerIdNum { get; set; } + + /// + /// Get/Set the Caller*ID name of the calling channel. + /// + public string CallerIdName { get; set; } + + /// + /// Gets or sets the context. + /// + public string Context { get; set; } + + /// + /// Gets or sets the extension. + /// + public string Extension { get; set; } + + /// + /// Gets or sets the priority. + /// + public string Priority { get; set; } + + /// + /// Get/Set the amount of time the caller was on ring. + /// + public long RingTime { get; set; } + + } +} diff --git a/Asterisk.2013/Asterisk.NET/Manager/ManagerConnection.cs b/Asterisk.2013/Asterisk.NET/Manager/ManagerConnection.cs index d1fe667..e450fa2 100644 --- a/Asterisk.2013/Asterisk.NET/Manager/ManagerConnection.cs +++ b/Asterisk.2013/Asterisk.NET/Manager/ManagerConnection.cs @@ -120,6 +120,11 @@ namespace AsterNET.Manager /// public event EventHandler AgentLogoff; /// + /// An AgentRingNoAnswer is triggered when an agent was rang and did not answer.
+ /// To enable AgentRingNoAnswer you have to set eventwhencalled = yes in queues.conf.
+ ///
+ public event EventHandler AgentRingNoAnswer; + /// /// An AgentsCompleteEvent is triggered after the state of all agents has been reported in response to an AgentsAction. /// public event EventHandler AgentsComplete; @@ -484,6 +489,7 @@ namespace AsterNET.Manager Helper.RegisterEventHandler(registeredEventHandlers, typeof(AgentDumpEvent), arg => fireEvent(AgentDump, arg)); Helper.RegisterEventHandler(registeredEventHandlers, typeof(AgentLoginEvent), arg => fireEvent(AgentLogin, arg)); Helper.RegisterEventHandler(registeredEventHandlers, typeof(AgentLogoffEvent), arg => fireEvent(AgentLogoff, arg)); + Helper.RegisterEventHandler(registeredEventHandlers, typeof(AgentRingNoAnswerEvent), arg => fireEvent(AgentRingNoAnswer, arg)); Helper.RegisterEventHandler(registeredEventHandlers, typeof(AgentsCompleteEvent), arg => fireEvent(AgentsComplete, arg)); Helper.RegisterEventHandler(registeredEventHandlers, typeof(AgentsEvent), arg => fireEvent(Agents, arg)); Helper.RegisterEventHandler(registeredEventHandlers, typeof(AlarmClearEvent), arg => fireEvent(AlarmClear, arg));