2.0 Web Service

The Noojee Click for AJAX  web service is a Java application that must be deployed into a Java web server (e.g. Tomcat 7.x or above).

Tomcat is an apache foundation project which can be downloaded from:

The Noojee Click for AJAX web service is distributed as a 'war' file which needs to be deployed into the tomcat web server.

Start by installing a Java Runtime Environment (JRE) 1.6 or above.

Then install Tomcat 7.x

You can download a version of Tomcat appropriate for your server environment from here:

http://tomcat.apache.org/download-70.cgi

Finally deploy the Noojee Click for AJAX war into tomcat.

You can read the following instructions for details on deploying a war into tomcat.

http://tomcat.apache.org/tomcat-7.0-...yer-howto.html

Due to the cross site scripting security restrictions of all modern browsers the Java web server must run on the same server as your Web Application server. If this is not possible then a proxy must be run on the your Web Application server to proxy requests through to the Java web server. For details on how to setup the proxy read the next section on creating an Apache Forward.

The web service must be configured to connect to the Asterisk back­end. To connect to Asterisk the web service requires the following parameters:

   1. AsteriskHost - the host name or IP address of the Asterisk server
   2. AsteriskPort - the port to connect to the Management API on, defaults to 5038
   3. AsteriskUser - the Management API user name
   4. AsteriskSecret - the Management API user secret
   5. MaxResponseWait - the number of seconds the web service should wait for a reponse from
       the Asterisk server before responding to the web component. Defaults to 10 seconds.

Parameters 2, 3 and 4 must match the configuration in the Asterisk manager.conf file.

Note: the web.xml file will not exist until the war file has been loaded into Tomcat and run at least once.

These parameters are configured in the web service web.xml configuration file as follows:

<servlet>
    <servlet-name>dial-service</servlet-name>
    <servlet-class>au.com.noojeeit.clickforajax.server.ClickToDialServiceImpl</servlet-class>
    <init-param>
        <param-name>AsteriskHost</param-name>
        <param-value>pabx.domain.com</param-value>
    </init-param>
    <init-param>
        <param-name>AsteriskPort</param-name>
        <param-value>5038</param-value>
    </init-param>
    <init-param>
        <param-name>AsteriskUser</param-name>
        <param-value>click</param-value>
    </init-param>
    <init-param>
        <param-name>AsteriskSecret</param-name>
        <param-value>password goes here</param-value>    
    </init-param>
    <init-param>
        <param-name>MaxResponseWait</param-name>
        <param-value>10</param-value>
    </init-param>
</servlet>

<servlet-mapping>
    <servlet-name>dial-service</servlet-name>
    <url-pattern>/noojeeclick/dial-service</url-pattern>
</servlet-mapping>
The init­-param entries must contain the correct values to match your Asterisk servers configuration.