From 697e2890370f27abf63523a003b90a19ccd2472d Mon Sep 17 00:00:00 2001 From: Sandro Pazzi Date: Tue, 6 Feb 2018 23:10:44 +0100 Subject: [PATCH] app_chan_agent modify some agents actions and events --- .../Manager/Action/QueueAddAction.cs | 6 ++ .../Asterisk.NET/Manager/Event/AgentsEvent.cs | 92 ++++++++++++++++++- .../Manager/Event/QueueMemberEvent.cs | 22 ++++- 3 files changed, 111 insertions(+), 9 deletions(-) diff --git a/Asterisk.2013/Asterisk.NET/Manager/Action/QueueAddAction.cs b/Asterisk.2013/Asterisk.NET/Manager/Action/QueueAddAction.cs index c1f2205..a0b87dd 100644 --- a/Asterisk.2013/Asterisk.NET/Manager/Action/QueueAddAction.cs +++ b/Asterisk.2013/Asterisk.NET/Manager/Action/QueueAddAction.cs @@ -94,5 +94,11 @@ namespace AsterNET.Manager.Action /// true if the queue member should be paused when added. /// public bool Paused { get; set; } + + /// + /// Get/Set an alternate interface to be used to determine the state of the member. + /// Available since Asterisk 12. + /// + public string StateInterface { get; set; } } } \ No newline at end of file diff --git a/Asterisk.2013/Asterisk.NET/Manager/Event/AgentsEvent.cs b/Asterisk.2013/Asterisk.NET/Manager/Event/AgentsEvent.cs index 023d5da..297c8d4 100644 --- a/Asterisk.2013/Asterisk.NET/Manager/Event/AgentsEvent.cs +++ b/Asterisk.2013/Asterisk.NET/Manager/Event/AgentsEvent.cs @@ -39,18 +39,102 @@ namespace AsterNET.Manager.Event public string Status { get; set; } /// - /// Get/Set the name of channel this agent logged in from or "n/a" if the agent is not logged in. + /// Get/Set the name of channel this agent logged in from or "n/a" if the agent is not logged in.
+ /// Removed on Asterisk 12 app_agent_pool.so module. Use Channel instead. ///
public string LoggedInChan { get; set; } /// - /// Get/Set the time (in seconds since 01/01/1970) when the agent logged in or 0 if the user is not logged. + /// Get/Set the numerical Caller*ID of the channel this agent is talking toor "n/a" if this agent is talking to nobody.
+ /// Removed on Asterisk 12 app_agent_pool.so module. Use TalkingToChan instead. + ///
+ public string TalkingTo { get; set; } + + /// + /// Get/Set BRIDGEPEER value on agent channel.
+ /// Present if Status value is AGENT_ONCALL. + ///
+ public string TalkingToChan { get; set; } + + /// + /// Get/Set Epoche time when the agent started talking with the caller.
+ /// Present if Status value is AGENT_ONCALL. + ///
+ public string CallStarted { get; set; } + + /// + /// Get/Set the time (in seconds since 01/01/1970).
+ /// Present if Status value is AGENT_IDLE or AGENT_ONCALL. ///
public long LoggedInTime { get; set; } /// - /// Get/Set the numerical Caller*ID of the channel this agent is talking toor "n/a" if this agent is talking to nobody. + /// Get/Set a numeric code for the channel's current state, related to ChannelStateDesc. /// - public string TalkingTo { get; set; } + public int ChannelState { get; set; } + + /// + /// Get/Set a description for the channel's current state.
+ /// This is one of + ///
+ ///
Down
+ ///
Rsrvd
+ ///
OffHook
+ ///
Dialing
+ ///
Ring
+ ///
Ringing
+ ///
Up
+ ///
Busy
+ ///
Dialing Offhook
+ ///
Pre-ring
+ ///
Unknown
+ ///
+ ///
+ public string ChannelStateDesc { get; set; } + + /// + /// Get/Set the callerID number. + /// + public string CallerIDNum { get; set; } + + /// + /// Get/Set the callerID name. + /// + public string CallerIDName { get; set; } + + /// + /// Get/Set the connected line number. + /// + public string ConnectedLineNum { get; set; } + + /// + /// Get/Set the connected line name. + /// + public string ConnectedLineName { get; set; } + + /// + /// Get/Set the account codee. + /// + public string AccountCode { get; set; } + + /// + /// Get/Set the context. + /// + public string Context { get; set; } + + /// + /// Get/Set the extension. + /// + public string Exten { get; set; } + + /// + /// Get/Set the agent priority. + /// + public int Priority { get; set; } + + /// + /// Get/Set the uniqueid of the oldest channel associated with this channel. + /// + public int Linkedid { get; set; } } } \ No newline at end of file diff --git a/Asterisk.2013/Asterisk.NET/Manager/Event/QueueMemberEvent.cs b/Asterisk.2013/Asterisk.NET/Manager/Event/QueueMemberEvent.cs index ccee25b..4fd05a8 100644 --- a/Asterisk.2013/Asterisk.NET/Manager/Event/QueueMemberEvent.cs +++ b/Asterisk.2013/Asterisk.NET/Manager/Event/QueueMemberEvent.cs @@ -17,11 +17,12 @@ namespace AsterNET.Manager.Event private int status; private bool paused; private string name; + private bool incall; - /// - /// Get/Set the name of the queue member. - /// - public string Name + /// + /// Get/Set the name of the queue member. + /// + public string Name { get { return this.name; } set { this.name = value; } @@ -123,8 +124,19 @@ namespace AsterNET.Manager.Event get { return this.paused; } set { this.paused = value; } } + /// + /// Is this queue member in call??
+ /// Available since Asterisk 12.
+ /// true if this member is in call, + /// false if not + ///
+ public bool InCall + { + get { return this.incall; } + set { this.incall = value; } + } - public QueueMemberEvent(ManagerConnection source) + public QueueMemberEvent(ManagerConnection source) : base(source) { }