Asterisk-Java

org.asteriskjava.manager.action
Class RedirectAction

java.lang.Object
  extended by org.asteriskjava.manager.action.AbstractManagerAction
      extended by org.asteriskjava.manager.action.RedirectAction
All Implemented Interfaces:
java.io.Serializable, ManagerAction

public class RedirectAction
extends AbstractManagerAction

Redirects a given channel (and an optional additional channel) to a new extension.

The additional channel is usually used when redirecting two bridged channel for example to a MeetMe room.

Note that BRIstuffed versions of Asterisk behave slightly different: While the standard version only allows redirecting the two channels to the same context, extension, priority the BRIstuffed version uses context, extension, priority only for the first channel and extraContext, extraExtension, extraPriority for the second channel. The standard version ignores the extraContext, extraExtension, extraPriority properties.

Version:
$Id: RedirectAction.java 938 2007-12-31 03:23:38Z srt $
Author:
srt
See Also:
Serialized Form

Constructor Summary
RedirectAction()
          Creates a new empty RedirectAction.
RedirectAction(java.lang.String channel, java.lang.String context, java.lang.String exten, java.lang.Integer priority)
          Creates a new RedirectAction that redirects the given channel to the given context, extension, priority triple.
RedirectAction(java.lang.String channel, java.lang.String extraChannel, java.lang.String context, java.lang.String exten, java.lang.Integer priority)
          Creates a new RedirectAction that redirects the given channels to the given context, extension, priority triple.
RedirectAction(java.lang.String channel, java.lang.String extraChannel, java.lang.String context, java.lang.String exten, java.lang.Integer priority, java.lang.String extraContext, java.lang.String extraExten, java.lang.Integer extraPriority)
          Creates a new RedirectAction that redirects the given channels to the given context, extension, priority triples.
 
Method Summary
 java.lang.String getAction()
          Returns the name of this action, i.e.
 java.lang.String getChannel()
          Returns name of the channel to redirect.
 java.lang.String getContext()
          Returns the destination context.
 java.lang.String getExten()
          Returns the destination extension.
 java.lang.String getExtraChannel()
          Returns the name of the additional channel to redirect.
 java.lang.String getExtraContext()
          Returns the destination context for the additional channel.
 java.lang.String getExtraExten()
          Sets the destination extension for the additional channel.
 java.lang.Integer getExtraPriority()
          Returns the destination priority for the additional channel.
 java.lang.Integer getPriority()
          Returns the destination priority.
 void setChannel(java.lang.String channel)
          Sets the name of the channel to redirect.
 void setContext(java.lang.String context)
          Sets the destination context.
 void setExten(java.lang.String exten)
          Sets the destination extension.
 void setExtraChannel(java.lang.String extraChannel)
          Sets the name of the additional channel to redirect.
 void setExtraContext(java.lang.String extraContext)
          Sets the destination context for the additional channel.
 void setExtraExten(java.lang.String extraExten)
          Sets the destination extension for the additional channel.
 void setExtraPriority(java.lang.Integer extraPriority)
          Sets the destination priority for the additional channel.
 void setPriority(java.lang.Integer priority)
          Sets the destination priority.
 
Methods inherited from class org.asteriskjava.manager.action.AbstractManagerAction
getActionId, setActionId, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RedirectAction

public RedirectAction()
Creates a new empty RedirectAction.


RedirectAction

public RedirectAction(java.lang.String channel,
                      java.lang.String context,
                      java.lang.String exten,
                      java.lang.Integer priority)
Creates a new RedirectAction that redirects the given channel to the given context, extension, priority triple.

Parameters:
channel - the name of the channel to redirect
context - the destination context
exten - the destination extension
priority - the destination priority
Since:
0.2

RedirectAction

public RedirectAction(java.lang.String channel,
                      java.lang.String extraChannel,
                      java.lang.String context,
                      java.lang.String exten,
                      java.lang.Integer priority)
Creates a new RedirectAction that redirects the given channels to the given context, extension, priority triple.

