net.sf.asterisk.manager.event
Class PeerStatusEvent

java.lang.Object
  extended by java.util.EventObject
      extended by net.sf.asterisk.manager.event.ManagerEvent
          extended by net.sf.asterisk.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,v 1.3 2005/08/28 10:37:55 srt Exp $
Author:
srt
See Also:
Serialized Form

Field Summary
 
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.
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.
 java.lang.String getPeer()
          Returns the name of the peer that registered.
 java.lang.String getPeerStatus()
          Returns the registration state.
This may be one of Registered Unregistered Reachable Lagged Unreachable Rejected (IAX only)
 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 net.sf.asterisk.manager.event.ManagerEvent
getDateReceived, getPrivilege, setDateReceived, setPrivilege, 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
 

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)


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