diff --git a/Asterisk.2013/Asterisk.NET/Manager/Originate.cs b/Asterisk.2013/Asterisk.NET/Manager/Originate.cs index 426ff66..d66a91e 100644 --- a/Asterisk.2013/Asterisk.NET/Manager/Originate.cs +++ b/Asterisk.2013/Asterisk.NET/Manager/Originate.cs @@ -2,6 +2,11 @@ using System.Collections.Generic; namespace AsterNET.Manager { + /// + /// Originates an outbound call and connects it to a specified extension or application.
+ /// It will block until the outgoing call fails or gets answered.
+ /// At that point, it will exit with the status variable set and dialplan processing will continue. + ///
public class Originate { private string account; @@ -18,9 +23,8 @@ namespace AsterNET.Manager #region Account /// - /// 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.
+ /// The account code is included in the call detail record generated for this call and will be used for billing. ///
public string Account { @@ -60,7 +64,7 @@ namespace AsterNET.Manager #region Context /// - /// 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.
/// If you set the context you also have to set the exten and priority properties. ///
public string Context @@ -74,7 +78,7 @@ namespace AsterNET.Manager #region Exten /// - /// Get/Set the extension to connect to. + /// Get/Set the extension to connect to.
/// If you set the extension you also have to set the context and priority properties. ///
public string Exten @@ -88,8 +92,8 @@ namespace AsterNET.Manager #region Priority /// - /// 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.
+ /// If you set the priority you also have to set the context and exten properties. ///
public int Priority { @@ -129,8 +133,7 @@ namespace AsterNET.Manager /// /// Get/Set the timeout for the origination (in seconds) for the origination.
- /// The channel must be answered within this time, otherwise the origination - /// is considered to have failed and an OriginateFailureEvent is generated.
+ /// The channel must be answered within this time, otherwise the origination is considered to have failed and an OriginateFailureEvent is generated.
/// If not set, a default value of 30 seconds. ///
public long Timeout diff --git a/Asterisk.2013/Asterisk.NET/Manager/ResponseEventHandler.cs b/Asterisk.2013/Asterisk.NET/Manager/ResponseEventHandler.cs index 2ada508..87e8cdc 100644 --- a/Asterisk.2013/Asterisk.NET/Manager/ResponseEventHandler.cs +++ b/Asterisk.2013/Asterisk.NET/Manager/ResponseEventHandler.cs @@ -6,7 +6,7 @@ using AsterNET.Manager.Response; namespace AsterNET.Manager { /// - /// 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. /// public class ResponseEventHandler : IResponseHandler { @@ -17,11 +17,11 @@ namespace AsterNET.Manager private int hash; /// - /// Creates a new instance. + /// Creates a new instance. /// - /// the ResponseEvents to store the events in - /// the type of event that indicates that all events have been received - /// the thread to interrupt when the actionCompleteEventClass has been received + /// + /// + /// public ResponseEventHandler(ManagerConnection connection, ManagerActionEvent action, AutoResetEvent autoEvent) { this.connection = connection; @@ -30,22 +30,34 @@ namespace AsterNET.Manager this.autoEvent = autoEvent; } + /// + /// Gets the response events. + /// public ResponseEvents ResponseEvents { get { return events; } } + /// + /// Gets the action. + /// public ManagerAction Action { get { return action; } } + /// + /// Gets or sets the hash. + /// public int Hash { get { return hash; } set { hash = value; } } + /// + /// Frees this instance. + /// public void Free() { connection = null; @@ -56,6 +68,10 @@ namespace AsterNET.Manager events = null; } + /// + /// This method is called when a response is received. + /// + /// public void HandleResponse(ManagerResponse response) { events.Response = response; @@ -66,6 +82,10 @@ namespace AsterNET.Manager autoEvent.Set(); } + /// + /// Handles the event. + /// + /// public void HandleEvent(ManagerEvent e) { // should always be a ResponseEvent, anyway... diff --git a/Asterisk.2013/Asterisk.NET/Manager/ResponseEvents.cs b/Asterisk.2013/Asterisk.NET/Manager/ResponseEvents.cs index 0d2b1db..c0836b7 100644 --- a/Asterisk.2013/Asterisk.NET/Manager/ResponseEvents.cs +++ b/Asterisk.2013/Asterisk.NET/Manager/ResponseEvents.cs @@ -12,29 +12,37 @@ namespace AsterNET.Manager { private readonly List events; - /// Creates a new instance. + /// + /// Creates a new . + /// public ResponseEvents() { events = new List(); Complete = false; } + /// + /// Gets or sets the response. + /// public ManagerResponse Response { get; set; } + /// + /// Gets the list of events. + /// public List Events { get { return events; } } /// - /// Indicats if all events have been received. + /// Indicates if all events have been received. /// public bool Complete { get; set; } /// /// Adds a ResponseEvent that has been received. /// - /// the ResponseEvent that has been received. + /// public void AddEvent(ResponseEvent e) { lock (((IList) events).SyncRoot) diff --git a/Asterisk.2013/Asterisk.NET/Manager/ResponseHandler.cs b/Asterisk.2013/Asterisk.NET/Manager/ResponseHandler.cs index a0f1013..bdeb634 100644 --- a/Asterisk.2013/Asterisk.NET/Manager/ResponseHandler.cs +++ b/Asterisk.2013/Asterisk.NET/Manager/ResponseHandler.cs @@ -15,10 +15,10 @@ namespace AsterNET.Manager private ManagerResponse response; /// - /// Creates a new instance. + /// Creates a new . /// - /// the result to store the response in - /// the thread to interrupt when the response has been received + /// + /// public ResponseHandler(ManagerAction action, AutoResetEvent autoEvent) { response = null; @@ -26,22 +26,34 @@ namespace AsterNET.Manager this.autoEvent = autoEvent; } + /// + /// Gets the response. + /// public ManagerResponse Response { get { return this.response; } } + /// + /// Gets the action. + /// public ManagerAction Action { get { return this.action; } } + /// + /// Gets or sets the hash. + /// public int Hash { get { return hash; } set { hash = value; } } + /// + /// Frees this instance. + /// public void Free() { autoEvent = null; @@ -49,6 +61,10 @@ namespace AsterNET.Manager response = null; } + /// + /// This method is called when a response is received. + /// + /// the response received public virtual void HandleResponse(ManagerResponse response) { this.response = response;