public class HangupAction extends AbstractManagerAction implements EventGeneratingAction
Hangup with a cause code is only supported by Asterisk versions later than 1.6.2.
If the provided channel is surrounded by /forward slashes/, Asterisk
will interpret the value as a
POSIX Extended Regular Expression (ERE),
allowing multiple channels to be hung up at once.
If you are passing a regular expression to this action, ensure that you also
use one of the ManagerConnection.sendEventGeneratingAction(EventGeneratingAction)
overloads to capture the response correctly.
| Constructor and Description |
|---|
HangupAction()
Creates a new empty HangupAction.
|
HangupAction(String channelOrRegex)
Creates a new HangupAction that hangs up the given channel.
|
HangupAction(String channelOrRegex,
int cause)
Creates a new HangupAction that hangs up the given channel with the given cause code.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getAction()
Returns the name of this action, i.e.
|
Class<? extends ResponseEvent> |
getActionCompleteEventClass()
Returns the event type that indicates that Asterisk is finished sending
response events for this action.
|
Integer |
getCause()
Returns the hangup cause.
|
String |
getChannel()
Returns the name of the channel to hangup.
|
void |
setCause(Integer cause)
Sets the hangup cause.
|
void |
setChannel(String channel)
Sets the name of the channel to hangup.
|
getActionId, setActionId, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetActionId, setActionIdpublic HangupAction()
public HangupAction(String channelOrRegex)
channelOrRegex - the name of the channel to hangup.public HangupAction(String channelOrRegex, int cause)
channelOrRegex - the name of the channel to hangup.cause - the cause code. The cause code must be >= 0 and <= 127.public String getAction()
getAction in interface ManagerActiongetAction in class AbstractManagerActionpublic String getChannel()
public void setChannel(String channel)
This property is mandatory.
channel - the name of the channel to hangup.public Integer getCause()
public void setCause(Integer cause)
This property is optional.
cause - the hangup cause.public Class<? extends ResponseEvent> getActionCompleteEventClass()
EventGeneratingActiongetActionCompleteEventClass in interface EventGeneratingActionResponseEventCopyright © 2004–2026. All rights reserved.