using System;
namespace Asterisk.NET.Manager.Action
{
///
/// Redirects a given channel (and an optional additional channel) to a new extension.
///
public class RedirectAction : ManagerAction
{
private string channel;
private string extraChannel;
private string exten;
private string context;
private int priority;
///
/// Get the name of this action, i.e. "Redirect".
///
override public string Action
{
get { return "Redirect"; }
}
///
/// Get/Set name of the channel to redirect.
public string Channel
{
get { return this.channel; }
set { this.channel = value; }
}
///
/// Get/Set the name of the additional channel to redirect.
///
public string ExtraChannel
{
get { return this.extraChannel; }
set { this.extraChannel = value; }
}
///
/// Get/Set the destination context.
///
public string Context
{
get { return this.context; }
set { this.context = value; }
}
///
/// Get/Set the destination extension.
///
public string Exten
{
get { return this.exten; }
set { this.exten = value; }
}
///
/// Get/Set the destination priority.
///
public int Priority
{
get { return this.priority; }
set { this.priority = value; }
}
///
/// Creates a new empty RedirectAction.
///
public RedirectAction()
{
}
///
/// Creates a new RedirectAction that redirects the given channel to the given context, extension, priority triple.
///
/// the name of the channel to redirect
/// the destination context
/// the destination extension
/// the destination priority
public RedirectAction(string channel, string context, string exten, int priority)
{
this.channel = channel;
this.context = context;
this.exten = exten;
this.priority = priority;
}
///
/// Creates a new RedirectAction that redirects the given channels to the given context, extension, priority triple.
///
/// the name of the first channel to redirect
/// the name of the second channel to redirect
/// the destination context
/// the destination extension
/// the destination priority
public RedirectAction(string channel, string extraChannel, string context, string exten, int priority)
{
this.channel = channel;
this.extraChannel = extraChannel;
this.context = context;
this.exten = exten;
this.priority = priority;
}
}
}