Merge pull request #10 from Telzio/feature-new-ami-events

Added new Asterisk Events to AMI Manager (AttendedTransfer, BlindTransfer, BridgeEnter, BridgeLeave, BridgeCreate and BridgeDestroy).
This commit is contained in:
Ben Merrills 2015-03-17 16:30:21 +00:00
commit 2010cc85e0
11 changed files with 520 additions and 0 deletions

199
.gitignore vendored Normal file
View file

@ -0,0 +1,199 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
build/
bld/
[Bb]in/
[Oo]bj/
# Visual Studo 2015 cache/options directory
.vs/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
#NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile
# Visual Studio profiler
*.psess
*.vsp
*.vspx
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding addin-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
_NCrunch_*
.*crunch*.local.xml
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# Windows Azure Build Output
csx/
*.build.csdef
# Windows Store app package directory
AppPackages/
# Others
*.[Cc]ache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
#Merge Crap
*.orig

View file

@ -201,6 +201,13 @@
<Compile Include="Manager\AsteriskVersion.cs" /> <Compile Include="Manager\AsteriskVersion.cs" />
<Compile Include="Manager\Event\AbstractAgentVariables.cs" /> <Compile Include="Manager\Event\AbstractAgentVariables.cs" />
<Compile Include="Manager\Event\AbstractConfbridgeEvent.cs" /> <Compile Include="Manager\Event\AbstractConfbridgeEvent.cs" />
<Compile Include="Manager\Event\BlindTransferEvent.cs" />
<Compile Include="Manager\Event\BridgeActivityEvent.cs" />
<Compile Include="Manager\Event\BridgeCreateEvent.cs" />
<Compile Include="Manager\Event\BridgeDestroyEvent.cs" />
<Compile Include="Manager\Event\BridgeStateEvent.cs" />
<Compile Include="Manager\Event\BridgeEnterEvent.cs" />
<Compile Include="Manager\Event\BridgeLeaveEvent.cs" />
<Compile Include="Manager\Event\ConfbridgeEndEvent.cs" /> <Compile Include="Manager\Event\ConfbridgeEndEvent.cs" />
<Compile Include="Manager\Event\ConfbridgeJoinEvent.cs" /> <Compile Include="Manager\Event\ConfbridgeJoinEvent.cs" />
<Compile Include="Manager\Event\ConfbridgeLeaveEvent.cs" /> <Compile Include="Manager\Event\ConfbridgeLeaveEvent.cs" />
@ -237,6 +244,7 @@
<Compile Include="Manager\Event\RTCPReceivedEvent.cs" /> <Compile Include="Manager\Event\RTCPReceivedEvent.cs" />
<Compile Include="Manager\Event\RTPSenderStatEvent.cs" /> <Compile Include="Manager\Event\RTPSenderStatEvent.cs" />
<Compile Include="Manager\Event\ShowDialPlanCompleteEvent.cs" /> <Compile Include="Manager\Event\ShowDialPlanCompleteEvent.cs" />
<Compile Include="Manager\Event\AttendedTransferEvent.cs" />
<Compile Include="Manager\Event\TransferEvent.cs" /> <Compile Include="Manager\Event\TransferEvent.cs" />
<Compile Include="Manager\Event\UnknownEvent.cs" /> <Compile Include="Manager\Event\UnknownEvent.cs" />
<Compile Include="Manager\Event\VarSet.cs" /> <Compile Include="Manager\Event\VarSet.cs" />

View file

