Ejemplo n.º 1
0
        /// <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);
        }
Ejemplo n.º 2
0
 /// <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;
 }
Ejemplo n.º 3
0
 /// <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;
 }
Ejemplo n.º 4
0
 /// <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;
 }
Ejemplo n.º 5
0
 /// <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;
 }
Ejemplo n.º 6
0
 /// <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;
 }
Ejemplo n.º 7
0
 /// <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;
 }
Ejemplo n.º 8
0
 /// <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;
 }
Ejemplo n.º 9
0
 /// <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;
 }
Ejemplo n.º 10
0
 /// <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;
 }