Asterisk-Java

org.asteriskjava.manager.event
Class ExtensionStatusEvent

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

public class ExtensionStatusEvent
extends ManagerEvent

An ExtensionStatusEvent is triggered when the state of an extension changes.

For this to work for you must provide appropriate hints in your dialplan to map channels to extensions.

Example:

exten => 1234,1,Dial(SIP/myuser)
 exten => 1234,hint,SIP/myuser
Hints can also be used to map the state of multiple channels to an extension:
exten => 6789,hint,SIP/user1&SIP/user2
 

It is implemented in manager.c, values for state are defined in include/asterisk/pbx.h.

Version:
$Id: ExtensionStatusEvent.java 1087 2008-08-08 19:22:24Z srt $
Author:
srt
See Also:
Serialized Form

Field Summary
static int BUSY
          All devices BUSY.
static int INUSE
          One or more devices INUSE.
static int NOT_INUSE
          No device INUSE or BUSY.
static int RINGING
          One or more devices RINGING.
static int UNAVAILABLE
          All devices UNAVAILABLE/UNREGISTERED.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
ExtensionStatusEvent(java.lang.Object source)
           
 
Method Summary
 java.lang.String getCallerId()
          Returns the Caller*ID in the form "Some Name" <1234>.
 java.lang.String getContext()
          Returns the context of the extension.
 java.lang.String getExten()
          Returns the extension.
 java.lang.String getHint()
          Returns the hint assigned to the extension.
 java.lang.Integer getStatus()
          Returns the state of the extension.
 void setCallerId(java.lang.String callerId)
          Sets the Caller*ID.
 void setContext(java.lang.String context)
          Sets the context of the extension.
 void setExten(java.lang.String exten)
          Sets the extension.
 void setHint(java.lang.String hint)
           
 void setStatus(java.lang.Integer status)
          Sets the state of the extension.
 
Methods inherited from class org.asteriskjava.manager.event.ManagerEvent
appendPropertyIfNotNull, getDateReceived, getFile, getFunc, getLine, getPrivilege, getSequenceNumber, getServer, getTimestamp, setDateReceived, setFile, setFunc, setLine, setPrivilege, setSequenceNumber, 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

NOT_INUSE

public static final int NOT_INUSE
No device INUSE or BUSY.

See Also:
Constant Field Values

INUSE

public static final int INUSE
One or more devices INUSE.

See Also:
Constant Field Values

BUSY

public static final int BUSY
All devices BUSY.

See Also:
Constant Field Values

UNAVAILABLE

public static final int UNAVAILABLE
All devices UNAVAILABLE/UNREGISTERED.

See Also:
Constant Field Values

RINGING

public static final int RINGING
One or more devices RINGING.

See Also:
Constant Field Values
Constructor Detail

ExtensionStatusEvent

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

getExten

public java.lang.String getExten()
Returns the extension.


setExten

public void setExten(java.lang.String exten)
Sets the extension.


getContext

public java.lang.String getContext()
Returns the context of the extension.


setContext

public void setContext(java.lang.String context)
Sets the context of the extension.


getHint

public java.lang.String getHint()
Returns the hint assigned to the extension. The hint is used to map a channel (e.g. "SIP/123") to an extension (e.g. "123").

Available since Asterisk 1.6.

Returns:
the hint (channel name) assigned to the extension.
Since:
1.0.0

setHint

public void setHint(java.lang.String hint)

getStatus

public java.lang.Integer getStatus()
Returns the state of the extension.

Possible values are:

  • RINGING
  • INUSE | RINGING
  • INUSE
  • NOT_INUSE
  • BUSY
  • UNAVAILABLE

setStatus

public void setStatus(java.lang.Integer status)
Sets the state of the extension.


getCallerId

public java.lang.String getCallerId()
Returns the Caller*ID in the form "Some Name" <1234>.

This property is only available on BRIstuffed Asterisk servers.

Returns:
the Caller*ID.
Since:
0.3

setCallerId

public void setCallerId(java.lang.String callerId)
Sets the Caller*ID.

Parameters:
callerId - the Caller*ID.
Since:
0.3

Asterisk-Java

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