comment updates (Manager)

This commit is contained in:
Craig Roberts 2018-09-02 14:35:20 -04:00
parent 03f51ba65e
commit 1769b2213d
4 changed files with 67 additions and 20 deletions

View file

@ -2,6 +2,11 @@ using System.Collections.Generic;
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
{
private string account;
@ -18,9 +23,8 @@ namespace AsterNET.Manager
#region Account
/// <summary>
/// Get/Set the account code to use for the originated call.
/// The account code is included in the call detail record generated for this
/// call and will be used for billing.
/// 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 call and will be used for billing.
/// </summary>
public string Account
{
@ -60,7 +64,7 @@ namespace AsterNET.Manager
#region Context
/// <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.
/// </summary>
public string Context
@ -74,7 +78,7 @@ namespace AsterNET.Manager
#region Exten
/// <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.
/// </summary>
public string Exten
@ -88,8 +92,8 @@ namespace AsterNET.Manager
#region Priority
/// <summary>
/// Get/Set the priority of the extension to connect to. If you set the priority
/// you also have to set the context and exten properties.
/// Get/Set the priority of the extension to connect to.<br/>
/// If you set the priority you also have to set the context and exten properties.
/// </summary>
public int Priority
{
@ -129,8 +133,7 @@ namespace AsterNET.Manager
/// <summary>
/// Get/Set the timeout for the origination (in seconds) for the origination.<br />
/// The channel must be answered within this time, otherwise the origination
/// is considered to have failed and an OriginateFailureEvent is generated.<br />
/// The channel must be answered within this time, otherwise the origination is considered to have failed and an OriginateFailureEvent is generated.<br />
/// If not set, a default value of 30 seconds.
/// </summary>
public long Timeout

View file

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

View file

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

View file

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