Asterisk-Java

org.asteriskjava.manager.event
Class QueueMemberEvent

java.lang.Object
  extended by java.util.EventObject
      extended by org.asteriskjava.manager.event.ManagerEvent
          extended by org.asteriskjava.manager.event.ResponseEvent
              extended by org.asteriskjava.manager.event.QueueMemberEvent
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
QueueMemberStatusEvent

public class QueueMemberEvent
extends ResponseEvent

A QueueMemberEvent is triggered in response to a QueueStatusAction and contains information about a member of a queue.

It is implemented in apps/app_queue.c

Version:
$Id: QueueMemberEvent.java 1291 2009-04-27 21:56:44Z srt $
Author:
srt
See Also:
QueueStatusAction, Serialized Form

Field Summary
static int AST_DEVICE_BUSY
           
static int AST_DEVICE_INUSE
           
static int AST_DEVICE_INVALID
           
static int AST_DEVICE_NOT_INUSE
          Queue member is available.
static int AST_DEVICE_ONHOLD
           
static int AST_DEVICE_RINGING
           
static int AST_DEVICE_RINGINUSE
           
static int AST_DEVICE_UNAVAILABLE
           
static int AST_DEVICE_UNKNOWN
           
static java.lang.String MEMBERSHIP_DYNAMIC
           
static java.lang.String MEMBERSHIP_STATIC
           
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
QueueMemberEvent(java.lang.Object source)
           
 
Method Summary
 java.lang.Integer getCallsTaken()
          Returns the number of calls answered by the member.
 java.lang.Long getLastCall()
          Returns the time the last successful call answered by the added member was hungup.
 java.lang.String getLocation()
          Returns the name of the member's interface.
 java.lang.String getMemberName()
          Deprecated. since 1.0.0. Use getName() instead.
 java.lang.String getMembership()
          Returns if this member has been dynamically added by the QueueAdd command (in the dialplan or via the Manager API) or if this member is has been statically defined in queues.conf.
 java.lang.String getName()
          Returns the name of the member.
 java.lang.Boolean getPaused()
          Is this queue member paused (not accepting calls)?
 java.lang.Integer getPenalty()
          Returns the penalty for the added member.
 java.lang.String getQueue()
          Returns the name of the queue.
 java.lang.Integer getStatus()
          Returns the status of this queue member.
 boolean isDynamic()
          Convenience method that checks whether this member has been dynamically added by the QueueAdd command.
 boolean isStatic()
          Convenience method that checks whether this member has been statically defined in queues.conf.
 void setCallsTaken(java.lang.Integer callsTaken)
          Sets the number of calls answered by the added member.
 void setLastCall(java.lang.Long lastCall)
          Sets the time the last successful call answered by this member was hungup.
 void setLocation(java.lang.String location)
          Sets the name of the member's interface.
 void setMemberName(java.lang.String memberName)
           
 void setMembership(java.lang.String membership)
          Sets if this member has been dynamically or statically added.
 void setName(java.lang.String name)
           
 void setPaused(java.lang.Boolean paused)
          Sets if this member has been paused.
 void setPenalty(java.lang.Integer penalty)
          Sets the penalty for this member.
 void setQueue(java.lang.String queue)
          Sets the name of the queue.
 void setStatus(java.lang.Integer status)
          Sets the status of this queue member.
 
Methods inherited from class org.asteriskjava.manager.event.ResponseEvent
getActionId, getInternalActionId, setActionId, setInternalActionId
 
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_DEVICE_UNKNOWN

public static final int AST_DEVICE_UNKNOWN
See Also:
Constant Field Values

AST_DEVICE_NOT_INUSE

public static final int AST_DEVICE_NOT_INUSE
Queue member is available.

See Also:
Constant Field Values

AST_DEVICE_INUSE

public static final int AST_DEVICE_INUSE
See Also:
Constant Field Values

AST_DEVICE_BUSY

public static final int AST_DEVICE_BUSY
See Also:
Constant Field Values

AST_DEVICE_INVALID

public static final int AST_DEVICE_INVALID
See Also:
Constant Field Values

AST_DEVICE_UNAVAILABLE

public static final int AST_DEVICE_UNAVAILABLE
See Also:
Constant Field Values

AST_DEVICE_RINGING

public static final int AST_DEVICE_RINGING
See Also:
Constant Field Values

AST_DEVICE_RINGINUSE

public static final int AST_DEVICE_RINGINUSE
See Also:
Constant Field Values

AST_DEVICE_ONHOLD

public static final int AST_DEVICE_ONHOLD
See Also:
Constant Field Values

MEMBERSHIP_STATIC

public static final java.lang.String MEMBERSHIP_STATIC
See Also:
Constant Field Values

