WAS v8.5 > End-to-end paths > Communications enabled applications

Configure external web service providers to use CEA


Overview

We can configure communications enabled applications (CEA) to use an external web service provider that supports the CEA WSDL file.

To use an external web service provider, it must be deployed and running on a server accessible from the CEA server. The location of the WSDL file for the external service must be known and accessible using an HTTP request. Like the setup required when using the web service provided by CEA, you must start and configure an IP private branch exchange (PBX) as well.

CEA provides web telephony services in the form of REST APIs as well as a web service. When invoked, a common core technology interacts with an IP PBX to monitor and control phones. This core technology can be substituted with an external web service. The CEA web service interface is described by a WSDL) file.

If an external provider creates a web service that supports this WSDL, then CEA can be configured to use that provider. This configuration replaces the need for the existing CEA web service, but the existing service can be used for REST requests. As REST requests are received, CEA uses a web services client to communicate with the external web service provider. The external web service provider is responsible for all communication with the IP PBX to provide third party call control.

  1. Enable the system application.
  2. Install and configure the IP PBX.
  3. Configure the IP PBX location.
  4. Restart the application server.
  5. Install and configure the external web service.
  6. Configure the location of the third-party web service cwbs_wsdl.html">WSDL.
  7. Develop a new application that calls the REST interface.
  8. Install and start the new application.
  9. Test the new application.