This constructor only works standard versions of Asterisk, i.e. non-BRIstuffed versions. When used with a BRIstuffed version (and not setting extraContext, extraExten and extraPriority) the second channel is just hung up.

Parameters:
channel - the name of the first channel to redirect
extraChannel - the name of the second channel to redirect
context - the destination context
exten - the destination extension
priority - the destination priority
Since:
0.2

RedirectAction

public RedirectAction(java.lang.String channel,
                      java.lang.String extraChannel,
                      java.lang.String context,
                      java.lang.String exten,
                      java.lang.Integer priority,
                      java.lang.String extraContext,
                      java.lang.String extraExten,
                      java.lang.Integer extraPriority)
Creates a new RedirectAction that redirects the given channels to the given context, extension, priority triples.

This constructor works for BRIstuffed versions of Asterisk, if used with a standard version the extraContext, extraExten and extraPriroity attributes are ignored.

Parameters:
channel - the name of the first channel to redirect
extraChannel - the name of the second channel to redirect
context - the destination context for the first channel
exten - the destination extension for the first channel
priority - the destination priority for the first channel
extraContext - the destination context for the second channel
extraExten - the destination extension for the second channel
extraPriority - the destination priority for the second channel
Since:
0.3
Method Detail

getAction

public java.lang.String getAction()
Returns the name of this action, i.e. "Redirect".

Specified by:
getAction in interface ManagerAction
Specified by:
getAction in class AbstractManagerAction

getChannel

public java.lang.String getChannel()
Returns name of the channel to redirect.

Returns:
the name of the channel to redirect

setChannel

public void setChannel(java.lang.String channel)
Sets the name of the channel to redirect.

Parameters:
channel - the name of the channel to redirect

getExtraChannel

public java.lang.String getExtraChannel()
Returns the name of the additional channel to redirect.

Returns:
the name of the additional channel to redirect

setExtraChannel

public void setExtraChannel(java.lang.String extraChannel)
Sets the name of the additional channel to redirect.

Parameters:
extraChannel - the name of the additional channel to redirect

getContext

public java.lang.String getContext()
Returns the destination context.

Returns:
the destination context

setContext

public void setContext(java.lang.String context)
Sets the destination context.

Parameters:
context - the destination context

getExten

public java.lang.String getExten()
Returns the destination extension.

Returns:
the destination extension

setExten

public void setExten(java.lang.String exten)
Sets the destination extension.

Parameters:
exten - the destination extension

getPriority

public java.lang.Integer getPriority()
Returns the destination priority.

Returns:
the destination priority

setPriority

public void setPriority(java.lang.Integer priority)
Sets the destination priority.

Parameters:
priority - the destination priority

getExtraContext

public java.lang.String getExtraContext()
Returns the destination context for the additional channel.

This property is only used by BRIstuffed Asterisk servers.

Returns:
the destination context for the additional channel.

setExtraContext

public void setExtraContext(java.lang.String extraContext)
Sets the destination context for the additional channel.

This property is only used by BRIstuffed Asterisk servers.

Parameters:
extraContext - the destination context for the additional channel.

getExtraExten

public java.lang.String getExtraExten()
Sets the destination extension for the additional channel.

This property is only used by BRIstuffed Asterisk servers.

Returns:
the destination extension for the additional channel.

setExtraExten

public void setExtraExten(java.lang.String extraExten)
Sets the destination extension for the additional channel.

This property is only used by BRIstuffed Asterisk servers.

Parameters:
extraExten - the destination extension for the additional channel.

getExtraPriority

public java.lang.Integer getExtraPriority()
Returns the destination priority for the additional channel.

This property is only used by BRIstuffed Asterisk servers.

Returns:
the destination priority for the additional channel.

setExtraPriority

public void setExtraPriority(java.lang.Integer extraPriority)
Sets the destination priority for the additional channel.

This property is only used by BRIstuffed Asterisk servers.

Parameters:
extraPriority - the destination priority for the additional channel.

Asterisk-Java

Copyright © 2004-2009 Stefan Reuter. All Rights Reserved.