SIP Servlet Development Example Explained

Source: Internet
Author: User

The development example of this blog post must be based on the previous SIP servlet development environment configuration, and if the SIP servlet development environment is not properly configured, refer to the SIP servlet development environment Configuration chapter.

First, we create a dynamic WEB Project project called "Siptest", based on the method mentioned in the previous article, as shown in:

In this project, it is very important to have a file, which is the Sip.xml file in the Web-inf directory, which is the startup initialization parameter loading file for the entire SIP servlet project. It contains the name of the SIP servlet that is loaded in the container and the class that handles the SIP request and response. The Sip.xml file in this project is as follows:

The names in <servlet-name> must be consistent with <main-sipservlet>. Because the SIP servlet is a hybrid of the HTTP servlet and the SIP servlet, during the initialization of the HTTP servlet, we need to query the name of the SIP servlet that we have registered, and the name of the query is the one mentioned in this place < The servlet-name> name is the same, see the Red Block Diagram section in detail:

Only by keeping this place consistent can you ensure that you get the Sipfactory instance object correctly from the servlet context to complete the subsequent instance constructs such as SIP request.

Above is a point of attention in a SIP servlet project, and here's a basic SIP Servlet project (of course, for click Dialing) that needs to be done. It consists mainly of two parts, one in response to an HTTP request and the other in response to a SIP request. For the sake of simplicity, I have only defined two classes in the project, one is Testsip.java to handle the SIP protocol related messages, and the other is testwebsip.java to handle the HTTP protocol related messages. As shown in the following:

The specific code will not be mentioned, the main simple talk about the process. The user sends the request through the webpage, goes to the graph the Dopost function (nonsense, everybody understands), in the Dopost function, in the request parameter to call or the call sends the INVITE request, has not had any relations with the HTTP servlet, it has completed the mission. Any subsequent detailed processing of the SIP protocol will be forwarded to the class defined in the Testsip.java, the function of which is understood at the first glance, the specific processing process will refer to the 3PCC RFC instructions.

This is the whole 3PCC development of the general process, of course, there will certainly encounter some details, there is a need to discuss, welcome to each other.


SIP Servlet Development Example Explained

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.