@ -0,0 +1,88 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace AsterNET.Manager.Event
{
public class AttendedTransferEvent : ManagerEvent
{
public bool Result { get; set; }
public string OrigTransfererChannel { get; set; }
public string OrigTransfererChannelState { get; set; }
public string OrigTransfererChannelStatedesc { get; set; }
public string OrigTransfererCalleridNum { get; set; }
public string OrigTransfererCalleridName { get; set; }
public string OrigTransfererConnectedLineNum { get; set; }
public string OrigTransfererConnectedLineName { get; set; }
public string OrigTransfererLanguage { get; set; }
public string OrigTransfererAccountCode { get; set; }
public string OrigTransfererContext { get; set; }
public string OrigTransfererPriority { get; set; }
public string OrigTransfererUniqueId { get; set; }
public string OrigBridgeUniqueId { get; set; }
public string OrigBridgeType { get; set; }
public string OrigBridgetechnology { get; set; }
public string OrigBridgeCreator { get; set; }
public string OrigBridgeName { get; set; }
public string OrigBridgeNumChannels { get; set; }
public string SecondTransfererChannel { get; set; }
public string SecondTransfererChannelState { get; set; }
public string SecondTransfererChannelStatedesc { get; set; }
public string SecondTransfererCalleridNum { get; set; }
public string SecondTransfererCalleridName { get; set; }
public string SecondTransfererConnectedLineNum { get; set; }
public string SecondTransfererConnectedLineName { get; set; }
public string SecondTransfererLanguage { get; set; }
public string SecondTransfererAccountCode { get; set; }
public string SecondTransfererContext { get; set; }
public string SecondTransfererExten { get; set; }
public string SecondTransfererPriority { get; set; }
public string SecondTransfererUniqueId { get; set; }
public string SecondBridgeUniqueId { get; set; }
public string SecondBridgeType { get; set; }
public string SecondBridgeTechnology { get; set; }
public string SecondBridgeCreator { get; set; }
public string SecondBridgeName { get; set; }
public string SecondBridgeNumChannels { get; set; }
public string TransfereeChannel { get; set; }
public string TransfereeChannelState { get; set; }
public string TransfereeChannelStatedesc { get; set; }
public string TransfereeCalleridNum { get; set; }
public string TransfereeCalleridName { get; set; }
public string TransfereeConnectedLineNum { get; set; }
public string TransfereeConnectedLineName { get; set; }
public string TransfereeLanguage { get; set; }
public string TransfereeAccountCode { get; set; }
public string TransfereeContext { get; set; }
public string TransfereeExten { get; set; }
public string TransfereePriority { get; set; }
public string TransfereeUniqueId { get; set; }
public string TransferTargetChannel { get; set; }
public string TransferTargetChannelState { get; set; }
public string TransferTargetChannelStatedesc { get; set; }
public string TransferTargetCalleridNum { get; set; }
public string TransferTargetCalleridName { get; set; }
public string TransferTargetConnectedLineNum { get; set; }
public string TransferTargetConnectedLineName { get; set; }
public string TransferTargetLanguage { get; set; }
public string TransferTargetAccountCode { get; set; }
public string TransferTargetContext { get; set; }
public string TransferTargetPriority { get; set; }
public string TransferTargetUniqueId { get; set; }
public bool IsExternal { get; set; }
public string DestType { get; set; }
public string DestBridgeUniqueId { get; set; }
#region Constructor - AttendedTransferEvent(ManagerConnection source)
public AttendedTransferEvent(ManagerConnection source)
: base(source)
{
}
#endregion
}
}

View file

@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace AsterNET.Manager.Event
{
public class BlindTransferEvent : ManagerEvent
{
public bool Result { get; set; }
public string TransfererChannel { get; set; }
public string TransfererChannelState { get; set; }
public string TransfererChannelStatedesc { get; set; }
public string TransfererCallerIdNum { get; set; }
public string TransfererCallerIdName { get; set; }
public string TransfererConnectedLineNum { get; set; }
public string TransfererConnectedLineName { get; set; }
public string TransfererLanguage { get; set; }
public string TransfererAccountCode { get; set; }
public string TransfererContext { get; set; }
public string TransfererPriority { get; set; }
public string TransfererUniqueId { get; set; }
public string TransfereeChannel { get; set; }
public string TransfereeChannelState { get; set; }
public string TransfereeChannelStateDesc { get; set; }
public string TransfereeCallerIdNum { get; set; }
public string TransfereeCallerIdName { get; set; }
public string TransfereeConnectedLineNum { get; set; }
public string TransfereeConnectedLineName { get; set; }
public string TransfereeLanguage { get; set; }
public string TransfereeAccountCode { get; set; }
public string TransfereeContext { get; set; }
public string TransfereeExten { get; set; }
public string TransfereePriority { get; set; }
public string TransfereeUniqueId { get; set; }
public string BridgeUniqueId { get; set; }
public string BridgeType { get; set; }
public string BridgeTechnology { get; set; }
public string BridgeCreator { get; set; }
public string BridgeName { get; set; }
public string BridgeNumChannels { get; set; }
public string IsExternal { get; set; }
public string Context { get; set; }
public string Extension { get; set; }
#region Constructor - BlindTransferEvent(ManagerConnection source)
public BlindTransferEvent(ManagerConnection source) : base(source)
{
}
#endregion
}
}

View file

@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
namespace AsterNET.Manager.Event
{
/// <summary>
/// </summary>
public abstract class BridgeActivityEvent : ManagerEvent
{
public string BridgeUniqueId { get; set; }
public string BridgeType { get; set; }
public string BridgeTechnology { get; set; }
public string BridgeCreator { get; set; }
public string BridgeName { get; set; }
public string BridgeNumChannels { get; set; }
public string ChannelState { get; set; }
public string ChannelStatedDesc { get; set; }
public string CallerIdNum { get; set; }
public string CallerIdName { get; set; }
public string ConnectedLineNum { get; set; }
public string ConnectedLineName { get; set; }
public string Language { get; set; }
public string AccountCode { get; set; }
public string Context { get; set; }
public string Exten { get; set; }
public string Priority { get; set; }
#region Constructors
protected BridgeActivityEvent(ManagerConnection source)
: base(source)
{
}
#endregion
}
}

View file

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace AsterNET.Manager.Event
{
public class BridgeCreateEvent : BridgeStateEvent
{
public BridgeCreateEvent(ManagerConnection source) : base(source)
{
}
}
}

