1 / 7

Hints for the project

Hints for the project. Client. Client. Client. CSCF. HTTP Servlet. Client. Conference Sip Servlet. HSS. CSCF. Client. Client. start. startConf(participantsList). Invite. Invite. Ok. Ok. Ack. Ack. endConf(). end. What to implement?. (user profile). Application Sever. Invite.

Download Presentation

Hints for the project

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Hints for the project

  2. Client Client Client CSCF HTTP Servlet Client Conference Sip Servlet HSS CSCF Client Client start startConf(participantsList) Invite Invite Ok Ok Ack Ack endConf() end What to implement? (user profile) Application Sever Invite Invite Conference application

  3. Communication between HTTP Sevlet & SIP Servlet Field name: ‘name’ • web.xml <listener> <listener-class> ConferenceSipServlet</listener-class> <listener> • HTTP Servlet: private void processRequest (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { ……………………… // if start button was clicked { String name = request.getParameter(“name"); context.setAttribute(“Name", name); } ………….. } name start

  4. Communication between HTTP Sevlet & SIP Servlet Installation of SDS • Conference SIP Servlet: public class ConferenceSipServlet extends SipServlet implements ServletContextAttributeListener { static ServletContext context; ………….. public void attributeAdded(ServletContextAttributeEvent attrEv) { handleTrigger(attrEv); } public void attributeReplaced(ServletContextAttributeEvent attrEv) { handleTrigger(attrEv); } handleTrigger(attrEv){ if (attrEv.getName().equalsIgnoreCase(“Name")) { String name = (String) attrEv.getValue(); …………………….. } }

  5. Installation of SDS Media Handling

  6. HTTP Servlet example Installation of SDS privatevoid processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String action = request.getParameter("action"); if (action != null && action.length() != 0) { if ((action.equals("start"))) // if start button was clicked { String name = request.getParameter("name"); context.setAttribute("Name", name); } else { System.out.println("\n\n\n action=" + action + " not recognized"); } return; } response.setContentType("text/html;charset=UTF-8"); PrintWriter out = response.getWriter(); out.println("<html>"); out.println("<head>"); out.println("<title> My HTTP Servlet</title>"); out.println("</head>"); out.println("<body>"); out.println("<FORM ACTION = \"MyHTTPServlet\" METHOD = POST>"); import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletConfig; import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; publicclass MyHTTPServlet extends javax.servlet.http.HttpServlet Implements javax.servlet.Servlet { staticfinallongserialVersionUID = 1L; boolean targetInitialized = false; static ServletContext context; /* * (non-Java-doc) * * @see javax.servlet.http.HttpServlet#HttpServlet() */ publicvoid init(ServletConfig config) throws ServletException { super.init(config); context = config.getServletContext(); } public MyHTTPServlet() { super(); }

  7. HTTP Servlet example Installation of SDS out.println("Name &nbsp;&nbsp;<input type=\"text\" size=\"10\" maxlength=\"40\" name=\"name\" value=\"nameTest\"> <br />"); out.println("<br/>"); out.println("<input type=\"hidden\" name=\"action\" value=\"start\"/>"); out.println("<INPUT TYPE=SUBMIT NAME=Submit VALUE=\"Start\">"); out.println("</FORM>"); out.println("</body>"); out.println("</html>"); out.close(); }// end processRequest protectedvoid doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } protectedvoid doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } public String getServletInfo() { returnsuper.getServletInfo(); } } //end MyHTTPServlet

More Related