Asterisk-Java

org.asteriskjava.live
Enum ChannelState

java.lang.Object
  extended by java.lang.Enum<ChannelState>
      extended by org.asteriskjava.live.ChannelState
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<ChannelState>

public enum ChannelState
extends java.lang.Enum<ChannelState>

The lifecycle status of an AsteriskChannel.
Defined in channel.c function ast_state2str.

Version:
$Id: ChannelState.java 1026 2008-04-06 09:35:12Z srt $
Author:
srt

Enum Constant Summary
BUSY
          Line is busy.
DIALING
          Digits (or equivalent) have been dialed.
DIALING_OFFHOOK
          Digits (or equivalent) have been dialed while offhook.
DOWN
          Channel is down and available.
HUNGUP
          The channel has been hung up and is not longer available on the Asterisk server.
OFFHOOK
          Channel is off hook.
PRERING
          Channel has detected an incoming call and is waiting for ring.
RING
          Line is ringing.
RINGING
          Remote end is ringing.
RSRVD
          Channel is down, but reserved.
UP
          Line is up.
 
Method Summary
 int getStatus()
          Returns the numerical status code.
static ChannelState valueOf(java.lang.Integer status)
          Returns value specified by int.
static ChannelState valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static ChannelState[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

DOWN

public static final ChannelState DOWN
Channel is down and available. This is the initial state of the channel when it is not yet in use.


RSRVD

public static final ChannelState RSRVD
Channel is down, but reserved.


OFFHOOK

public static final ChannelState OFFHOOK
Channel is off hook.


DIALING

public static final ChannelState DIALING
Digits (or equivalent) have been dialed.


RING

public static final ChannelState RING
Line is ringing.


RINGING

public static final ChannelState RINGING
Remote end is ringing.


UP

public static final ChannelState UP
Line is up.


BUSY

public static final ChannelState BUSY
Line is busy.


DIALING_OFFHOOK

public static final ChannelState DIALING_OFFHOOK
Digits (or equivalent) have been dialed while offhook.


PRERING

public static final ChannelState PRERING
Channel has detected an incoming call and is waiting for ring.


HUNGUP

public static final ChannelState HUNGUP
The channel has been hung up and is not longer available on the Asterisk server.

Method Detail

values

public static ChannelState[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (ChannelState c : ChannelState.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static ChannelState valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getStatus

public int getStatus()
Returns the numerical status code.

Returns:
the numerical status code.

valueOf

public static ChannelState valueOf(java.lang.Integer status)
Returns value specified by int. Use this to transform AbstractChannelStateEvent.getChannelState().

Parameters:
status - integer representation of the status.
Returns:
corresponding ChannelState object or null if none matches.

Asterisk-Java

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