See changelog 07.04.2014 for fixes and additions

This commit is contained in:
skrusty 2014-04-07 11:35:39 +01:00
parent bc48474e0f
commit cc9e6e9547
11 changed files with 341 additions and 12 deletions

View file

@ -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;
/// <summary>
/// Generate an Advice of Charge message on a channel.
/// </summary>
public AOCMessageAction()
{
}
/// <summary>
/// Generate an Advice of Charge message on a channel.
/// </summary>
/// <param name="channel"></param>
/// <param name="channelPrefix"></param>
/// <param name="msgType"></param>
/// <param name="chargeType"></param>
/// <param name="unitAmount"></param>
/// <param name="unitType"></param>
/// <param name="currencyName"></param>
/// <param name="currencyAmount"></param>
/// <param name="currencyMultiplier"></param>
/// <param name="totalType"></param>
/// <param name="aocBillingId"></param>
/// <param name="chargingAssociationId"></param>
/// <param name="chargingAssociationNumber"></param>
/// <param name="chargingrAssociationPlan"></param>
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; }
}
}
}

View file

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace AsterNET.Manager.Action
{
public class CoreSettingsAction : ManagerAction
{
/// <summary>
/// Show PBX core settings (version etc).
/// </summary>
public CoreSettingsAction()
{
}
public override string Action
{
get { return "CoreSettings"; }
}
}
}

View file

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace AsterNET.Manager.Action
{
public class CoreShowChannelsAction : ManagerAction
{
/// <summary>
/// List currently defined channels and some information about them.
/// </summary>
public CoreShowChannelsAction()
{
}
public override string Action
{
get { return "CoreShowChannels"; }
}
}
}

View file

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace AsterNET.Manager.Action
{
public class CoreStatusAction : ManagerAction
{
/// <summary>
/// Show PBX core status variables. Query for Core PBX status.
/// </summary>
public CoreStatusAction()
{
}
public override string Action
{
get { return "CoreStatus"; }
}
}
}

View file

@ -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;
/// <summary>
/// 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.
/// </summary>
public CreateConfigAction()
{
}
/// <summary>
/// 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.
/// </summary>
/// <param name="filename"></param>
public CreateConfigAction(string filename)
{
_filename = filename;
}
public override string Action
{
get { return "CreateConfig"; }
}
public string Filename
{
get { return _filename; }
set { _filename = value; }
}
}
}

View file

@ -132,22 +132,23 @@ namespace AsterNET.Manager.Action
/// <param name="match">Extra match required to match line</param>
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)

View file

@ -12,6 +12,8 @@ namespace AsterNET.Manager.Event
private string callerIdName;
private string accountCode;
private string state;
private string connectedLineNum;
private string connectedLineName;
/// <summary>
/// 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)
{
}

View file

@ -13,6 +13,10 @@ namespace AsterNET.Manager.Event
/// </summary>
public string Conference { get; set; }
public AbstractConfbridgeEvent()
: base()
{ }
public AbstractConfbridgeEvent(ManagerConnection source)
: base(source)
{

View file

@ -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; }
}
}

View file

@ -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
/// </summary>
public event ConfbridgeTalkingEventHandler ConfbridgeTalking;
/// <summary>
///
/// </summary>
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);

View file

@ -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