View file

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace AsterNET.Manager.Event
{
public class BridgeDestroyEvent : BridgeStateEvent
{
public BridgeDestroyEvent(ManagerConnection source) : base(source)
{
}
}
}

View file

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace AsterNET.Manager.Event
{
public class BridgeEnterEvent : BridgeActivityEvent
{
public BridgeEnterEvent(ManagerConnection source) : base(source)
{
}
}
}

View file

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace AsterNET.Manager.Event
{
public class BridgeLeaveEvent : BridgeActivityEvent
{
public BridgeLeaveEvent(ManagerConnection source) : base(source)
{
}
}
}

View file

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
namespace AsterNET.Manager.Event
{
/// <summary>
/// </summary>
public abstract class BridgeStateEvent : ManagerEvent
{
public string BridgeUniqueId { get; set; }
public string BridgeType { get; set; }
public string BridgeTechnology { get; set; }
public string BridgeCreator { get; set; }
public string BridgeName { get; set; }
public int BridgeNumChannels { get; set; }
#region Constructors
protected BridgeStateEvent(ManagerConnection source)
: base(source)
{
}
#endregion
}
}

View file

@ -89,6 +89,14 @@ namespace AsterNET.Manager
public delegate void ConfbridgeEndEventHandler(object sender, Event.ConfbridgeEndEvent e); public delegate void ConfbridgeEndEventHandler(object sender, Event.ConfbridgeEndEvent e);
public delegate void ConfbridgeTalkingEventHandler(object sender, Event.ConfbridgeTalkingEvent e); public delegate void ConfbridgeTalkingEventHandler(object sender, Event.ConfbridgeTalkingEvent e);
public delegate void FailedACLEventHandler(object sender, Event.FailedACLEvent e); public delegate void FailedACLEventHandler(object sender, Event.FailedACLEvent e);
public delegate void AttendedTransferEventHandler(object sender, Event.AttendedTransferEvent e);
public delegate void BlindTransferEventHandler(object sender, Event.BlindTransferEvent e);
public delegate void BridgeCreateEventHandler(object sender, Event.BridgeCreateEvent e);
public delegate void BridgeDestroyEventHandler(object sender, Event.BridgeDestroyEvent e);
public delegate void BridgeEnterEventHandler(object sender, Event.BridgeEnterEvent e);
public delegate void BridgeLeaveEventHandler(object sender, Event.BridgeLeaveEvent e);
#endregion #endregion
@ -468,6 +476,14 @@ namespace AsterNET.Manager
/// </summary> /// </summary>
public event FailedACLEventHandler FailedACL; public event FailedACLEventHandler FailedACL;
public event AttendedTransferEventHandler AttendedTransfer;
public event BlindTransferEventHandler BlindTransfer;
public event BridgeCreateEventHandler BridgeCreate;
public event BridgeDestroyEventHandler BridgeDestroy;
public event BridgeEnterEventHandler BridgeEnter;
public event BridgeLeaveEventHandler BridgeLeave;
#endregion #endregion
#region Constructor - ManagerConnection() #region Constructor - ManagerConnection()
@ -571,6 +587,13 @@ namespace AsterNET.Manager
Helper.RegisterEventHandler(registeredEventHandlers, 86, typeof(FailedACLEvent)); Helper.RegisterEventHandler(registeredEventHandlers, 86, typeof(FailedACLEvent));
Helper.RegisterEventHandler(registeredEventHandlers, 87, typeof(AttendedTransferEvent));
Helper.RegisterEventHandler(registeredEventHandlers, 88, typeof(BridgeCreateEvent));
Helper.RegisterEventHandler(registeredEventHandlers, 89, typeof(BridgeDestroyEvent));
Helper.RegisterEventHandler(registeredEventHandlers, 90, typeof(BridgeEnterEvent));
Helper.RegisterEventHandler(registeredEventHandlers, 91, typeof(BridgeLeaveEvent));
Helper.RegisterEventHandler(registeredEventHandlers, 92, typeof(BlindTransferEvent));
#endregion #endregion
@ -1152,6 +1175,42 @@ namespace AsterNET.Manager
{ {
FailedACL(this, (FailedACLEvent)e); FailedACL(this, (FailedACLEvent)e);
} }
break;
case 87:
if (AttendedTransfer != null)
{
AttendedTransfer(this, (AttendedTransferEvent) e);
}
break;
case 88:
if (BridgeCreate != null)
{
BridgeCreate(this, (BridgeCreateEvent) e);
}
break;
case 89:
if (BridgeDestroy != null)
{
BridgeDestroy(this, (BridgeDestroyEvent)e);
}
break;
case 90:
if (BridgeEnter != null)
{
BridgeEnter(this, (BridgeEnterEvent)e);
}
break;
case 91:
if (BridgeLeave != null)
{
BridgeLeave(this, (BridgeLeaveEvent)e);
}
break;
case 92:
if (BlindTransfer != null)
{
BlindTransfer(this, (BlindTransferEvent)e);
}
break; break;
default: default:
if (UnhandledEvent != null) if (UnhandledEvent != null)