The javax.servlet.sip.annotation.SipApplicatonKey method-level annotation associates an incoming request with a particular SIpApplicationSession instance.
The method annotated by @SipApplicationKey must:
Be public.
Be static.
Return a String.
Define a single argument of type SipServletRequest.
Not modify the passed-in SipServletRequest object.
The returned String is the key used to associate the request with a SipApplicationSession instance.
@SipApplication package com.example.sip; ... public class MySipApplication { @SipApplicationKey public static String sessionKey (SipServletRequest req) { return hash(req.getRequestURI() + getDomain(req.getFrom()); } }
Only one @SipApplicationKey method should be defined for a particular SIP application.
Table 1–6 @SipApplicationKey Elements
Element |
Description |
---|---|
applicationName |
Explicitly associates the SIP application key with a particular SIP application. This element is optional. |