UAC Sending Keep-Alive
If a SIP Servlet acting as a User Agent Client (UAC) sends a REGISTER request with the headers required for RFC 5626 support, on receiving a 200 response to such a request, if that response contains an outbound option-tag in the Require header field, Converged Application Server starts sending keep-alive messages. These keep-alive messages may be double Carriage Return Line Feeds (CRLFs) for connection-oriented transports, such as TCP and Session Traversal Utilities for NAT (STUN) binding requests as described in RFC 5626.
Example 8-1 shows an implementation of such a UAC:
Example 8-1 UAC Keep-Alive
void sendRegister(SipServletRequest register) throws Exception { register.setHeader("Supported", "path,outbound"); // Add the instance ID... Parameterable contact = register.getParameterableHeader("Contact"); contact.setParameter("+sip.instance", <instanceId>); // Add the registration ID... contact.setParameter("reg-id", <registrationId>); register.send(); } // The container starts sending keep-alive messages... @SuccessResponse public void handle200ok (SipServletResponse resp) { Flow flow = resp.getSession().getFlow(); }