local.server
Class StatefulProxy

java.lang.Object
  |
  +--local.server.ServerEngine
        |
        +--local.server.Registrar
              |
              +--local.server.Proxy
                    |
                    +--local.server.StatefulProxy
All Implemented Interfaces:
org.zoolu.sip.provider.SipProviderListener, org.zoolu.sip.transaction.TransactionClientListener

public class StatefulProxy
extends Proxy
implements org.zoolu.sip.transaction.TransactionClientListener

StatefulProxy server. Class StatefulProxy implement a stateful SIP proxy server. It extends class Registrar. A StatefulProxy can work as simply SIP proxy, or it can handle calls for registered users.


Field Summary
protected  org.zoolu.sip.provider.SipProvider sip_provider_client
          SipProvider for client transactions
protected  org.zoolu.sip.provider.SipProvider sip_provider_server
          SipProvider for server transactions
protected  StatefulProxyState state
          Transactions state
 
Fields inherited from class local.server.Registrar
as, AUTHENTICATION_SCHEMES, AUTHENTICATION_SERVER_CLASSES, authentication_service, AUTHENTICATION_SERVICE_CLASSES, AUTHENTICATION_SERVICES, location_service, LOCATION_SERVICE_CLASSES, LOCATION_SERVICES
 
Fields inherited from class local.server.ServerEngine
log, Loop_Tag, server_profile, sip_provider
 
Constructor Summary
protected StatefulProxy()
          Costructs a void StatefulProxy
  StatefulProxy(org.zoolu.sip.provider.SipProvider provider, ServerProfile server_profile)
          Costructs a new StatefulProxy that acts also as location server for registered users.
 
Method Summary
static void main(java.lang.String[] args)
          The main method.
 void onTransFailureResponse(org.zoolu.sip.transaction.TransactionClient transaction, org.zoolu.sip.message.Message resp)
          When the TransactionClient goes into the "Completed" state, receiving a failure response
 void onTransProvisionalResponse(org.zoolu.sip.transaction.TransactionClient transaction, org.zoolu.sip.message.Message resp)
          When the TransactionClient is in "Proceeding" state and receives a new 1xx response
 void onTransSuccessResponse(org.zoolu.sip.transaction.TransactionClient transaction, org.zoolu.sip.message.Message resp)
          When an TransactionClient goes into the "Terminated" state, receiving a 2xx response
 void onTransTimeout(org.zoolu.sip.transaction.TransactionClient transaction)
          When the TransactionClient goes into the "Terminated" state, caused by transaction timeout
protected  void processFailureResponse(org.zoolu.sip.transaction.Transaction transaction, org.zoolu.sip.message.Message resp)
          Process failure response
protected  void processProvisionalResponse(org.zoolu.sip.transaction.Transaction transaction, org.zoolu.sip.message.Message resp)
          Process provisional response
 void processRequestToLocalServer(org.zoolu.sip.message.Message req)
          When a new request is received for the local server
 void processRequestToLocalUser(org.zoolu.sip.message.Message msg)
          When a new request message is received for a local user
 void processRequestToRemoteUA(org.zoolu.sip.message.Message msg)
          When a new request message is received for a remote UA
 void processResponse(org.zoolu.sip.message.Message resp)
          When a new response message is received
protected  void processSuccessResponse(org.zoolu.sip.transaction.Transaction transaction, org.zoolu.sip.message.Message resp)
          Process success response
protected  void processTimeout(org.zoolu.sip.transaction.Transaction transaction)
          Process tmeout
protected  void statefulServerResponse(org.zoolu.sip.transaction.TransactionServer ts, org.zoolu.sip.message.Message resp)
          Sends a server final response
 
Methods inherited from class local.server.Proxy
getPhoneTarget, isPhoneNumber, updateProxingRequest, updateProxingResponse
 
Methods inherited from class local.server.Registrar
getTargets, updateRegistration
 
Methods inherited from class local.server.ServerEngine
getLocalDomains, isResponsibleFor, isResponsibleFor, onReceivedMessage, validateRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

state

protected StatefulProxyState state
Transactions state

sip_provider_client

protected org.zoolu.sip.provider.SipProvider sip_provider_client
SipProvider for client transactions

sip_provider_server

protected org.zoolu.sip.provider.SipProvider sip_provider_server
SipProvider for server transactions
Constructor Detail

StatefulProxy

protected StatefulProxy()
Costructs a void StatefulProxy

StatefulProxy

public StatefulProxy(org.zoolu.sip.provider.SipProvider provider,
                     ServerProfile server_profile)
Costructs a new StatefulProxy that acts also as location server for registered users.
Method Detail

processRequestToLocalServer

public void processRequestToLocalServer(org.zoolu.sip.message.Message req)
When a new request is received for the local server
Overrides:
processRequestToLocalServer in class Proxy

processRequestToLocalUser

public void processRequestToLocalUser(org.zoolu.sip.message.Message msg)
When a new request message is received for a local user
Overrides:
processRequestToLocalUser in class Proxy

processRequestToRemoteUA

public void processRequestToRemoteUA(org.zoolu.sip.message.Message msg)
When a new request message is received for a remote UA
Overrides:
processRequestToRemoteUA in class Proxy

processResponse

public void processResponse(org.zoolu.sip.message.Message resp)
When a new response message is received
Overrides:
processResponse in class Proxy

statefulServerResponse

protected void statefulServerResponse(org.zoolu.sip.transaction.TransactionServer ts,
                                      org.zoolu.sip.message.Message resp)
Sends a server final response

processProvisionalResponse

protected void processProvisionalResponse(org.zoolu.sip.transaction.Transaction transaction,
                                          org.zoolu.sip.message.Message resp)
Process provisional response

processFailureResponse

protected void processFailureResponse(org.zoolu.sip.transaction.Transaction transaction,
                                      org.zoolu.sip.message.Message resp)
Process failure response

processSuccessResponse

protected void processSuccessResponse(org.zoolu.sip.transaction.Transaction transaction,
                                      org.zoolu.sip.message.Message resp)
Process success response

processTimeout

protected void processTimeout(org.zoolu.sip.transaction.Transaction transaction)
Process tmeout

onTransProvisionalResponse

public void onTransProvisionalResponse(org.zoolu.sip.transaction.TransactionClient transaction,
                                       org.zoolu.sip.message.Message resp)
When the TransactionClient is in "Proceeding" state and receives a new 1xx response
Specified by:
onTransProvisionalResponse in interface org.zoolu.sip.transaction.TransactionClientListener

onTransFailureResponse

public void onTransFailureResponse(org.zoolu.sip.transaction.TransactionClient transaction,
                                   org.zoolu.sip.message.Message resp)
When the TransactionClient goes into the "Completed" state, receiving a failure response
Specified by:
onTransFailureResponse in interface org.zoolu.sip.transaction.TransactionClientListener

onTransSuccessResponse

public void onTransSuccessResponse(org.zoolu.sip.transaction.TransactionClient transaction,
                                   org.zoolu.sip.message.Message resp)
When an TransactionClient goes into the "Terminated" state, receiving a 2xx response
Specified by:
onTransSuccessResponse in interface org.zoolu.sip.transaction.TransactionClientListener

onTransTimeout

public void onTransTimeout(org.zoolu.sip.transaction.TransactionClient transaction)
When the TransactionClient goes into the "Terminated" state, caused by transaction timeout
Specified by:
onTransTimeout in interface org.zoolu.sip.transaction.TransactionClientListener

main

public static void main(java.lang.String[] args)
The main method.