Simon Pietro Romano – AT 2011 1
Corso di Applicazioni Telematiche A.A. 2010-11
- Prof. Simon Pietro Romano
Prof. Simon Pietro Romano Universit degli Studi di Napoli Federico - - PowerPoint PPT Presentation
Corso di Applicazioni Telematiche A.A. 2010-11 Prof. Simon Pietro Romano Universit degli Studi di Napoli Federico II Facolt di Ingegneria Simon Pietro Romano AT 2011 1 Some background: what is a servlet ? Suns definition: A
Simon Pietro Romano – AT 2011 1
Simon Pietro Romano – AT 2011 2
Simon Pietro Romano – AT 2011 3
Simon Pietro Romano – AT 2011 4
destroy() service() init()
servlet
HTTP Response
Client Servlet Methods
HTTP Response doPut() doPost() doGet() Error Response
Rules
HTTP Response Error Response HTTP Request
Web Container
Simon Pietro Romano – AT 2011 5
Simon Pietro Romano – AT 2011 6
– http://jcp.org/aboutJava/communityprocess/final/jsr116/index.html
– http://jcp.org/aboutJava/communityprocess/final/jsr289/index.html
Simon Pietro Romano – AT 2011 7
Simon Pietro Romano – AT 2011 8
Simon Pietro Romano – AT 2011 9
Simon Pietro Romano – AT 2011 10
destroy() service() init() doInvite() doAck() doOptions() doCancel() doRegister() doPrack() doInfo() doNotify() doMessage() doSubscribe() doProvisionalResponse() doSuccessResponse() doErrorResponse() doRedirectResponse()
doResponse() doRequest()
servlet
Create Request() Create Response()
SIP Message
Client SIP Container SIP Servlet Methods
Rules SIP Message
Simon Pietro Romano – AT 2011 11
– Only handles requests and generates responses
– Handle and generate requests and responses, Session management, Proxying
Simon Pietro Romano – AT 2011 12
Simon Pietro Romano – AT 2011 13
Simon Pietro Romano – AT 2011 14
Simon Pietro Romano – AT 2011 15
Simon Pietro Romano – AT 2011 16
Simon Pietro Romano – AT 2011 17
– such SipSessions are independent, yet related to the same execution of the service – we could think of them as an „application instance‟
– the above identified application instance – holds references to all the SipSessions (as well as HttpSessions in the case of converged applications) – provides methods to store application instance data
Simon Pietro Romano – AT 2011 18
Simon Pietro Romano – AT 2011 19
Simon Pietro Romano – AT 2011 20
Simon Pietro Romano – AT 2011 21
Simon Pietro Romano – AT 2011 22
– the servlet has to:
– the only thing we need is the SipSession; then we can proceed like this:
//Sending BYE because we're done mySipSession.createRequest("BYE"); //Send the request req.send();
– use the SipServletResponse method createACK
– from the request that we want to cancel:
SipServletRequest cancelRequest = inviteRequest.getCancel(); cancelRequest.send();
Simon Pietro Romano – AT 2011 23
Simon Pietro Romano – AT 2011 24
Simon Pietro Romano – AT 2011 25
–
– any other message involved in the proxy operation carried out by this proxy object wil return the same Proxy instance
– recurse:
– recordRoute:
– parallel:
should fork or retry sequentially – stateful:
– supervised:
– responses coming from the downstream are delivered to the servlet
– they are forwarded upstream (if applies) by the container without application involvement
– sequentialSearchTimeout:
before cancelling it
Simon Pietro Romano – AT 2011 26
Simon Pietro Romano – AT 2011 27
protected void doInvite(SipServletRequest req) throws javax.servlet.ServletException, java.io.IOException{ .... //Save the SDP content in a String String sdpContent = new String(req.getRawContent(),req.getCharacterEncoding()); //Use the static method of SdpFactory to //parse the content SessionDescription requestSDP = SdpFactory.createSessionDescription(sdpContent); .... }
Simon Pietro Romano – AT 2011 28
Simon Pietro Romano – AT 2011 29
Simon Pietro Romano – AT 2011 30
– Soak tests (i.e. running the system at high levels of load for
» 100 calls/sec for 24h for a total of 8.640.000 calls on 2x AMD
Simon Pietro Romano – AT 2011 31
Simon Pietro Romano – AT 2011 32
– it basically adds a SIP Servlet programming layer to Openser – users can develop their own services and applications using existing OpenSER modules:
– ...while at the same time enjoying the java programming language facilities:
Simon Pietro Romano – AT 2011 33
Simon Pietro Romano – AT 2011 34
Simon Pietro Romano – AT 2011 35
Simon Pietro Romano – AT 2011 36
Simon Pietro Romano – AT 2011 37
Simon Pietro Romano – AT 2011 38