diff --git a/Asterisk.2013/Asterisk.NET/Manager/Action/AOCMessageAction.cs b/Asterisk.2013/Asterisk.NET/Manager/Action/AOCMessageAction.cs
new file mode 100644
index 0000000..547153d
--- /dev/null
+++ b/Asterisk.2013/Asterisk.NET/Manager/Action/AOCMessageAction.cs
@@ -0,0 +1,157 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace AsterNET.Manager.Action
+{
+ public class AOCMessageAction : ManagerAction
+ {
+
+ private string _channel;
+ private string _channelPrefix;
+ private string _msgType;
+ private string _chargeType;
+ private int _unitAmount;
+ private int _unitType;
+ private string _currencyName;
+ private string _currencyAmount;
+ private string _currencyMultiplier;
+ private string _totalType;
+ private string _aocBillingId;
+ private string _chargingAssociationId;
+ private string _chargingAssociationNumber;
+ private string _chargingrAssociationPlan;
+
+ ///
+ /// Generate an Advice of Charge message on a channel.
+ ///
+ public AOCMessageAction()
+ {
+ }
+
+ ///
+ /// Generate an Advice of Charge message on a channel.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public AOCMessageAction(string channel, string channelPrefix, string msgType, string chargeType, int unitAmount, int unitType, string currencyName, string currencyAmount, string currencyMultiplier, string totalType, string aocBillingId, string chargingAssociationId, string chargingAssociationNumber, string chargingrAssociationPlan)
+ {
+ _channel = channel;
+ _channelPrefix = channelPrefix;
+ _msgType = msgType;
+ _chargeType = chargeType;
+ _unitAmount = unitAmount;
+ _unitType = unitType;
+ _currencyName = currencyName;
+ _currencyAmount = currencyAmount;
+ _currencyMultiplier = currencyMultiplier;
+ _totalType = totalType;
+ _aocBillingId = aocBillingId;
+ _chargingAssociationId = chargingAssociationId;
+ _chargingAssociationNumber = chargingAssociationNumber;
+ _chargingrAssociationPlan = chargingrAssociationPlan;
+ }
+
+ public override string Action
+ {
+ get { return "AOCMessage"; }
+ }
+
+ public string Channel
+ {
+ get { return _channel; }
+ set { _channel = value; }
+ }
+
+ public string ChannelPrefix
+ {
+ get { return _channelPrefix; }
+ set { _channelPrefix = value; }
+ }
+
+ public string MsgType
+ {
+ get { return _msgType; }
+ set { _msgType = value; }
+ }
+
+ public string ChargeType
+ {
+ get { return _chargeType; }
+ set { _chargeType = value; }
+ }
+
+ public int UnitAmount
+ {
+ get { return _unitAmount; }
+ set { _unitAmount = value; }
+ }
+
+ public int UnitType
+ {
+ get { return _unitType; }
+ set { _unitType = value; }
+ }
+
+ public string CurrencyName
+ {
+ get { return _currencyName; }
+ set { _currencyName = value; }
+ }
+
+ public string CurrencyAmount
+ {
+ get { return _currencyAmount; }
+ set { _currencyAmount = value; }
+ }
+
+ public string CurrencyMultiplier
+ {
+ get { return _currencyMultiplier; }
+ set { _currencyMultiplier = value; }
+ }
+
+ public string TotalType
+ {
+ get { return _totalType; }
+ set { _totalType = value; }
+ }
+
+ public string AocBillingId
+ {
+ get { return _aocBillingId; }
+ set { _aocBillingId = value; }
+ }
+
+ public string ChargingAssociationId
+ {
+ get { return _chargingAssociationId; }
+ set { _chargingAssociationId = value; }
+ }
+
+ public string ChargingAssociationNumber
+ {
+ get { return _chargingAssociationNumber; }
+ set { _chargingAssociationNumber = value; }
+ }
+
+ public string ChargingrAssociationPlan
+ {
+ get { return _chargingrAssociationPlan; }
+ set { _chargingrAssociationPlan = value; }
+ }
+ }
+}
diff --git a/Asterisk.2013/Asterisk.NET/Manager/Action/CoreSettingsAction.cs b/Asterisk.2013/Asterisk.NET/Manager/Action/CoreSettingsAction.cs
new file mode 100644
index 0000000..01a5bf2
--- /dev/null
+++ b/Asterisk.2013/Asterisk.NET/Manager/Action/CoreSettingsAction.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace AsterNET.Manager.Action
+{
+ public class CoreSettingsAction : ManagerAction
+ {
+ ///
+ /// Show PBX core settings (version etc).
+ ///
+ public CoreSettingsAction()
+ {
+ }
+
+ public override string Action
+ {
+ get { return "CoreSettings"; }
+ }
+ }
+}
diff --git a/Asterisk.2013/Asterisk.NET/Manager/Action/CoreShowChannelsAction.cs b/Asterisk.2013/Asterisk.NET/Manager/Action/CoreShowChannelsAction.cs
new file mode 100644
index 0000000..17460df
--- /dev/null
+++ b/Asterisk.2013/Asterisk.NET/Manager/Action/CoreShowChannelsAction.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace AsterNET.Manager.Action
+{
+ public class CoreShowChannelsAction : ManagerAction
+ {
+ ///
+ /// List currently defined channels and some information about them.
+ ///
+ public CoreShowChannelsAction()
+ {
+ }
+
+ public override string Action
+ {
+ get { return "CoreShowChannels"; }
+ }
+ }
+}
diff --git a/Asterisk.2013/Asterisk.NET/Manager/Action/CoreStatusAction.cs b/Asterisk.2013/Asterisk.NET/Manager/Action/CoreStatusAction.cs
new file mode 100644
index 0000000..de9d2e7
--- /dev/null
+++ b/Asterisk.2013/Asterisk.NET/Manager/Action/CoreStatusAction.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace AsterNET.Manager.Action
+{
+ public class CoreStatusAction : ManagerAction
+ {
+ ///
+ /// Show PBX core status variables. Query for Core PBX status.
+ ///
+ public CoreStatusAction()
+ {
+ }
+
+ public override string Action
+ {
+ get { return "CoreStatus"; }
+ }
+ }
+}
diff --git a/Asterisk.2013/Asterisk.NET/Manager/Action/CreateConfigAction.cs b/Asterisk.2013/Asterisk.NET/Manager/Action/CreateConfigAction.cs
new file mode 100644
index 0000000..b24b591
--- /dev/null
+++ b/Asterisk.2013/Asterisk.NET/Manager/Action/CreateConfigAction.cs
@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace AsterNET.Manager.Action
+{
+ public class CreateConfigAction : ManagerAction
+ {
+
+ private string _filename;
+
+ ///
+ /// Creates an empty file in the configuration directory.
+ /// This action will create an empty file in the configuration directory. This action is intended to be used before an UpdateConfig action.
+ ///
+ public CreateConfigAction()
+ {
+ }
+
+ ///
+ /// Creates an empty file in the configuration directory.
+ /// This action will create an empty file in the configuration directory. This action is intended to be used before an UpdateConfig action.
+ ///
+ ///
+ public CreateConfigAction(string filename)
+ {
+ _filename = filename;
+ }
+
+ public override string Action
+ {
+ get { return "CreateConfig"; }
+ }
+
+ public string Filename
+ {
+ get { return _filename; }
+ set { _filename = value; }
+ }
+ }
+}
diff --git a/Asterisk.2013/Asterisk.NET/Manager/Action/UpdateConfigAction.cs b/Asterisk.2013/Asterisk.NET/Manager/Action/UpdateConfigAction.cs
index 831bb52..daf1c65 100644
--- a/Asterisk.2013/Asterisk.NET/Manager/Action/UpdateConfigAction.cs
+++ b/Asterisk.2013/Asterisk.NET/Manager/Action/UpdateConfigAction.cs
@@ -132,22 +132,23 @@ namespace AsterNET.Manager.Action
/// Extra match required to match line
public void AddCommand(string action, string category, string variable, string value, string match)
{
- int i = actionCounter++;
+ var i = actionCounter++;
+ var index = i.ToString().PadLeft(6, '0');
if (!string.IsNullOrEmpty(action))
- actions.Add("Action-" + i, action);
+ actions.Add("Action-" + index, action);
if (!string.IsNullOrEmpty(category))
- actions.Add("Cat-" + i, category);
+ actions.Add("Cat-" + index, category);
if (!string.IsNullOrEmpty(variable))
- actions.Add("Var-" + i, variable);
+ actions.Add("Var-" + index, variable);
if (!string.IsNullOrEmpty(value))
- actions.Add("Value-" + i, value);
+ actions.Add("Value-" + index, value);
if (!string.IsNullOrEmpty(match))
- actions.Add("Match-" + i, match);
+ actions.Add("Match-" + index, match);
}
public void AddCommand(string action, string category, string variable, string value)
diff --git a/Asterisk.2013/Asterisk.NET/Manager/Event/AbstractChannelEvent.cs b/Asterisk.2013/Asterisk.NET/Manager/Event/AbstractChannelEvent.cs
index 7f0101c..72256f8 100644
--- a/Asterisk.2013/Asterisk.NET/Manager/Event/AbstractChannelEvent.cs
+++ b/Asterisk.2013/Asterisk.NET/Manager/Event/AbstractChannelEvent.cs
@@ -12,6 +12,8 @@ namespace AsterNET.Manager.Event
private string callerIdName;
private string accountCode;
private string state;
+ private string connectedLineNum;
+ private string connectedLineName;
///
/// Get/Set Channel State
@@ -83,7 +85,19 @@ namespace AsterNET.Manager.Event
set { this.accountCode = value; }
}
- public AbstractChannelEvent(ManagerConnection source)
+ public string Connectedlinenum
+ {
+ get { return connectedLineNum; }
+ set { connectedLineNum = value; }
+ }
+
+ public string ConnectedLineName
+ {
+ get { return connectedLineName; }
+ set { connectedLineName = value; }
+ }
+
+ public AbstractChannelEvent(ManagerConnection source)
: base(source)
{
}
diff --git a/Asterisk.2013/Asterisk.NET/Manager/Event/AbstractConfbridgeEvent.cs b/Asterisk.2013/Asterisk.NET/Manager/Event/AbstractConfbridgeEvent.cs
index c61dcda..c0bd36b 100644
--- a/Asterisk.2013/Asterisk.NET/Manager/Event/AbstractConfbridgeEvent.cs
+++ b/Asterisk.2013/Asterisk.NET/Manager/Event/AbstractConfbridgeEvent.cs
@@ -13,6 +13,10 @@ namespace AsterNET.Manager.Event
///
public string Conference { get; set; }
+ public AbstractConfbridgeEvent()
+ : base()
+ { }
+
public AbstractConfbridgeEvent(ManagerConnection source)
: base(source)
{
diff --git a/Asterisk.2013/Asterisk.NET/Manager/Event/FailedACLEvent.cs b/Asterisk.2013/Asterisk.NET/Manager/Event/FailedACLEvent.cs
new file mode 100644
index 0000000..3d801ad
--- /dev/null
+++ b/Asterisk.2013/Asterisk.NET/Manager/Event/FailedACLEvent.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace AsterNET.Manager.Event
+{
+ public class FailedACLEvent : ManagerEvent
+ {
+
+ public FailedACLEvent()
+ : base() { }
+
+ public FailedACLEvent(ManagerConnection source)
+ : base(source) { }
+
+ public string LocalAddress { get; set; }
+ public string RemoteAddress { get; set; }
+ public string ACLName { get; set; }
+
+ }
+}
diff --git a/Asterisk.2013/Asterisk.NET/Manager/ManagerConnection.cs b/Asterisk.2013/Asterisk.NET/Manager/ManagerConnection.cs
index f8b7258..b1df8a6 100644
--- a/Asterisk.2013/Asterisk.NET/Manager/ManagerConnection.cs
+++ b/Asterisk.2013/Asterisk.NET/Manager/ManagerConnection.cs
@@ -88,6 +88,7 @@ namespace AsterNET.Manager
public delegate void ConfbridgeLeaveEventHandler(object sender, Event.ConfbridgeLeaveEvent e);
public delegate void ConfbridgeEndEventHandler(object sender, Event.ConfbridgeEndEvent e);
public delegate void ConfbridgeTalkingEventHandler(object sender, Event.ConfbridgeTalkingEvent e);
+ public delegate void FailedACLEventHandler(object sender, Event.FailedACLEvent e);
#endregion
@@ -463,6 +464,11 @@ namespace AsterNET.Manager
///
public event ConfbridgeTalkingEventHandler ConfbridgeTalking;
+ ///
+ ///
+ ///
+ public event FailedACLEventHandler FailedACL;
+
#endregion
#region Constructor - ManagerConnection()
@@ -558,11 +564,13 @@ namespace AsterNET.Manager
Helper.RegisterEventHandler(registeredEventHandlers, 70, typeof(VarSetEvent));
Helper.RegisterEventHandler(registeredEventHandlers, 80, typeof(AGIExecEvent));
- Helper.RegisterEventHandler(registeredEventHandlers, 81, typeof(ConfbridgeStartEventHandler));
- Helper.RegisterEventHandler(registeredEventHandlers, 82, typeof(ConfbridgeJoinEventHandler));
- Helper.RegisterEventHandler(registeredEventHandlers, 83, typeof(ConfbridgeLeaveEventHandler));
- Helper.RegisterEventHandler(registeredEventHandlers, 84, typeof(ConfbridgeEndEventHandler));
- Helper.RegisterEventHandler(registeredEventHandlers, 85, typeof(ConfbridgeTalkingEventHandler));
+ Helper.RegisterEventHandler(registeredEventHandlers, 81, typeof(ConfbridgeStartEvent));
+ Helper.RegisterEventHandler(registeredEventHandlers, 82, typeof(ConfbridgeJoinEvent));
+ Helper.RegisterEventHandler(registeredEventHandlers, 83, typeof(ConfbridgeLeaveEvent));
+ Helper.RegisterEventHandler(registeredEventHandlers, 84, typeof(ConfbridgeEndEvent));
+ Helper.RegisterEventHandler(registeredEventHandlers, 85, typeof(ConfbridgeTalkingEvent));
+
+ Helper.RegisterEventHandler(registeredEventHandlers, 86, typeof(FailedACLEvent));
#endregion
@@ -1151,6 +1159,12 @@ namespace AsterNET.Manager
ConfbridgeTalking(this, (ConfbridgeTalkingEvent)e);
}
break;
+ case 86:
+ if (FailedACL != null)
+ {
+ FailedACL(this, (FailedACLEvent)e);
+ }
+ break;
default:
if (UnhandledEvent != null)
UnhandledEvent(this, e);
diff --git a/Asterisk.2013/ChangeLog.txt b/Asterisk.2013/ChangeLog.txt
index 3eedb50..abe0003 100644
--- a/Asterisk.2013/ChangeLog.txt
+++ b/Asterisk.2013/ChangeLog.txt
@@ -1,3 +1,12 @@
+07.04.2014 (skrusty)
+ Fixed conf events not firing
+ Fixed missing default constructor from AbstractConfbridgeEvent
+ Fixed Issue with UpdateConfig, patched submitted by Shahrooze.
+ Added FailedACL event
+ Added Actions: AOCMessage, CoreSetting, CoreShowChannels, CoreStatus, CreateConfig
+ Added new properties to AbstractChannel, Connectedlinenum and ConnectedLineName (only applies to 1.8 onwards)
+
+
05.03.2014 (skrusty)
Added new constructor (see: https://asternet.codeplex.com/workitem/1163) proposed by nuronce