Asterisk-Java

org.asteriskjava.manager.event
Class MusicOnHoldEvent

java.lang.Object
  extended by java.util.EventObject
      extended by org.asteriskjava.manager.event.ManagerEvent
          extended by org.asteriskjava.manager.event.MusicOnHoldEvent
All Implemented Interfaces:
java.io.Serializable

public class MusicOnHoldEvent
extends ManagerEvent

A MusicOnHoldEvent is triggered when music on hold starts or stops on a channel.

It is implemented in res/res_musiconhold.c.

Available since Asterisk 1.6

Since:
1.0.0
Version:
$Id: MusicOnHoldEvent.java 1135 2008-08-18 13:46:59Z srt $
Author:
srt
See Also:
Serialized Form

Field Summary
static java.lang.String STATE_START
           
static java.lang.String STATE_STOP
           
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
MusicOnHoldEvent(java.lang.Object source)
           
 
Method Summary
 java.lang.String getChannel()
          Returns the name of the channel.
 java.lang.String getState()
          Returns the state.
 java.lang.String getUniqueId()
          Returns the unique id of the channel.
 boolean isStart()
          Returns whether this is a start event.
 boolean isStop()
          Returns whether this is a stop event.
 void setChannel(java.lang.String channel)
          Sets the name of the channel.
 void setState(java.lang.String state)
           
 void setUniqueId(java.lang.String uniqueId)
          Sets the unique id of the channel.
 
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

STATE_START

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

STATE_STOP

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

MusicOnHoldEvent

public MusicOnHoldEvent(java.lang.Object source)
Method Detail

getChannel

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

Returns:
channel the name of the channel.

setChannel

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

Parameters:
channel - the name of the channel.

getUniqueId

public java.lang.String getUniqueId()
Returns the unique id of the channel.

Returns:
the unique id of the channel.

setUniqueId

public void setUniqueId(java.lang.String uniqueId)
Sets the unique id of the channel.

Parameters:
uniqueId - the unique id of the channel.

getState

public java.lang.String getState()
Returns the state. This is either "Start" or "Stop" depending on whether music on hold started or stopped on the channel.

Returns:
"Start" if music on hold started or "Stop" if music on hold stopped on the channel.
See Also:
STATE_START, STATE_STOP, isStart(), isStop()

setState

public void setState(java.lang.String state)

isStart

public boolean isStart()
Returns whether this is a start event.

Returns:
true if this a start event, false otherwise.

isStop

public boolean isStop()
Returns whether this is a stop event.

Returns:
true if this an stop event, false otherwise.

Asterisk-Java

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