Asterisk-Java

org.asteriskjava.manager.action
Class HangupAction

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

public class HangupAction
extends AbstractManagerAction

The HangupAction causes Asterisk to hang up a given channel.

Hangup with a cause code is only supported by Asterisk versions later than 1.6.2.

Version:
$Id: HangupAction.java 1280 2009-04-03 18:54:51Z srt $
Author:
srt
See Also:
Serialized Form

Constructor Summary
HangupAction()
          Creates a new empty HangupAction.
HangupAction(java.lang.String channel)
          Creates a new HangupAction that hangs up the given channel.
HangupAction(java.lang.String channel, int cause)
          Creates a new HangupAction that hangs up the given channel with the given cause code.
 
Method Summary
 java.lang.String getAction()
          Returns the name of this action, i.e.
 java.lang.Integer getCause()
          Returns the hangup cause.
 java.lang.String getChannel()
          Returns the name of the channel to hangup.
 void setCause(java.lang.Integer cause)
          Sets the hangup cause.
 void setChannel(java.lang.String channel)
          Sets the name of the channel to hangup.
 
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

HangupAction

public HangupAction()
Creates a new empty HangupAction.


HangupAction

public HangupAction(java.lang.String channel)
Creates a new HangupAction that hangs up the given channel.

Parameters:
channel - the name of the channel to hangup.
Since:
0.2

HangupAction

public HangupAction(java.lang.String channel,
                    int cause)
Creates a new HangupAction that hangs up the given channel with the given cause code.

Parameters:
channel - the name of the channel to hangup.
cause - the cause code. The cause code must be >= 0 and <= 127.
Since:
1.0.0
Method Detail

getAction

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

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

getChannel

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

Returns:
the name of the channel to hangup.

setChannel

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

This property is mandatory.

Parameters:
channel - the name of the channel to hangup.

getCause

public java.lang.Integer getCause()
Returns the hangup cause.

Returns:
the hangup cause.
Since:
1.0.0

setCause

public void setCause(java.lang.Integer cause)
Sets the hangup cause. The cause code must be >= 0 and <= 127.

This property is optional.

Parameters:
cause - the hangup cause.
Since:
1.0.0

Asterisk-Java

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