2013-01-18 15:55:50 +00:00
|
|
|
using System;
|
2014-01-08 14:16:39 +00:00
|
|
|
namespace AsterNET.FastAGI.Command
|
2013-01-18 15:55:50 +00:00
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Hangs up the specified channel. If no channel name is given, hangs up the current channel.
|
|
|
|
/// </summary>
|
|
|
|
public class HangupCommand : AGICommand
|
|
|
|
{
|
|
|
|
|
|
|
|
/// <summary>
|
2015-01-04 14:26:32 +00:00
|
|
|
/// The name of the channel to hangup or null for the current channel.
|
2013-01-18 15:55:50 +00:00
|
|
|
/// </summary>
|
|
|
|
private string channel;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Returns the name of the channel to hangup.
|
|
|
|
/// </summary>
|
2015-01-04 14:26:32 +00:00
|
|
|
/// <returns>the name of the channel to hangup or null for the current channel.</returns>
|
2013-01-18 15:55:50 +00:00
|
|
|
/// <summary> Sets the name of the channel to hangup.</summary>
|
2015-01-04 14:26:32 +00:00
|
|
|
/// <param name="channel">the name of the channel to hangup or null for the current channel.</param>
|
2013-01-18 15:55:50 +00:00
|
|
|
public string Channel
|
|
|
|
{
|
|
|
|
get { return channel; }
|
|
|
|
set { this.channel = value; }
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary> Creates a new HangupCommand that hangs up the current channel.</summary>
|
|
|
|
public HangupCommand()
|
|
|
|
{
|
|
|
|
this.channel = null;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Creates a new HangupCommand that hangs up the given channel.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="channel">the name of the channel to hangup.</param>
|
|
|
|
public HangupCommand(string channel)
|
|
|
|
{
|
|
|
|
this.channel = channel;
|
|
|
|
}
|
|
|
|
|
|
|
|
public override string BuildCommand()
|
|
|
|
{
|
|
|
|
return "HANGUP" + (channel == null ? "" : " " + EscapeAndQuote(channel));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|