SipServletResponse
The SipServletResponse interface represents SIP responses in the SIP Servlet API. It extends the ServletResponse and SipServletMessage interfaces, inheriting generic servlet response functionalities and shared SIP message behaviors. Additionally, it adds methods specific to SIP responses.
This interface allows servlets to handle incoming SIP responses received from the container and to generate SIP responses as User Agent (UA) servers or proxies. It provides tools for managing response status codes, headers, and content.
SIP responses indicate the outcome of a corresponding SIP request. Each SIP response is defined by a three-digit status code that describes the result of the request, providing information about its progress, success, redirection, or failure. Responses with a status code in the range 100–199 are called provisional or informational and indicate the progress of the request. Any response with a status code of 200 or higher is the final response. A UA server may send only one final response per request, but this may be preceded by any number of provisional responses.
1xx: Informational Responses – Provisional responses that indicate progress in processing the request.
2xx: Successful Responses – Indicate that the request was successfully processed.
3xx: Redirection Responses – Indicate that further action is needed to complete the request.
4xx: Client Error Responses – Indicate issues with the request that prevent it from being fulfilled.
5xx: Server Error Responses – Indicate that the server failed to process an apparently valid request.
6xx: Global Failure Responses – Indicate that the request cannot be fulfilled by any server.
When the SIP Servlet container receives an incoming SIP response, it creates a SipServletResponse object and passes it to the appropriate servlet. This allows the application to process the response, including headers, content, and status codes.
Servlets acting as UA servers or proxies can generate and send SIP responses. These responses may include provisional (1xx) and final (2xx–6xx) responses to indicate the outcome of the request.
The SipServletResponse interface adheres to the SIP specification as outlined in RFC 3261.
It also adds support for SIP-specific behaviors, such as generating responses with specific status codes and managing SIP transaction states.
Important Note:
The setCharacterEncoding() method in this interface does not throw java.io.UnsupportedEncodingException, unlike its counterpart in SipServletMessage. Instead, it inherits a more generic version of the method from the ServletResponse interface, in accordance with the Servlet specification version 2.4.
Sign in to read the full article
Start innovating with Mobius
What's next? Let's talk!