Version

SipServlet

The SipServlet class is the core component of the SIP Servlet API. It handles incoming SIP messages and generates appropriate responses. It provides lifecycle methods that can be overridden to customize SIP request and response handling, similar to the HttpServlet in the HTTP Servlet API.
The SipServlet processes incoming SIP messages using the service method, which distinguishes between requests and responses:

  • For requests, the doRequest method is invoked.
  • For responses, the doResponse method is invoked.

These methods further dispatch processing to specific handler methods based on the SIP request type (e.g., INVITE, BYE) or response status code (e.g., 200 OK, 404 Not Found).
The SipServlet class provides specific methods to handle each type of SIP request and response. Developers can override these methods to define custom behavior.
The default implementation of doAck, doCancel and all the response handling methods are empty. All other request handling methods reject the request with a 500 error response. This behavior ensures that unhandled requests are safely rejected while allowing developers to override only the methods relevant to their application.
Subclasses of SipServlet will typically override one or more of the request and response handling methods to implement application-specific logic.

Sign in to read the full article

Start innovating with Mobius

What's next? Let's talk!

Mobius Software

As a company you'll get:

  • Get started quickly

  • Support any business model

  • Join millions of businesses

Questions? websupport@mobius.com