/// <summary> /// Returns the low-level FreeSWITCH string corresponding to a <see cref="SwitchHangupReason" />. /// </summary> /// <param name="reason">The hangup reason code.</param> /// <returns>The corresponding string or <b>NONE</b> if the code is unknown.</returns> public static string GetSwitchHangupReasonString(SwitchHangupReason reason) { string reasonString; if (!switchHangupReasonToString.TryGetValue(reason, out reasonString)) { SysLog.LogWarning("Unexpected switch hangup reason code [{0}].", reason); reasonString = switchHangupReasonToString[SwitchHangupReason.None]; } return(reasonString); }
/// <summary> /// Constructor. /// </summary> /// <param name="reason">The hangup reason code.</param> /// <param name="callDetails">The call details record (CDR).</param> internal HangupEventArgs(SwitchHangupReason reason, string callDetails) { this.Reason = reason; this.CallDetails = callDetails; }
/// <summary> /// Constructs a hangup action with the <see cref="SwitchHangupReason.NormalClearing" /> /// reason code for a specific call. /// </summary> /// <param name="callID">The target call ID.</param> public HangupAction(Guid callID) { this.CallID = callID;; this.reason = SwitchHangupReason.NormalClearing; this.delay = TimeSpan.Zero; }
/// <summary> /// Constructs a delayed hangup action with a specified reason code for the current /// call in an executing dial plan. /// </summary> /// <param name="reason">The hangup reason code.</param> /// <param name="delay">The amount of time to delay the hangup.</param> /// <remarks> /// <note> /// <paramref name="delay" /> is ignored when executing outside of a dialplan. /// </note> /// </remarks> public HangupAction(SwitchHangupReason reason, TimeSpan delay) { this.reason = reason; this.delay = delay; }
/// <summary> /// Constructs a hangup action with a specified reason code for the current call /// in an executing dial plan. /// </summary> /// <param name="reason">The hangup reason code.</param> public HangupAction(SwitchHangupReason reason) { this.reason = reason; this.delay = TimeSpan.Zero; }
/// <summary> /// Constructs a delayed hangup action for the current call in an executing dial plan. /// </summary> /// <param name="delay">The amount of time to delay the hangup.</param> /// <remarks> /// <para> /// This action essentially delays the hangup until a time in the future /// with the <see cref="SwitchHangupReason.AllottedTimeout" /> reason code. /// </para> /// <note> /// <paramref name="delay" /> is ignored when executing outside of a dialplan. /// </note> /// </remarks> public HangupAction(TimeSpan delay) { this.reason = SwitchHangupReason.AllottedTimeout; this.delay = delay; }
/// <summary> /// Constructs a hangup action with the <see cref="SwitchHangupReason.NormalClearing" /> /// reason code for the current call in an executing dial plan. /// </summary> public HangupAction() { this.reason = SwitchHangupReason.NormalClearing; this.delay = TimeSpan.Zero; }
/// <summary> /// Constructs a delayed hangup action with a specified reason code for a specific call. /// </summary> /// <param name="callID">The target call ID.</param> /// <param name="reason">The hangup reason code.</param> /// <param name="delay">The amount of time to delay the hangup.</param> /// <remarks> /// <note> /// <paramref name="delay" /> is ignored when executing outside of a dialplan. /// </note> /// </remarks> public HangupAction(Guid callID, SwitchHangupReason reason, TimeSpan delay) { this.CallID = callID;; this.reason = reason; this.delay = delay; }
/// <summary> /// Constructs a hangup action with a specified reason code for a specific call. /// </summary> /// <param name="callID">The target call ID.</param> /// <param name="reason">The hangup reason code.</param> public HangupAction(Guid callID, SwitchHangupReason reason) { this.CallID = callID;; this.reason = reason; this.delay = TimeSpan.Zero; }
/// <summary> /// Constructs a delayed hangup action for a specific call. /// </summary> /// <param name="callID">The target call ID.</param> /// <param name="delay">The amount of time to delay the hangup.</param> /// <remarks> /// <para> /// This action essentially delays the hangup until a time in the future /// with the <see cref="SwitchHangupReason.AllottedTimeout" /> reason code. /// </para> /// <note> /// <paramref name="delay" /> is ignored when executing outside of a dialplan. /// </note> /// </remarks> public HangupAction(Guid callID, TimeSpan delay) { this.CallID = callID;; this.reason = SwitchHangupReason.AllottedTimeout; this.delay = delay; }