local.ua
Class RegisterAgent

java.lang.Object
  |
  +--local.ua.RegisterAgent
All Implemented Interfaces:
java.lang.Runnable, org.zoolu.sip.transaction.TransactionClientListener

public class RegisterAgent
extends java.lang.Object
implements java.lang.Runnable, org.zoolu.sip.transaction.TransactionClientListener

Register User Agent. It registers (one time or periodically) a contact address with a registrar server.


Constructor Summary
RegisterAgent(org.zoolu.sip.provider.SipProvider sip_provider, java.lang.String target_url, java.lang.String contact_url, RegisterAgentListener listener)
          Creates a new RegisterAgent.
RegisterAgent(org.zoolu.sip.provider.SipProvider sip_provider, java.lang.String target_url, java.lang.String contact_url, java.lang.String username, java.lang.String realm, java.lang.String passwd, RegisterAgentListener listener)
          Creates a new RegisterAgent with authentication credentials (i.e. username, realm, and passwd).
 
Method Summary
 void halt()
          Halts the periodic registration.
 boolean isRegistering()
          Whether it is periodically registering.
 void loopRegister(int expire_time, int renew_time)
          Periodically registers with the registrar server.
 void loopRegister(int expire_time, int renew_time, long keepalive_time)
          Periodically registers with the registrar server.
 void onTransFailureResponse(org.zoolu.sip.transaction.TransactionClient transaction, org.zoolu.sip.message.Message resp)
          Callback function called when client sends back a failure response.
 void onTransProvisionalResponse(org.zoolu.sip.transaction.TransactionClient transaction, org.zoolu.sip.message.Message resp)
          Callback function called when client sends back a provisional response.
 void onTransSuccessResponse(org.zoolu.sip.transaction.TransactionClient transaction, org.zoolu.sip.message.Message resp)
          Callback function called when client sends back a success response.
 void onTransTimeout(org.zoolu.sip.transaction.TransactionClient transaction)
          Callback function called when client expires timeout.
 void register()
          Registers with the registrar server.
 void register(int expire_time)
          Registers with the registrar server for expire_time seconds.
 void run()
          Run method
 void unregister()
          Unregister with the registrar server
 void unregisterall()
          Unregister all contacts with the registrar server
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegisterAgent

public RegisterAgent(org.zoolu.sip.provider.SipProvider sip_provider,
                     java.lang.String target_url,
                     java.lang.String contact_url,
                     RegisterAgentListener listener)
Creates a new RegisterAgent.

RegisterAgent

public RegisterAgent(org.zoolu.sip.provider.SipProvider sip_provider,
                     java.lang.String target_url,
                     java.lang.String contact_url,
                     java.lang.String username,
                     java.lang.String realm,
                     java.lang.String passwd,
                     RegisterAgentListener listener)
Creates a new RegisterAgent with authentication credentials (i.e. username, realm, and passwd).
Method Detail

isRegistering

public boolean isRegistering()
Whether it is periodically registering.

register

public void register()
Registers with the registrar server.

register

public void register(int expire_time)
Registers with the registrar server for expire_time seconds.

unregister

public void unregister()
Unregister with the registrar server

unregisterall

public void unregisterall()
Unregister all contacts with the registrar server

loopRegister

public void loopRegister(int expire_time,
                         int renew_time)
Periodically registers with the registrar server.
Parameters:
expire_time - expiration time in seconds
renew_time - renew time in seconds

loopRegister

public void loopRegister(int expire_time,
                         int renew_time,
                         long keepalive_time)
Periodically registers with the registrar server.
Parameters:
expire_time - expiration time in seconds
renew_time - renew time in seconds
keepalive_time - keep-alive packet rate (inter-arrival time) in milliseconds

halt

public void halt()
Halts the periodic registration.

run

public void run()
Run method
Specified by:
run in interface java.lang.Runnable

onTransProvisionalResponse

public void onTransProvisionalResponse(org.zoolu.sip.transaction.TransactionClient transaction,
                                       org.zoolu.sip.message.Message resp)
Callback function called when client sends back a provisional response.
Specified by:
onTransProvisionalResponse in interface org.zoolu.sip.transaction.TransactionClientListener

onTransSuccessResponse

public void onTransSuccessResponse(org.zoolu.sip.transaction.TransactionClient transaction,
                                   org.zoolu.sip.message.Message resp)
Callback function called when client sends back a success response.
Specified by:
onTransSuccessResponse in interface org.zoolu.sip.transaction.TransactionClientListener

onTransFailureResponse

public void onTransFailureResponse(org.zoolu.sip.transaction.TransactionClient transaction,
                                   org.zoolu.sip.message.Message resp)
Callback function called when client sends back a failure response.
Specified by:
onTransFailureResponse in interface org.zoolu.sip.transaction.TransactionClientListener

onTransTimeout

public void onTransTimeout(org.zoolu.sip.transaction.TransactionClient transaction)
Callback function called when client expires timeout.
Specified by:
onTransTimeout in interface org.zoolu.sip.transaction.TransactionClientListener