MEMBERSHIP_DYNAMIC

public static final java.lang.String MEMBERSHIP_DYNAMIC
See Also:
Constant Field Values
Constructor Detail

QueueMemberEvent

public QueueMemberEvent(java.lang.Object source)
Parameters:
source -
Method Detail

getQueue

public java.lang.String getQueue()
Returns the name of the queue.

Returns:
the name of the queue.

setQueue

public void setQueue(java.lang.String queue)
Sets the name of the queue.

Parameters:
queue - the name of the queue.

getLocation

public java.lang.String getLocation()
Returns the name of the member's interface.

E.g. the channel name or agent group (for example "Agent/@1").

Returns:
the name of the member's interface.

setLocation

public void setLocation(java.lang.String location)
Sets the name of the member's interface.

Parameters:
location - the name of the member's interface.

getMembership

public java.lang.String getMembership()
Returns if this member has been dynamically added by the QueueAdd command (in the dialplan or via the Manager API) or if this member is has been statically defined in queues.conf.

Returns:
"dynamic" if the added member is a dynamic queue member, "static" if the added member is a static queue member.

isStatic

public boolean isStatic()
Convenience method that checks whether this member has been statically defined in queues.conf.

Returns:
true if this member has been statically defined in queues.conf, false otherwise.
Since:
0.3

isDynamic

public boolean isDynamic()
Convenience method that checks whether this member has been dynamically added by the QueueAdd command.

Returns:
true if this member has been dynamically added by the QueueAdd command, false otherwise.
Since:
0.3

setMembership

public void setMembership(java.lang.String membership)
Sets if this member has been dynamically or statically added.

Parameters:
membership - "dynamic" if the added member is a dynamic queue member, "static" if the added member is a static queue member.

getPenalty

public java.lang.Integer getPenalty()
Returns the penalty for the added member. When calls are distributed members with higher penalties are considered last.

Returns:
the penalty for the added member.

setPenalty

public void setPenalty(java.lang.Integer penalty)
Sets the penalty for this member.

Parameters:
penalty - the penalty for this member.

getCallsTaken

public java.lang.Integer getCallsTaken()
Returns the number of calls answered by the member.

Returns:
the number of calls answered by the member.

setCallsTaken

public void setCallsTaken(java.lang.Integer callsTaken)
Sets the number of calls answered by the added member.

Parameters:
callsTaken - the number of calls answered by the added member.

getLastCall

public java.lang.Long getLastCall()
Returns the time the last successful call answered by the added member was hungup.

Returns:
the time (in seconds since 01/01/1970) the last successful call answered by the added member was hungup.

setLastCall

public void setLastCall(java.lang.Long lastCall)
Sets the time the last successful call answered by this member was hungup.

Parameters:
lastCall - the time (in seconds since 01/01/1970) the last successful call answered by the added member was hungup.

getStatus

public java.lang.Integer getStatus()
Returns the status of this queue member.

Available since Asterisk 1.2

Valid status codes are:

AST_DEVICE_UNKNOWN (0)
Device valid but unknown channel state
AST_DEVICE_NOT_INUSE (1)
Device is not used
AST_DEVICE_INUSE (2)
Device is in use
AST_DEVICE_BUSY (3)
Device is Busy
AST_DEVICE_INVALID (4)
Device is invalid
AST_DEVICE_UNAVAILABLE (5)
Device is unavaiable
AST_DEVICE_RINGING (6)
Device is ringing
AST_DEVICE_RINGINUSE (7)
Device is ringing and in use
AST_DEVICE_ONHOLD (8)
Device is on hold

Returns:
the status of this queue member or null if this attribute is not supported by your version of Asterisk.
Since:
0.2

setStatus

public void setStatus(java.lang.Integer status)
Sets the status of this queue member.

Parameters:
status - the status of this queue member
Since:
0.2

getPaused

public java.lang.Boolean getPaused()
Is this queue member paused (not accepting calls)?

Available since Asterisk 1.2.

Returns:
Boolean.TRUE if this member has been paused, Boolean.FALSE if not or null if pausing is not supported by your version of Asterisk.
Since:
0.2

setPaused

public void setPaused(java.lang.Boolean paused)
Sets if this member has been paused.

Since:
0.2

getName

public java.lang.String getName()
Returns the name of the member.

Returns:
the name of the member supplied for logging when the member is added
Since:
1.0.0

setName

public void setName(java.lang.String name)

getMemberName

public java.lang.String getMemberName()
Deprecated. since 1.0.0. Use getName() instead.

Returns the name of the member.

Returns:
the name of the member supplied for logging when the member is added

setMemberName

public void setMemberName(java.lang.String memberName)

Asterisk-Java

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