Merge pull request #179 from moldypenguins/DocManager

Add references in summaries to asterisk docs (manager)
This commit is contained in:
Deantwo 2019-10-10 10:17:32 +02:00 committed by GitHub
commit 2428cc1e8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 75 additions and 25 deletions

View file

@ -1,5 +1,8 @@
namespace AsterNET.Manager namespace AsterNET.Manager
{ {
/// <summary>
/// Asterisk Version
/// </summary>
public enum AsteriskVersion public enum AsteriskVersion
{ {
ASTERISK_1_0 = 10, ASTERISK_1_0 = 10,

View file

@ -1,10 +1,10 @@
using System; using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace AsterNET.Manager namespace AsterNET.Manager
{ {
/// <summary>
/// IActionVariable
/// </summary>
interface IActionVariable interface IActionVariable
{ {
Dictionary<string, string> GetVariables(); Dictionary<string, string> GetVariables();

View file

@ -14,7 +14,7 @@ using System.Threading.Tasks;
namespace AsterNET.Manager namespace AsterNET.Manager
{ {
/// <summary> /// <summary>
/// Default implemention of the ManagerConnection interface. /// Default implementation of the ManagerConnection interface.
/// </summary> /// </summary>
public class ManagerConnection public class ManagerConnection
{ {

View file

@ -2,6 +2,11 @@ using System.Collections.Generic;
namespace AsterNET.Manager namespace AsterNET.Manager
{ {
/// <summary>
/// Originates an outbound call and connects it to a specified extension or application.<br/>
/// It will block until the outgoing call fails or gets answered.<br/>
/// At that point, it will exit with the status variable set and dialplan processing will continue.
/// </summary>
public class Originate public class Originate
{ {
private string account; private string account;
@ -18,9 +23,8 @@ namespace AsterNET.Manager
#region Account #region Account
/// <summary> /// <summary>
/// Get/Set the account code to use for the originated call. /// Get/Set the account code to use for the originated call.<br/>
/// The account code is included in the call detail record generated for this /// The account code is included in the call detail record generated for this call and will be used for billing.
/// call and will be used for billing.
/// </summary> /// </summary>
public string Account public string Account
{ {
@ -60,7 +64,7 @@ namespace AsterNET.Manager
#region Context #region Context
/// <summary> /// <summary>
/// Get/Set the name of the context of the extension to connect to. /// Get/Set the name of the context of the extension to connect to.<br/>
/// If you set the context you also have to set the exten and priority properties. /// If you set the context you also have to set the exten and priority properties.
/// </summary> /// </summary>
public string Context public string Context
@ -74,7 +78,7 @@ namespace AsterNET.Manager
#region Exten #region Exten
/// <summary> /// <summary>
/// Get/Set the extension to connect to. /// Get/Set the extension to connect to.<br/>
/// If you set the extension you also have to set the context and priority properties. /// If you set the extension you also have to set the context and priority properties.
/// </summary> /// </summary>
public string Exten public string Exten
@ -88,8 +92,8 @@ namespace AsterNET.Manager
#region Priority #region Priority
/// <summary> /// <summary>
/// Get/Set the priority of the extension to connect to. If you set the priority /// Get/Set the priority of the extension to connect to.<br/>
/// you also have to set the context and exten properties. /// If you set the priority you also have to set the context and exten properties.
/// </summary> /// </summary>
public int Priority public int Priority
{ {
@ -129,8 +133,7 @@ namespace AsterNET.Manager
/// <summary> /// <summary>
/// Get/Set the timeout for the origination (in seconds) for the origination.<br /> /// Get/Set the timeout for the origination (in seconds) for the origination.<br />
/// The channel must be answered within this time, otherwise the origination /// The channel must be answered within this time, otherwise the origination is considered to have failed and an OriginateFailureEvent is generated.<br />
/// is considered to have failed and an OriginateFailureEvent is generated.<br />
/// If not set, a default value of 30 seconds. /// If not set, a default value of 30 seconds.
/// </summary> /// </summary>
public long Timeout public long Timeout

View file

@ -6,7 +6,7 @@ using AsterNET.Manager.Response;
namespace AsterNET.Manager namespace AsterNET.Manager
{ {
/// <summary> /// <summary>
/// A combinded event and response handler that adds received events and the response to a ResponseEvents object. /// A combined event and response handler that adds received events and the response to a ResponseEvents object.
/// </summary> /// </summary>
public class ResponseEventHandler : IResponseHandler public class ResponseEventHandler : IResponseHandler
{ {
@ -17,11 +17,11 @@ namespace AsterNET.Manager
private int hash; private int hash;
/// <summary> /// <summary>
/// Creates a new instance. /// Creates a new instance<see cref="ResponseEventHandler"/>.
/// </summary> /// </summary>
/// <param name="events">the ResponseEvents to store the events in</param> /// <param name="connection"><see cref="ManagerConnection"/></param>
/// <param name="actionCompleteEventClass">the type of event that indicates that all events have been received</param> /// <param name="action"><see cref="ManagerActionEvent"/></param>
/// <param name="thread">the thread to interrupt when the actionCompleteEventClass has been received</param> /// <param name="autoEvent"><see cref="AutoResetEvent"/></param>
public ResponseEventHandler(ManagerConnection connection, ManagerActionEvent action, AutoResetEvent autoEvent) public ResponseEventHandler(ManagerConnection connection, ManagerActionEvent action, AutoResetEvent autoEvent)
{ {
this.connection = connection; this.connection = connection;
@ -30,22 +30,34 @@ namespace AsterNET.Manager
this.autoEvent = autoEvent; this.autoEvent = autoEvent;
} }
/// <summary>
/// Gets the response events.
/// </summary>
public ResponseEvents ResponseEvents public ResponseEvents ResponseEvents
{ {
get { return events; } get { return events; }
} }
/// <summary>
/// Gets the action.
/// </summary>
public ManagerAction Action public ManagerAction Action
{ {
get { return action; } get { return action; }
} }
/// <summary>
/// Gets or sets the hash.
/// </summary>
public int Hash public int Hash
{ {
get { return hash; } get { return hash; }
set { hash = value; } set { hash = value; }
} }
/// <summary>
/// Frees this instance.
/// </summary>
public void Free() public void Free()
{ {
connection = null; connection = null;
@ -56,6 +68,10 @@ namespace AsterNET.Manager
events = null; events = null;
} }
/// <summary>
/// This method is called when a response is received.
/// </summary>
/// <param name="response"><see cref="ManagerResponse"/></param>
public void HandleResponse(ManagerResponse response) public void HandleResponse(ManagerResponse response)
{ {
events.Response = response; events.Response = response;
@ -66,6 +82,10 @@ namespace AsterNET.Manager
autoEvent.Set(); autoEvent.Set();
} }
/// <summary>
/// Handles the event.
/// </summary>
/// <param name="e"><see cref="ManagerEvent"/></param>
public void HandleEvent(ManagerEvent e) public void HandleEvent(ManagerEvent e)
{ {
// should always be a ResponseEvent, anyway... // should always be a ResponseEvent, anyway...

View file

@ -12,29 +12,37 @@ namespace AsterNET.Manager
{ {
private readonly List<ResponseEvent> events; private readonly List<ResponseEvent> events;
/// <summary> Creates a new instance.</summary> /// <summary>
/// Creates a new <see cref="ResponseEvents"/>.
/// </summary>
public ResponseEvents() public ResponseEvents()
{ {
events = new List<ResponseEvent>(); events = new List<ResponseEvent>();
Complete = false; Complete = false;
} }
/// <summary>
/// Gets or sets the response.
/// </summary>
public ManagerResponse Response { get; set; } public ManagerResponse Response { get; set; }
/// <summary>
/// Gets the list of events.
/// </summary>
public List<ResponseEvent> Events public List<ResponseEvent> Events
{ {
get { return events; } get { return events; }
} }
/// <summary> /// <summary>
/// Indicats if all events have been received. /// Indicates if all events have been received.
/// </summary> /// </summary>
public bool Complete { get; set; } public bool Complete { get; set; }
/// <summary> /// <summary>
/// Adds a ResponseEvent that has been received. /// Adds a ResponseEvent that has been received.
/// </summary> /// </summary>
/// <param name="e">the ResponseEvent that has been received.</param> /// <param name="e"><see cref="ResponseEvent"/></param>
public void AddEvent(ResponseEvent e) public void AddEvent(ResponseEvent e)
{ {
lock (((IList) events).SyncRoot) lock (((IList) events).SyncRoot)

View file

@ -15,10 +15,10 @@ namespace AsterNET.Manager
private ManagerResponse response; private ManagerResponse response;
/// <summary> /// <summary>
/// Creates a new instance. /// Creates a new <see cref="ResponseHandler"/>.
/// </summary> /// </summary>
/// <param name="result">the result to store the response in</param> /// <param name="action"><see cref="ManagerAction"/></param>
/// <param name="thread">the thread to interrupt when the response has been received</param> /// <param name="autoEvent"><see cref="AutoResetEvent"/></param>
public ResponseHandler(ManagerAction action, AutoResetEvent autoEvent) public ResponseHandler(ManagerAction action, AutoResetEvent autoEvent)
{ {
response = null; response = null;
@ -26,22 +26,34 @@ namespace AsterNET.Manager
this.autoEvent = autoEvent; this.autoEvent = autoEvent;
} }
/// <summary>
/// Gets the response.
/// </summary>
public ManagerResponse Response public ManagerResponse Response
{ {
get { return this.response; } get { return this.response; }
} }
/// <summary>
/// Gets the action.
/// </summary>
public ManagerAction Action public ManagerAction Action
{ {
get { return this.action; } get { return this.action; }
} }
/// <summary>
/// Gets or sets the hash.
/// </summary>
public int Hash public int Hash
{ {
get { return hash; } get { return hash; }
set { hash = value; } set { hash = value; }
} }
/// <summary>
/// Frees this instance.
/// </summary>
public void Free() public void Free()
{ {
autoEvent = null; autoEvent = null;
@ -49,6 +61,10 @@ namespace AsterNET.Manager
response = null; response = null;
} }
/// <summary>
/// This method is called when a response is received.
/// </summary>
/// <param name="response">the response received</param>
public virtual void HandleResponse(ManagerResponse response) public virtual void HandleResponse(ManagerResponse response)
{ {
this.response = response; this.response = response;