Asterisk-Java

org.asteriskjava.manager.event
Class AbstractChannelStateEvent

java.lang.Object
  extended by java.util.EventObject
      extended by org.asteriskjava.manager.event.ManagerEvent
          extended by org.asteriskjava.manager.event.AbstractChannelEvent
              extended by org.asteriskjava.manager.event.AbstractChannelStateEvent
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
NewChannelEvent, NewStateEvent

public abstract class AbstractChannelStateEvent
extends AbstractChannelEvent

Abstract base class providing common properties for HangupEvent, NewChannelEvent and NewStateEvent.

Version:
$Id: AbstractChannelStateEvent.java 969 2008-02-03 14:24:22Z srt $
Author:
srt
See Also:
Serialized Form

Field Summary
static int AST_STATE_BUSY
          Line is busy.
static int AST_STATE_DIALING
          Digits (or equivalent) have been dialed.
static int AST_STATE_DIALING_OFFHOOK
          Digits (or equivalent) have been dialed while offhook.
static int AST_STATE_DOWN
          Channel is down and available.
static int AST_STATE_OFFHOOK
          Channel is off hook.
static int AST_STATE_PRERING
          Channel has detected an incoming call and is waiting for ring.
static int AST_STATE_RESERVED
          Channel is down, but reserved.
static int AST_STATE_RING
          Line is ringing.
static int AST_STATE_RINGING
          Remote end is ringing.
static int AST_STATE_UP
          Line is up.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
protected AbstractChannelStateEvent(java.lang.Object source)
           
 
Method Summary
 java.lang.Integer getChannelState()
          Returns the new state of the channel.
 java.lang.String getChannelStateDesc()
          Returns the new state of the channel as a descriptive text.
 java.lang.String getState()
          Deprecated. as of 1.0.0, use getChannelStateDesc() instead or even better switch to numeric values as returned by getChannelState().
 void setChannelState(java.lang.Integer channelState)
          Sets the new state of the channel.
 void setChannelStateDesc(java.lang.String channelStateDesc)
          Sets the new state of the channel as a descriptive text.
 void setState(java.lang.String state)
          Sets the new state of the channel as a descriptive text.
 
Methods inherited from class org.asteriskjava.manager.event.AbstractChannelEvent
getCallerId, getCallerIdName, getCallerIdNum, getChannel, getUniqueId, setCallerId, setCallerIdName, setCallerIdNum, setChannel, setUniqueId
 
Methods inherited from class org.asteriskjava.manager.event.ManagerEvent
getDateReceived, getPrivilege, getServer, getTimestamp, setDateReceived, setPrivilege, setServer, setTimestamp, toString
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

AST_STATE_DOWN

public static final int AST_STATE_DOWN
Channel is down and available.

See Also:
Constant Field Values

AST_STATE_RESERVED

public static final int AST_STATE_RESERVED
Channel is down, but reserved.

See Also:
Constant Field Values

AST_STATE_OFFHOOK

public static final int AST_STATE_OFFHOOK
Channel is off hook.

See Also:
Constant Field Values

AST_STATE_DIALING

public static final int AST_STATE_DIALING
Digits (or equivalent) have been dialed.

See Also:
Constant Field Values

AST_STATE_RING

public static final int AST_STATE_RING
Line is ringing.

See Also:
Constant Field Values

AST_STATE_RINGING

public static final int AST_STATE_RINGING
Remote end is ringing.

See Also:
Constant Field Values

AST_STATE_UP

public static final int AST_STATE_UP
Line is up.

See Also:
Constant Field Values

AST_STATE_BUSY

public static final int AST_STATE_BUSY
Line is busy.

See Also:
Constant Field Values

AST_STATE_DIALING_OFFHOOK

public static final int AST_STATE_DIALING_OFFHOOK
Digits (or equivalent) have been dialed while offhook.

See Also:
Constant Field Values

AST_STATE_PRERING

public static final int AST_STATE_PRERING
Channel has detected an incoming call and is waiting for ring.

See Also:
Constant Field Values
Constructor Detail

AbstractChannelStateEvent

protected AbstractChannelStateEvent(java.lang.Object source)
Method Detail

getChannelState

public java.lang.Integer getChannelState()
Returns the new state of the channel.

For Asterisk versions prior to 1.6 (that do not send the numeric value) it is derived from the descriptive text.

Returns:
the new state of the channel.
Since:
1.0.0

setChannelState

public void setChannelState(java.lang.Integer channelState)
Sets the new state of the channel.

Parameters:
channelState - the new state of the channel.
Since:
1.0.0

getChannelStateDesc

public java.lang.String getChannelStateDesc()
Returns the new state of the channel as a descriptive text.

The following states are used:


setChannelStateDesc

public void setChannelStateDesc(java.lang.String channelStateDesc)
Sets the new state of the channel as a descriptive text.

Parameters:
channelStateDesc - the new state of the channel as a descriptive text.
Since:
1.0.0

getState

public java.lang.String getState()
Deprecated. as of 1.0.0, use getChannelStateDesc() instead or even better switch to numeric values as returned by getChannelState().

Returns the new state of the channel as a descriptive text.

This is an alias for @getChannelStateDesc.

Returns:
the new state of the channel as a descriptive text.

setState

public void setState(java.lang.String state)
Sets the new state of the channel as a descriptive text.

The state property is used by Asterisk versions prior to 1.6.

Parameters:
state - the new state of the channel as a descriptive text.

Asterisk-Java

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