From c8d725c717a8b7d7dfae4f4357c2e9f45f7a0cec Mon Sep 17 00:00:00 2001 From: Amyn Virani Date: Thu, 16 Jan 2020 16:27:27 -0500 Subject: [PATCH] 1. Pass unavailable reason when creating QueuePauseAction 2. QueueMember JoinEvent provides CallerIdNum instead of CallerId 3. QueueMemberEvent now retrieves paused reason 4. Added ConfbridgeMuteEvent and ConfbridgeUnmuteEvent classes so they can be triggered --- .../Manager/Action/QueuePauseAction.cs | 4 +++- .../Manager/Event/ConfbridgeMuteEvent.cs | 16 ++++++++++++++++ .../Manager/Event/ConfbridgeUnmuteEvent.cs | 16 ++++++++++++++++ .../Asterisk.NET/Manager/Event/JoinEvent.cs | 2 +- .../Manager/Event/QueueMemberEvent.cs | 9 +++++++++ 5 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 Asterisk.2013/Asterisk.NET/Manager/Event/ConfbridgeMuteEvent.cs create mode 100644 Asterisk.2013/Asterisk.NET/Manager/Event/ConfbridgeUnmuteEvent.cs diff --git a/Asterisk.2013/Asterisk.NET/Manager/Action/QueuePauseAction.cs b/Asterisk.2013/Asterisk.NET/Manager/Action/QueuePauseAction.cs index d462928..ff4f5dd 100644 --- a/Asterisk.2013/Asterisk.NET/Manager/Action/QueuePauseAction.cs +++ b/Asterisk.2013/Asterisk.NET/Manager/Action/QueuePauseAction.cs @@ -56,11 +56,13 @@ namespace AsterNET.Manager.Action /// the interface of the member to make unavailable /// the queue the member is made unvailable on /// true to make the member unavailbale, false to make the member available - public QueuePauseAction(string iface, string queue, bool paused) + /// the reason for paused when the member is made unavailable + public QueuePauseAction(string iface, string queue, bool paused, string reason = null) { this.Interface = iface; this.Queue = queue; this.Paused = paused; + this.Reason = reason; } /// diff --git a/Asterisk.2013/Asterisk.NET/Manager/Event/ConfbridgeMuteEvent.cs b/Asterisk.2013/Asterisk.NET/Manager/Event/ConfbridgeMuteEvent.cs new file mode 100644 index 0000000..8f52b7e --- /dev/null +++ b/Asterisk.2013/Asterisk.NET/Manager/Event/ConfbridgeMuteEvent.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace AsterNET.Manager.Event +{ + public class ConfbridgeMuteEvent : AbstractConfbridgeEvent + { + public ConfbridgeMuteEvent(ManagerConnection source) + : base(source) + { + } + } +} diff --git a/Asterisk.2013/Asterisk.NET/Manager/Event/ConfbridgeUnmuteEvent.cs b/Asterisk.2013/Asterisk.NET/Manager/Event/ConfbridgeUnmuteEvent.cs new file mode 100644 index 0000000..f2fddf9 --- /dev/null +++ b/Asterisk.2013/Asterisk.NET/Manager/Event/ConfbridgeUnmuteEvent.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace AsterNET.Manager.Event +{ + public class ConfbridgeUnmuteEvent : AbstractConfbridgeEvent + { + public ConfbridgeUnmuteEvent(ManagerConnection source) + : base(source) + { + } + } +} diff --git a/Asterisk.2013/Asterisk.NET/Manager/Event/JoinEvent.cs b/Asterisk.2013/Asterisk.NET/Manager/Event/JoinEvent.cs index b1b22f1..d9bc900 100644 --- a/Asterisk.2013/Asterisk.NET/Manager/Event/JoinEvent.cs +++ b/Asterisk.2013/Asterisk.NET/Manager/Event/JoinEvent.cs @@ -15,7 +15,7 @@ namespace AsterNET.Manager.Event /// Get/Set the Caller*ID number of the channel that joined the queue if set. /// If the channel has no caller id set "unknown" is returned. /// - public string CallerId { get; set; } + public string CallerIdNum { get; set; } /// /// Get/Set the Caller*ID name of the channel that joined the queue if set. diff --git a/Asterisk.2013/Asterisk.NET/Manager/Event/QueueMemberEvent.cs b/Asterisk.2013/Asterisk.NET/Manager/Event/QueueMemberEvent.cs index 4fd05a8..9943041 100644 --- a/Asterisk.2013/Asterisk.NET/Manager/Event/QueueMemberEvent.cs +++ b/Asterisk.2013/Asterisk.NET/Manager/Event/QueueMemberEvent.cs @@ -18,6 +18,7 @@ namespace AsterNET.Manager.Event private bool paused; private string name; private bool incall; + private string pausedReason; /// /// Get/Set the name of the queue member. @@ -135,6 +136,14 @@ namespace AsterNET.Manager.Event get { return this.incall; } set { this.incall = value; } } + /// + /// Paused reason if the queue member is paused + /// + public string PausedReason + { + get { return this.pausedReason; } + set { this.pausedReason = value; } + } public QueueMemberEvent(ManagerConnection source) : base(source)