Procedure

  1. Enable the system application.

    The system application owns the REST interface. Update the configuration for each server running CEA.

    1. Access the CEA settings panel in the dmgr console.

      • In a single-server environment, click...

          Servers > Server Types > WebSphere application servers > server_name > CEA

      • In a clustered environment, click...

          Servers > Clusters > WebSphere application server clusters > server_cluster > CEA

        Because servers in a cluster are clones of each other, you only need to make configuration changes from the main cluster panel for the cluster, not for each individual server in the cluster.

      The CEA samples package includes a wsadmin (Jython) script library used to simplify the development and testing of scripts that automate configuration changes. For further information, see the wsadmin (Jython) scripting procedures for CEA information.

    2. Ensure the check box labeled Enable communications service is checked.


  2. Install and configure the IP PBX.

    Restriction: The IP PBX must support the ECMA TR/87 protocol. Complete the following actions to set up a sample PBX application that we can use for unit testing in the absence of an official PBX.

    1. Start the application server. Start the application server where you deploy the sample PBX application.
    2. Install the SIP IP PBX sample application. This sample application is located in the installableApps directory of the CEA samples package.

      We can use the Fast Path option when installing when installing the application using the dmgr console, and no changes to the default (Fast Path) settings are required.

      In an initial demonstration or test environment, it is acceptable to install the sample IP PBX application to the instance of WebSphere Application Server that hosts one or more communications enabled applications. When this approach is taken, the default CEA settings can be used in cases where the application server is configured to utilize the default SIP_DEFAULTHOST port (5060); it is unnecessary to make any changes to the CEA settings using the dmgr console or wsadmin.

    3. Start the application.


  3. Configure the IP PBX location.

    The following information must be configured on the server where the CEA system application is running.

    1. In the dmgr console, click...

        Servers > Server Types > WebSphere application servers > server_name > CEA

    2. Use the CEA settings page to select the Use SIP CTI (ECMA TR/87) gateway for telephony access option and configure the following fields:

      Set the following fields based on the server that is running the PBX application.

      • Host name or IP address
      • Port - For the TCP Protocol, select the port SIP_DEFAULTHOST for the server that is running the PBX application.
      • Protocol (TCP)
      • Superuser name

      We can specify a Superuser name on the CEA settings panel. The superuser corresponds to a user, who is configured on the PBX, and has the ability to control any phone that is configured on the PBX. Also, the superuser has the ability to control multiple phones concurrently. This functionality, however, is not supported on every PBX. The Cisco PBX requires set a user name for each phone to control. The Superuser name field on the CEA settings panel can only pass a single user name; therefore, it can only control a single device. To control multiple phones concurrently using the Cisco PBX, you must derive the user name from the user credentials for this PBX. To accomplish this task, ensure the Extract user name from request check box is selected on the CEA settings panel.

      The CEA samples package includes a wsadmin (Jython) script library used to simplify the development and testing of scripts that automate configuration changes. For further information, see the wsadmin (Jython) scripting procedures for CEA information.


  4. Restart the application server.


  5. Install and configure the external web service.

    For example, if the external web service is delivered as an application that is deployed on WebSphere Application Server, install and configure the service on the local server.


  6. Configure the location of the third-party web service WSDL.

    The CEA samples package includes a wsadmin (Jython) script library used to simplify the development and testing of scripts that automate configuration changes. For further information, see the wsadmin (Jython) scripting procedures for CEA information.

    1. In the dmgr console, click Servers > Server Types > WebSphere application servers > server_name > CEA.

    2. Under Telephony access method, select the Use a third-party Web services provider for telephony access option.

    3. Enter the HTTP URL of the third-party WSDL in the Third-party Web services provider's WSDL field.

    4. Save the settings and restart the server so the new changes are applied to the run time.


  7. Develop a new application that calls the REST interface.

    We can copy the following example code into an HTML file and preview it as part of a sample application. The code renders as a simple form where the user can enter two SIP URIs that represent two phones. When the Send XML button is pressed, the request is sent in XML format to the REST interface and a call is established. If the Send JSON button is pressed, the only difference is the format of the request is JSON. The response is of the associated format and printed to a popup window. This example shows only one of the available REST interfaces.

    <!DOCTYPE HTML PUBLIC "-//W3C/DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Call Tester</title> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> 
    <script type="text/javascript" language="javascript"> 
    function setupXmlHttpRequest() {
     if( typeof XMLHttpRequest == "undefined" ) XMLHttpRequest = function() {
      try { return new ActiveXObject("Msxml2.XMLHTTP.6.0") } catch(e) {}
      try { return new ActiveXObject("Msxml2.XMLHTTP.3.0") } catch(e) {}
      try { return new ActiveXObject("Msxml2.XMLHTTP") } catch(e) {}
      try { return new ActiveXObject("Microsoft.XMLHTTP") } catch(e) {}
      throw new Error("This browser does not support XMLHttpRequest." )
            };}
    
    function createXML(addressOfRecord, peerAddressOfRecord) {
     var xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
     xml += "<CommRestRequest xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ";
     xml += "xsi:noNamespaceSchemaLocation=\"CommServletSchema.xsd\">";
     xml += "<enableCollaboration>false</enableCollaboration>";
     if (addressOfRecord.length > 0) {
      xml += "<addressOfRecord>" + addressOfRecord + "</addressOfRecord>";
     }
     if (peerAddressOfRecord.length > 0) {
      xml += "<peerAddressOfRecord>" + peerAddressOfRecord + "</peerAddressOfRecord>";
     }
     xml += "</CommRestRequest>";
     return xml;}
    
    function createJSON(addressOfRecord, peerAddressOfRecord) {
     var json = "{";
     json += "enableCollaboration:false";
     if (addressOfRecord.length > 0) {
      json += ",addressOfRecord:" + addressOfRecord;
     }
     if (peerAddressOfRecord.length > 0) {
      json += ",peerAddressOfRecord:" + peerAddressOfRecord;
     }
     json += "}";
     return json;}
    
    function sendRequest(method, uri, caller, callee, json) {
     try {
      setupXmlHttpRequest();
      var request = new XMLHttpRequest();
      if (json == 1) {
       // Determine if there are parameters in the uri yet
       var paramChar = "&";
       if (-1 == uri.indexOf('?')) {
        // No parameters.
        paramChar = "?";
       }
       request.open(method, uri+paramChar+"JSON=true", false);
       request.send(createJSON(caller, callee));
      } else {
       request.open(method, uri, false);
       request.send(createXML(caller, callee));
      }
      alert(request.responseText);
     } catch (err) {
      alert(err.description);
     }}
    
    </script> </head> 
    <body> <form name="myform">  <h2>Make Calls</h2>  <p><hr>  Caller Uri: <input type="text" name="caller_uri" value=""></input>  Callee Uri: <input type="text" name="callee_uri" value=""></input>  <input type="submit" 
            onclick="sendRequest("PUT", "CommServlet/call", 
     document.myform.caller_uri.value,document.myform.callee_uri.value,0)" 
            value="Send XML">  <input type="submit" 
            onclick="sendRequest("PUT", "CommServlet/call", 
     document.myform.caller_uri.value,document.myform.callee_uri.value,1)" 
            value="Send JSON"> </form> </body> </html>


  8. Install and start the new application. As part of deploying an application, you install application files on a server configured to hold installable modules.


  9. Test the new application.

    The following details are specific to an application that would trigger a phone call between two phones.

    1. Send a REST request, providing the source and destination SIP URIs in the body of the message.
    2. Answer the source phone when it rings.
    3. Answer the destination phone when it rings.


Results

After completing these steps, your CEA configuration uses an external web service provider that manages all interactions with the IP PBX.


Related
wsadmin (Jython) scripting procedures for CEA
Samples documentation
wsadmin (Jython) scripting procedures for CEA


+

Search Tips   |   Advanced Search