Asterisk-Java

org.asteriskjava.manager.event
Class RegistryEvent

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

public class RegistryEvent
extends ManagerEvent

A RegistryEvent is triggered when this asterisk server attempts to register as a client at another SIP or IAX server.

This event is implemented in channels/chan_iax2.c and channels/chan_sip.c

Version:
$Id: RegistryEvent.java 1108 2008-08-16 11:22:50Z srt $
Author:
srt
See Also:
Serialized Form

Field Summary
static java.lang.String STATUS_AUTH_SENT
           
static java.lang.String STATUS_NO_AUTHENTICATION
           
static java.lang.String STATUS_REGISTERED
           
static java.lang.String STATUS_REJECTED
           
static java.lang.String STATUS_REQUEST_SENT
           
static java.lang.String STATUS_TIMEOUT
           
static java.lang.String STATUS_UNREACHABLE
           
static java.lang.String STATUS_UNREGISTERED
           
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
RegistryEvent(java.lang.Object source)
           
 
Method Summary
 java.lang.String getCause()
          Returns the cause of a rejected registration.
 java.lang.String getChannel()
          Deprecated.  
 java.lang.String getChannelDriver()
          Deprecated.  
 java.lang.String getChannelType()
          Returns the type of channel that is registered, that is "IAX2" for an IAX2 channel or "SIP" for a SIP channel.
 java.lang.String getDomain()
          Returns the domain or host name of the SIP or IAX2 server.
 java.lang.String getStatus()
          Returns the registration state.
 java.lang.String getUsername()
          Returns the username used for registration.
 void setCause(java.lang.String cause)
          Sets the cause of a rejected registration.
 void setChannel(java.lang.String channel)
          Deprecated.  
 void setChannelDriver(java.lang.String channelDriver)
          Deprecated.  
 void setChannelType(java.lang.String channelType)
          Sets the type of channel that is registered.
 void setDomain(java.lang.String domain)
          Sets the domain or host name of the SIP or IAX2 server.
 void setStatus(java.lang.String status)
          Sets the registration state.
 void setUser(java.lang.String username)
          Deprecated. Please do not use this method it is a workaround for Asterisk 1.0.x servers. See Asterisk bug 4916.
 void setUsername(java.lang.String username)
          Sets the username used for registration.
 
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

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_REQUEST_SENT

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

STATUS_AUTH_SENT

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

STATUS_REJECTED

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

STATUS_TIMEOUT

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

STATUS_NO_AUTHENTICATION

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

STATUS_UNREACHABLE

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

RegistryEvent

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

getChannelType

public java.lang.String getChannelType()
Returns the type of channel that is registered, that is "IAX2" for an IAX2 channel or "SIP" for a SIP channel.

Returns:
the type of channel that is registered.
Since:
1.0.0

setChannelType

public void setChannelType(java.lang.String channelType)
Sets the type of channel that is registered.

Parameters:
channelType - the type of channel that is registered.
Since:
1.0.0

getChannelDriver

public java.lang.String getChannelDriver()
Deprecated. 

Returns the type of channel that is registered, that is "IAX2" for an IAX2 channel or "SIP" for a SIP channel.

Since:
0.3
See Also:
getChannelType()

setChannelDriver

public void setChannelDriver(java.lang.String channelDriver)
Deprecated. 

Sets the type of channel that is registered.

Since:
0.3
See Also:
setChannelType(String)

getChannel

public java.lang.String getChannel()
Deprecated. 

Returns the type of channel that is registered, that is "IAX2" for an IAX2 channel or "SIP" for a SIP channel.

See Also:
getChannelType()

setChannel

public void setChannel(java.lang.String channel)
Deprecated. 

Sets the type of channel that is registered.

See Also:
setChannelType(String)

getDomain

public java.lang.String getDomain()
Returns the domain or host name of the SIP or IAX2 server.

This is the host part used in the register lines in iax.conf and sip.conf.

Returns:
the domain or host name of the SIP or IAX2 server.

setDomain

public void setDomain(java.lang.String domain)
Sets the domain or host name of the SIP or IAX2 server.

Parameters:
domain - the domain or host name of the SIP or IAX2 server.

getUsername

public java.lang.String getUsername()
Returns the username used for registration.

SIP send the username in case of a registration timeout, IAX2 in case of a registration failure. Otherwise the username is null.

Returns:
the username used for registration.

setUsername

public void setUsername(java.lang.String username)
Sets the username used for registration.

Parameters:
username - the username used for registration.

setUser

public void setUser(java.lang.String username)
Deprecated. Please do not use this method it is a workaround for Asterisk 1.0.x servers. See Asterisk bug 4916.

Sets the username used for registration.

See Also:
setUsername(String)

getStatus

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

For sip this may be one of (not sure if all of these are exposed via the manager api, at least "Registered" and "Timeout" are used though)

IAX2 only uses Successful IAX2 registrations do not use the this property at all.

Returns:
the registration state.

setStatus

public void setStatus(java.lang.String status)
Sets the registration state.

Parameters:
status - the registration state.

getCause

public java.lang.String getCause()
Returns the cause of a rejected registration.

Returns:
the cause of a rejected registration or null if the cause is unknown.
Since:
0.2

setCause

public void setCause(java.lang.String cause)
Sets the cause of a rejected registration.

Parameters:
cause - the cause of a rejected registration.
Since:
0.2

Asterisk-Java

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