|
Asterisk-Java | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.EventObject
org.asteriskjava.manager.event.ManagerEvent
org.asteriskjava.manager.event.PeerStatusEvent
public class PeerStatusEvent
A PeerStatusEvent is triggered when a SIP or IAX client attempts to registrer at this asterisk server.
This event is implemented in channels/chan_iax2.c
and
channels/chan_sip.c
Field Summary | |
---|---|
static java.lang.String |
STATUS_LAGGED
|
static java.lang.String |
STATUS_REACHABLE
|
static java.lang.String |
STATUS_REGISTERED
|
static java.lang.String |
STATUS_REJECTED
|
static java.lang.String |
STATUS_UNREACHABLE
|
static java.lang.String |
STATUS_UNREGISTERED
|
Fields inherited from class java.util.EventObject |
---|
source |
Constructor Summary | |
---|---|
PeerStatusEvent(java.lang.Object source)
|
Method Summary | |
---|---|
java.lang.String |
getAddress()
Returns the IP address of the peer that registered. |
java.lang.String |
getCause()
Returns the cause of a rejection or unregistration. |
java.lang.String |
getChannelType()
Returns the type of channel that registers, that is "IAX2" for an IAX2 channel or "SIP" for a SIP channel. |
java.lang.String |
getPeer()
Returns the name of the peer that registered. |
java.lang.String |
getPeerStatus()
Returns the registration state. |
java.lang.Integer |
getPort()
Returns the port of the peer that registered. |
java.lang.Integer |
getTime()
Returns the ping time of the client if status equals "Reachable" or "Lagged"; if the status equals "Unreachable" it returns how long the last response took (in ms) for IAX peers or -1 for SIP peers. |
void |
setAddress(java.lang.String address)
|
void |
setCause(java.lang.String cause)
Sets the cause of the rejection or unregistration. |
void |
setChannelType(java.lang.String channelType)
Sets the type of channel that registers. |
void |
setPeer(java.lang.String peer)
Sets the name of the peer that registered. |
void |
setPeerStatus(java.lang.String peerStatus)
Sets the registration state. |
void |
setPort(java.lang.Integer port)
|
void |
setTime(java.lang.Integer time)
|
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 |
---|
public static final java.lang.String STATUS_REGISTERED
public static final java.lang.String STATUS_UNREGISTERED
public static final java.lang.String STATUS_REACHABLE
public static final java.lang.String STATUS_LAGGED
public static final java.lang.String STATUS_UNREACHABLE
public static final java.lang.String STATUS_REJECTED
Constructor Detail |
---|
public PeerStatusEvent(java.lang.Object source)
source
- Method Detail |
---|
public java.lang.String getChannelType()
Available since Asterisk 1.6.
public void setChannelType(java.lang.String channelType)
channelType
- the type of channel that registerspublic java.lang.String getPeer()
The peer name includes the channel type prefix. So if you receive a PeerStatusEvent for a
SIP peer defined as "john" in sip.conf
this method returns "SIP/john".
public void setPeer(java.lang.String peer)
public java.lang.String getPeerStatus()
This may be one of
public void setPeerStatus(java.lang.String peerStatus)
public java.lang.String getCause()
For IAX peers this is set only if the status equals "Rejected".
For SIP peers this is set if the status equals "Unregistered" and the peer was unregistered due to an expiration. In that case the cause is set to "Expired".
public void setCause(java.lang.String cause)
public java.lang.Integer getTime()
public void setTime(java.lang.Integer time)
public java.lang.String getAddress()
Available since Asterisk 1.6.
null
if not available.public void setAddress(java.lang.String address)
public java.lang.Integer getPort()
Available since Asterisk 1.6.
null
if not available.public void setPort(java.lang.Integer port)
|
Asterisk-Java | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |