public class PeerStatusEvent extends ManagerEvent
This event is implemented in channels/chan_iax2.c
and
channels/chan_sip.c
Modifier and Type | Field and Description |
---|---|
static String |
STATUS_LAGGED |
static String |
STATUS_REACHABLE |
static String |
STATUS_REGISTERED |
static String |
STATUS_REJECTED |
static String |
STATUS_UNREACHABLE |
static String |
STATUS_UNREGISTERED |
source
Constructor and Description |
---|
PeerStatusEvent(Object source) |
Modifier and Type | Method and Description |
---|---|
String |
getAddress()
Returns the IP address of the peer that registered.
|
String |
getCause()
Returns the cause of a rejection or unregistration.
|
String |
getChannelType()
Returns the type of channel that registers, that is "IAX2" for an IAX2
channel or "SIP" for a SIP channel.
|
String |
getPeer()
Returns the name of the peer that registered.
|
String |
getPeerStatus()
Returns the registration state.
|
Integer |
getPort()
Returns the port of the peer that registered.
|
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(String address) |
void |
setCause(String cause)
Sets the cause of the rejection or unregistration.
|
void |
setChannelType(String channelType)
Sets the type of channel that registers.
|
void |
setPeer(String peer)
Sets the name of the peer that registered.
|
void |
setPeerStatus(String peerStatus)
Sets the registration state.
|
void |
setPort(Integer port) |
void |
setTime(Integer time) |
appendPropertyIfNotNull, getDateReceived, getFile, getFunc, getLine, getPrivilege, getSequenceNumber, getServer, getTimestamp, setDateReceived, setFile, setFunc, setLine, setPrivilege, setSequenceNumber, setServer, setTimestamp, toString
getSource
public static final String STATUS_REGISTERED
public static final String STATUS_UNREGISTERED
public static final String STATUS_REACHABLE
public static final String STATUS_LAGGED
public static final String STATUS_UNREACHABLE
public static final String STATUS_REJECTED
public PeerStatusEvent(Object source)
source
- public String getChannelType()
Available since Asterisk 1.6.
public void setChannelType(String channelType)
channelType
- the type of channel that registerspublic 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".
Peer names for IAX clients start with "IAX2/", peer names for SIP clients start with "SIP/".
public void setPeer(String peer)
public String getPeerStatus()
This may be one of
public void setPeerStatus(String peerStatus)
public 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(String cause)
public Integer getTime()
public void setTime(Integer time)
public String getAddress()
Available since Asterisk 1.6.
null
if not available.public void setAddress(String address)
public Integer getPort()
Available since Asterisk 1.6.
null
if not available.public void setPort(Integer port)
Copyright © 2004–2016. All rights reserved.