using System;
namespace Asterisk.NET.Manager.Action
{
///
/// The MonitorAction starts monitoring (recording) a channel.
/// It is implemented in res/res_monitor.c
///
public class MonitorAction : ManagerAction
{
private string channel;
private string file;
private string format;
private bool mix;
#region Action
///
/// Get the name of this action, i.e. "Monitor".
///
override public string Action
{
get { return "Monitor"; }
}
#endregion
#region Channel
///
/// Get/Set the name of the channel to monitor.
/// This property is mandatory.
///
public string Channel
{
get { return this.channel; }
set { this.channel = value; }
}
#endregion
#region File
///
/// Get/Set the name of the file to which the voice data is written.
/// If this property is not set it defaults to to the channel name as per CLI with the '/' replaced by '-'.
///
public string File
{
get { return this.file; }
set { this.file = value; }
}
#endregion
#region Format
///
/// Get/Set the format to use for encoding the voice files.
/// If this property is not set it defaults to "wav".
///
public string Format
{
get { return this.format; }
set { this.format = value; }
}
#endregion
#region Mix
///
/// Returns true if the two voice files should be joined at the end of the call.
///
public bool Mix
{
get { return this.mix; }
set { this.mix = value; }
}
#endregion
#region MonitorAction()
///
/// Creates a new empty MonitorAction.
///
public MonitorAction()
{
}
#endregion
#region MonitorAction(string channel, string file)
///
/// Creates a new MonitorAction that starts monitoring the given channel and
/// writes voice data to the given file(s).
///
/// the name of the channel to monitor
/// the (base) name of the file(s) to which the voice data is written
public MonitorAction(string channel, string file)
{
this.channel = channel;
this.file = file;
}
#endregion
#region MonitorAction(string channel, string file)
///
/// Creates a new MonitorAction that starts monitoring the given channel and
/// writes voice data to the given file(s).
///
/// the name of the channel to monitor
/// the (base) name of the file(s) to which the voice data is written
/// the format to use for encoding the voice files
public MonitorAction(string channel, string file, string format)
{
this.channel = channel;
this.file = file;
this.format = format;
}
#endregion
#region MonitorAction(string channel, string file, string format, int mix)
///
/// Creates a new MonitorAction that starts monitoring the given channel and
/// writes voice data to the given file(s).
///
/// the name of the channel to monitor
/// the (base) name of the file(s) to which the voice data is written
/// the format to use for encoding the voice files
/// true if the two voice files should be joined at the end of the call
public MonitorAction(string channel, string file, string format, bool mix)
{
this.channel = channel;
this.file = file;
this.format = format;
this.mix = mix;
}
#endregion
}
}