|
NIST SIP Parser and Stack (v1.2) API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gov.nist.javax.sip.SipProviderImpl
Implementation of the JAIN-SIP provider interface.
Constructor Summary | |
SipProviderImpl()
Creates a new instance of SipProviderImpl |
Method Summary | |
void |
addSipListener(SipListener sipListener)
This method registers the SipListener object to this SipProvider, once registered the SIP Listener can send events on the SipProvider and recieve events emitted from the SipProvider. |
boolean |
equals(Object obj)
|
ListeningPoint |
getListeningPoint()
Returns the ListeningPoint of this SipProvider. |
CallIdHeader |
getNewCallId()
Returns a unique CallIdHeader for identifying dialogues between two SIP applications. |
ClientTransaction |
getNewClientTransaction(Request request)
Once an application wants to a send a new request it must first request a new client transaction identifier. |
ServerTransaction |
getNewServerTransaction(Request request)
An application has the responsibility of deciding to respond to a Request that does not match an existing server transaction. |
SipStack |
getSipStack()
Returns the SipStack that this SipProvider is attached to. |
void |
handleEvent(EventObject sipEvent)
Handle the SIP event - because we have only one listener and we are already in the context of a separate thread, we dont need to enque the event and signal another thread. |
void |
removeSipListener(SipListener sipListener)
Removes the SipListener from this SipProvider. |
void |
sendRequest(ClientTransaction clientTransaction,
Request request)
Sends specified Request on a unique
client transaction identifier. |
void |
sendResponse(ServerTransaction serverTransaction,
Response response)
Sends specified Response message to a Request which is identified by the specified server transaction identifier. |
void |
sendStatelessRequest(Request request)
Sends specified Request and returns void i.e.
|
void |
sendStatelessResponse(Response response)
Sends specified Response and returns void i.e.
|
void |
setListeningPoint(ListeningPoint listeningPoint)
This method sets the listening point of the SipProvider. |
void |
transactionErrorEvent(SIPTransactionErrorEvent transactionErrorEvent)
Invoked when an error has ocurred with a transaction. |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SipProviderImpl()
Method Detail |
public void handleEvent(EventObject sipEvent)
sipEvent
- is the event to process.public boolean equals(Object obj)
equals
in class Object
public void addSipListener(SipListener sipListener) throws TooManyListenersException
If an attempt is made to re-register the existing SipListener this method returns silently. A previous SipListener must be removed from the SipProvider before another SipListener can be registered to the SipProvider.
addSipListener
in interface SipProvider
sipListener
- the SipListener to be registered with the SipProvider.
TooManyListenersException
- this exception is thrown when a new
SipListener attempts to register with the SipProvider when another
SipListener is already registered with this SipProvider.public ListeningPoint getListeningPoint()
getListeningPoint
in interface SipProvider
ListeningPoint
public CallIdHeader getNewCallId()
getNewCallId
in interface SipProvider
public ClientTransaction getNewClientTransaction(Request request) throws TransactionUnavailableException
getNewClientTransaction
in interface SipProvider
request
- the new Request message that is to handled statefully by
the SipProvider.
TransactionUnavailableException
- if a new transaction can not be created, for example
the next hop of the request can not be determined.ClientTransaction
public ServerTransaction getNewServerTransaction(Request request) throws TransactionAlreadyExistsException, TransactionUnavailableException
getNewServerTransaction
in interface SipProvider
request
- the Request message that the doesn't match an existing
transaction that the application decides to handle statefully.
TransactionAlreadyExistsException
- if a transaction already exists
that is already handling this Request. This may happen if the application
gets retransmits of the same request before the initial transaction is
allocated.
TransactionUnavailableException
- if a new transaction can not be created, for example
the next hop of the request can not be determined.ServerTransaction
public SipStack getSipStack()
getSipStack
in interface SipProvider
SipStack
public void removeSipListener(SipListener sipListener)
removeSipListener
in interface SipProvider
public void sendRequest(ClientTransaction clientTransaction, Request request) throws SipException
Request
on a unique
client transaction identifier. This method implies that the application
is functioning as either a User Agent Client or a Stateful proxy, hence
the underlying SipProvider acts statefully.
JAIN SIP defines a retransmission utility specific to user agent behaviour and the default retransmission behaviour for each method.
When an application wishes to send a message, it creates a Request message passes that Request to this method, this method returns the cleintTransactionId generated by the SipProvider. The Request message gets sent via the ListeningPoint that this SipProvider is attached to.
sendRequest
in interface SipProvider
clientTransaction
- - the new ClientTransaction object identifying
this transaction.request
- - the new Request message to send.
SipException
- if implementation cannot send request for any reasonRequest
,
ClientTransaction
public void sendResponse(ServerTransaction serverTransaction, Response response) throws TransactionDoesNotExistException, SipException
SipListener.processRequest(RequestEvent)
.
Note that when a UAS core sends a 2xx response to an INVITE, the server transaction is destroyed, by the underlying JAIN SIP implementation. This means that when the ACK sent by the corresponding UAC arrives at the UAS, there will be no matching server transaction for the ACK, and based on this rule, the ACK is passed to the UAS application core, where it is processed. This ensures that the three way handsake of an INVITE that is managed by the UAS application and not JAIN SIP.
sendResponse
in interface SipProvider
response
- - the Response to send to the RequestserverTransaction
- the ServerTransaction of the Request upon which
this Response is sent.
TransactionDoesNotExistException
- if the serverTransactionId does
not correspond to any existing server transactions
SipException
- if implementation cannot send response for any
other reasonResponse
,
ServerTransaction
public void sendStatelessRequest(Request request) throws SipException
Request
and returns void i.e.
no transaction record is associated with this action. This method
implies that the application is functioning statelessly specific to this
Request, hence the underlying SipProvider acts statelessly.
Once the Request message has been passed to this method, the SipProvider will forget about this Request. No transaction semantics will be associated with the Request and no retranmissions will occur on the Request by the SipProvider, if these semantics are required it is the responsibility of the application not the JAIN SIP Stack.
sendStatelessRequest
in interface SipProvider
request
- - the Request message to send statelessly
SipException
- if implementation cannot send request for any reasonRequest
public void sendStatelessResponse(Response response) throws SipException
Response
and returns void i.e.
no transaction record is associated with this action. This method implies
that the application is functioning as either a stateless proxy or a
stateless User Agent Server.
sendStatelessResponse
in interface SipProvider
response
- - the Response to send statelessly.
SipException
- if implementation cannot send
response for any reasonResponse
,
Response
public void setListeningPoint(ListeningPoint listeningPoint)
JAIN SIP supports recieving messages from any port and interface that a server listens on for UDP, on that same port and interface for TCP in case a message may need to be sent using TCP, rather than UDP, if it is too large. In order to satisfy this functionality an application must create two SipProviders and set identical listeningPoints except for transport on each SipProvder.
Multiple SipProviders are prohibited to listen on the same listening point.
setListeningPoint
in interface SipProvider
listeningPoint
- the ListeningPoint of this SipProvider.ListeningPoint
public void transactionErrorEvent(SIPTransactionErrorEvent transactionErrorEvent)
transactionErrorEvent
in interface SIPTransactionEventListener
transactionErrorEvent
- Error event.
|
NIST SIP Parser and Stack (v1.2) API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |