Asterisk-Java

org.asteriskjava.manager.event
Class PeerStatusEvent

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

public class PeerStatusEvent
extends ManagerEvent

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

Version:
$Id: PeerStatusEvent.java 515 2006-07-24 22:44:23Z srt $
Author:
srt
See Also:
Serialized Form

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 getCause()
          Returns the cause of a rejection or unregistration.
 java.lang.String getPeer()
          Returns the name of the peer that registered.
 java.lang.String getPeerStatus()
          Returns the registration state.
 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 setCause(java.lang.String cause)
          Sets the cause of the rejection or unregistration.
 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 setTime(java.lang.Integer time)
           
 
Methods inherited from class org.asteriskjava.manager.event.ManagerEvent
getDateReceived, getPrivilege, getTimestamp, setDateReceived, setPrivilege, 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

STATUS_REGISTERED

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

STATUS_UNREGISTERED

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

STATUS_REACHABLE

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

STATUS_LAGGED

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

STATUS_UNREACHABLE

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

STATUS_REJECTED

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

PeerStatusEvent

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

getPeer

public java.lang.String getPeer()
Returns the name of the peer that registered. The peer's name starts with "IAX2/" if it is an IAX client or "SIP/" if it is a SIP client. It is followed by the username that is used for registration.


setPeer

public void setPeer(java.lang.String peer)
Sets the name of the peer that registered.


getPeerStatus

public java.lang.String getPeerStatus()
Returns the registration state.

This may be one of


setPeerStatus

public void setPeerStatus(java.lang.String peerStatus)
Sets the registration state.


getCause

public java.lang.String getCause()
Returns the cause of a rejection or unregistration.

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".


setCause

public void setCause(java.lang.String cause)
Sets the cause of the rejection or unregistration.


getTime

public 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.


setTime

public void setTime(java.lang.Integer time)

Asterisk-Java

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