Develop SIP applications that support PRACK on Liberty
A SIP response to an INVITE request can be final or provisional. Final responses are always sent reliably, but provisional responses typically are not. For cases where we need to send a provisional response reliably, we can use the PRACK (Provisional response acknowledgment) method.
To develop applications that support PRACK, the following criteria must be met:
- To indicate that the client supports PRACK, the client that sends the INVITE request must put a 100rel tag in the Supported or the Require header.
- The SIP servlet must respond by invoking the sendReliably() method instead of the send() method.
PRACK is described in the following standards:
- RFC
3262 (
Reliability of Provisional Responses in the Session Initiation Protocol (SIP)
), which extends RFC 3261 (SIP: Session Initiation Protocol
), adding PRACK and the option tag 100rel. - Section 5.7.1 (
Reliable Provisional Responses
) of JSR 289 (SIP Servlet Specification Version 1.1
).
- If we are developing an application that acts as a proxy, make the application generate and send a reliable provisional response for any INVITE request that has no tag in the To field.
- If we are developing an application that acts as a user agent client (UAC), perform the following actions:
- Make the application add the 100rel tag to outgoing INVITE requests. The option tag must appear in either the Supported header or the Require header.
- To create a PRACK request and send the request to the user agent server (UAS), invoke the createPrack() method on the incoming response within the application's doProvisionalResponse(...) method. The container handles the RAck header as defined in JSR 289 Section 5.7.1.
- The application that acts as an UAC receives a final 2xx-6xx response on the PRACK, which the UAC can handle with a doResponse() method.
- If we are developing an application that acts as a user agent server (UAS), perform the following actions:
-
Note: If an incoming INVITE request requires the 100rel tag, trying to send a 101-199 response unreliably using the send() method causes an exception.
- In the application, declare a SipErrorListener object to receive noPrackReceived() events when a reliable provisional response is not acknowledged within 64*T1 seconds, where T1 is a SIP timer. Within the noPrackReceived() event processing, the application generates and sends a 5xx error response for the associated INVITE request per JSR 116 Section 6.7.1.
- The application can have at most one outstanding, unacknowledged reliable provisional response. Trying to send another one before the first is acknowledged results in an exception.
- Make sure that the application enforces the RFC 3262 offer/answer semantics for PRACK requests containing session descriptions. Specifically, a servlet must not send a 2xx final response if any unacknowledged provisional responses contained a session description.
-