1.0 Integration
Embedding the Noojee Click for Ajax into an HTML page
The Noojee Click for AJAX component is implemented as a JavaScript library. The JavaScript file is installed on the web server from which your Web Application is being served (NOT the Java web server used by Noojee Click).
The library exposes a single method:
njClickToDial (phoneno, enableRecording, recordingTag, callerid)
Where
Parameter | Type | Required | Description |
phoneno | String | Yes | The phone no. to dial. The format of the phone no. is dependant on who you SIP trunk is configured to dial phone no.s |
enableRecording | Boolean | No | If true then the call will be recorded, assuming you have a recording license. |
recordingTag | String | No | A tag that will be attached to the recording. You can search for a recording based on this tag via the Noojee Admin UI or via the Noojee API. |
callerId | String | No | The caller ID to present to the called party. The caller id must be formatted as per your SIP trunks CLID requirements. |
For the njClickToDial function to work you must also provide the Agents Extension No. and the correct auto answer string for the Agents Handsets. (Note most softphones don't support an Auto Answer string and as such this MUST be left blank).
The njClickDialParameters are designed to hold these two values.
The autoAnswerString must be adjusted to correctly match the handset type.
<script type="text/javascript" language="javascript"> var njClickDialParameters = { extension: "SIP/100", autoAnswerString: "Call-Info:\; answer-after=0" }; </script>
When an agent 'clicks to dial' Noojee Click wil pull the agents extension and handset type from the above array.
To incorporate Noojee Click for Ajax into a web page you must include the Noojee Click for AJAX JavaScript library. The following line of code is required in (normally) the HEAD tag of your HTML page that needs embed Noojee Click for Ajax.
<script type="text/javascript" src="noojeeclick/noojeeclick.nocache.js"></script>
This line of code assumes the JavaScript file is in the root of the web application file hierarchy on the server. If the noojeeclick.nocache.js file is in a different director then you will need to adjust the above lines.
Login
The Agents Extension should normally be set at the point in time the Agent logs into your web application. This is usually done by amending your web applications login page to accept the Agents Extension as well as their Username and Password.
The auto-answer string is a special SIP header used by Noojee Click to force a SIP based handset to auto-answer. The auto answer string is unique to each handset. As such you will need to also add the 'Handset Type' to the login page unless all handsets used in your organisation are from the same manufacturer, in which case you can simply hardcode the Auto Answer string.
e.g.
Username: ___________
Password: ___________
Extension No.: ___________
Handset Type: <drop list of supported handsets>
Click Handler
The final piece of the puzzle is the actual 'onClick' handler which needs to be associated with each phone number displayed on the page.
The following demonstrates associating Noojee Click with a displayed phone number.
<span>Phone Number:</span> <span style="white-space:nowrap">03 8320 8100 <button title="03 8320 8100" style="width: 16px; height: 14px; background: url('images/call-phone.png') 0 0 no-repeat;border: 0; padding: 0;" phoneno="0383208100"> onClick="njClickToDial('038320810');" </button> </span>
The following demonstrates associating Noojee Click with a phone number contained in an input control.
<span style="white-space: nowrap">Number To Dial: <input type="text" id = "number"> <input type="button" id="noojeeClick-btn" title="5551234" style="width: 16px; height: 14px; background: url('images/call-phone.png') 0 0 no-repeat; border: 0; padding: 0;" onClick="njClickToDial(document.getElementById('number').value);"> </span>