Access telephony services with REST APIs
We can integrate web telephony into new and existing applications using a Representational State Transfer (REST) API. Telephony features include making phone calls, receiving phone calls, and receiving call notifications within the web application.
The communications enabled applications (CEA) capability requires an IP private branch exchange (PBX) as part of the infrastructure. An IP PBX is a business telephone system designed to deliver voice over a data network and interoperate with the Public Switched Telephone Network (PSTN). A sample IP PBX application is included in the Samples section of the information center. The sample IP PBX is in the form of an application EAR file and is for test purposes only. It can be used to test out the REST interface in the absence of an actual IP PBX that would be used in production. Installation of the sample IP PBX application only requires installing the sample EAR on a dedicated application server. The details of installing and configuring the vendor-specific IP PBX are not provided. Along with the sample IP PBX, two soft phones are needed to test the application.
An understanding of the REST interface requests and responses is needed to perform this task. See the information on REST APIs in CEA for a complete reference to the REST API.
This task uses JavaScript within an application, which calls the REST interface to manage phone calls over an IP network. Formerly, this capability required building SIP servlets and a detailed understanding of the SIP specification.
For another way to accomplish this task using time-saving widgets, see the information center topics on making phone calls and call notifications in web applications.
This task lists the steps needed to develop and deploy an application that can manage phone calls, including how to configure the application server.
- Enable the system application.
- Install the IP PBX.
- Configure the IP PBX location.
- Restart the application server.
- Develop a new application that calls the REST interface.
- Install and start the new application.
- Test the new application.
Results
An application has been developed and deployed leveraging the REST interface to make and receive phone calls and call notifications.
Avoid trouble: If problems are encountered, use the following check list for troubleshooting the problem:
- Is the IP PBX installed and started? If using the sample IP PBX, the console of its application server can be used to verify the installation.
- Are the phones set up correctly? They should list that they are registered with the IP PBX and in ready state.
- Is the new application installed and started? Check with the console or verify by looking in the SystemOut.log file.
This topic references one or more of the application server log files. As a recommended alternative, we can configure the server to use the High Performance Extensible Logging (HPEL) log and trace infrastructure instead of using SystemOut.log , SystemErr.log, trace.log, and activity.log files on distributed and IBM i systems. We can also use HPEL in conjunction with the native z/OS logging facilities. If we are using HPEL, we can access all of the log and trace information using the LogViewer command-line tool from the server profile bin directory. See the information about using HPEL to troubleshoot applications for more information on using HPEL.
- Initiate a network trace to see how messages are exchanged on the network between the application, IP PBX, and phones.
gotcha
Subtopics
- Enable the system application.
- Install the IP PBX.
- Configure the IP PBX location.
- Restart the application server.
- Develop a new application that calls the REST interface.
- Install and start the new application.
- Test the new application.
Related tasks
Samples documentation Use High Performance Extensible Logging to troubleshoot applications
REST APIs in CEA
Related information:
Representational State Transfer