Making phone calls in web applications
We can embed the ClickToCall widget in an existing application to enable users to enter their phone number and request an immediate callback from the company. You embed the communications enabled applications (CEA) widget using the Dojo Toolkit provided with the CEA feature.
Dojo widgets are prepackaged components of JavaScript code, HTML markup and CSS style declarations that can be used to enhance web sites with interactive features. We can use the Dojo Toolkit that comes with the CEA feature to embed the CEA widgets in the applications. This capability also 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 Gallery.stem The sample IP PBX is in the form of an EAR file and is for test purposes only. 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.
Deprecated feature: CEA Dojo widgets encapsulate various user interfaces based on the CEA Rest API. These widgets are deprecated. We can also obtain the source for these widgets from developerWorks . depfeat
The ClickToCall widget is built using the functionality provided in the Dojo Toolkit. This widget can be configured to create a call between a hard-coded number provided to the widget during initialization and a number provided by the end user. The ClickToCall widget can also be customized to match the look and feel of the page by overriding the default CSS file. The functionality provided by the widget can also be extended, allowing the user to create their own custom version to handle more advanced tasks.
This task lists the steps needed to enable phone call management in an existing application, including how to install the SIP IP PBX sample application and configure the application server. To quickly learn how the CEA widgets work in an online application, we can install the PlantsByWebSphere Ajax Edition for CEA (PlantsByWebSphereAjax) sample application. For more information about the sample application, see the supporting documentation provided in the PlantsByWebSphere directory of the CEA samples package that we can download from the WAS Samples page. Additionally, read about setting up and using the communications enabled application samples.
Avoid trouble: In the following procedure, complete either Step 6 or Step 7. Step 6 enables the widget for desktop browsers. Step 7 enables the widget for Apple and Android mobile browsers.gotcha
- Enable the system application.
- Install the IP PBX.
- Configure the IP PBX location.
- Restart the application server.
- Copy the CEA widgets into the application you are enhancing.
- Embed the widgets in the application you are enhancing for desktop browsers.
- Embed the mobile widgets in the application you are enhancing.
- Install and start the application that we have enhanced.
- Test the application that we have enhanced.
Results
You have enabled the ClickToCall widget within an application to allow users to enter their phone number and make a phone call.
Avoid trouble: If problems are encountered, troubleshooting can be done to find the source. Here is a checklist.
- 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.
- When you test the widgets, use two separate browsers, or the same browser on two separate machines. Using tabs in the same browser, or even launching separate instances of the same browser on the same machine, causes session issues.
- Enable browser cookies to allow the CEA widgets to store state information about the active widget session. This process enables the user to access another web page with the embedded CEA widget or refresh the current page while keeping the widget session active. If we disable cookies and access another page with the embedded CEA widget or refresh the current page, the CEA widget loads to the default state.
gotcha
Subtopics
- Enable the system application.
- Install the IP PBX.
- Configure the IP PBX location.
- Restart the application server.
- Copy the CEA widgets into the application you are enhancing.
- Embed the widgets in the application you are enhancing for desktop browsers.
- Embed the mobile widgets in the application you are enhancing.
- Install and start the application that we have enhanced.
- Test the application that we have enhanced.
Related tasks
Set up the communications enabled application samples Use High Performance Extensible Logging to troubleshoot applications Samples documentation
Related information:
Multiple Versions of Dojo in a Page