org.mobicents.servlet.sip.core.dispatchers
Class CancelRequestDispatcher
java.lang.Object
org.mobicents.servlet.sip.core.dispatchers.MessageDispatcher
org.mobicents.servlet.sip.core.dispatchers.RequestDispatcher
org.mobicents.servlet.sip.core.dispatchers.CancelRequestDispatcher
public class CancelRequestDispatcher
- extends RequestDispatcher
This class implements the logic for routing CANCEL requests along the
application path followed by the INVITE.
CANCEL deserves a special
treatment since they are routed hop by hop.
Algorithm used : We can distinguish 2 cases here as per spec :
-
Applications that acts as User Agent or B2BUA 11.2.3 Receiving CANCEL :
When a CANCEL is received for a request which has been passed to an
application, and the application has not responded yet or proxied the
original request, the container responds to the original request with a 487
(Request Terminated) and to the CANCEL with a 200 OK final response, and it
notifies the application by passing it a SipServletRequest object
representing the CANCEL request. The application should not attempt to
respond to a request after receiving a CANCEL for it. Neither should it
respond to the CANCEL notification. Clearly, there is a race condition
between the container generating the 487 response and the SIP servlet
generating its own response. This should be handled using standard Java
mechanisms for resolving race conditions. If the application wins, it will
not be notified that a CANCEL request was received. If the container wins and
the servlet tries to send a response before (or for that matter after) being
notified of the CANCEL, the container throws an IllegalStateException.
-
Applications that acts as proxy :
10.2.6 Receiving CANCEL if the original
request has not been proxied yet the container responds to it with a 487
final response otherwise, all branches are cancelled, and response processing
continues as usual In either case, the application is subsequently invoked
with the CANCEL request. This is a notification only, as the server has
already responded to the CANCEL and cancelled outstanding branches as
appropriate. The race condition between the server sending the 487 response
and the application proxying the request is handled as in the UAS case as
discussed in section 11.2.3 Receiving CANCEL.
- Author:
- Jean Deruelle
| Fields inherited from class org.mobicents.servlet.sip.core.dispatchers.MessageDispatcher |
APP_NOT_DEPLOYED, FINAL_RESPONSE, GENERATED_APP_KEY, MODIFIER, NO_APP_RETURNED, ROUTE_PARAM_DIRECTIVE, ROUTE_PARAM_NODE_HOST, ROUTE_PARAM_NODE_PORT, ROUTE_PARAM_PREV_APPLICATION_NAME, RR_PARAM_APPLICATION_NAME, RR_PARAM_PROXY_APP, sipApplicationDispatcher |
|
Method Summary |
void |
dispatchMessage(javax.sip.SipProvider sipProvider,
SipServletMessageImpl sipServletMessage)
Responsible for routing and dispatching a SIP message to the correct application |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CancelRequestDispatcher
public CancelRequestDispatcher(SipApplicationDispatcher sipApplicationDispatcher)
dispatchMessage
public void dispatchMessage(javax.sip.SipProvider sipProvider,
SipServletMessageImpl sipServletMessage)
throws DispatcherException
- Responsible for routing and dispatching a SIP message to the correct application
- Specified by:
dispatchMessage in class MessageDispatcher
- Parameters:
sipProvider - use the sipProvider to route the message if needed, can be nullsipServletMessage - the SIP message to route and dispatch
- Throws:
DispatcherException
Copyright © 2009. All Rights Reserved.