Generic Toolbar
Generic Toolbar
Table of Contents
1. Document Versioning............................................................................................................. 4
2. Introduction ............................................................................................................................ 5
7.2 Sample JS to register showCrm event with other functions defined in CRM ............ 20
1. Document Versioning
2. Introduction
This document introduces to the user manual and integrational API uses of Generic Web
Toolbar. The document contains the API and technical details required for the integration of
Ameyo web toolbar with a web-based third-party CRM. It is intended to be used by the
knowledge of the integration process. The document assumes the basic knowledge of
A generic web toolbar is used to integrate into the iframe of a third-party toolbar. For the
integration of it, the customer requires a third-party CRM in which it can be integrated. The
CRM in which Web Toolbar has to be implemented must support for the integration of other
CRM in its iframe; it means that the third-party CRM must support iframe integration in itself.
Ameyo Web toolbar, is a web-based telephony solution that enables third-party CRMs to
integrate with Ameyo. This toolbar opens in an iframe on the third-party web page. The
toolbar is fashioned in the form of an agent telephony palette. It contains basic telephony
operations and displays runtime status of agent and call. Below is the reference screenshot
In our test case, we are using the web toolbar integration as Generic only. But it is possible
to integrate it with third-party CRM's as well. For further information on the same, contact
3. Integration Approach
<Protocol>://<Domain_of_Ameyo_Application>:<Port_Number>/ameyowebaccess/toolbar/j
s/ameyo-integration-v<file_version>.js
using a script tag in the headers of all web pages. This serves as the glue code for integration.
Third-party CRM should have a div for the iframe with the div id 'ameyoIframeDiv.' This div
<Protocol>://<Domain_of_Ameyo_Application>:<Port_Number>/ameyowebaccess/toolbar-
crm.htm
Thus the page in this iframe shall be served from Ameyo server, and this will be an
integrated toolbar.
So the integration approach includes that the third-party CRM should include the javascript
provided by Drishti and should invoke the toolbar URL (as mentioned above).
Also include following script in the header of pages where the iframe is present:
<script>
var crmOrigin;
var ameyoBaseUrl="<Protocol>://<Domain_of_Ameyo_Application>:<Port_Number>/";
function initialise(){
crmOrigin=window.location.href;
iframeDiv=document.getElementById("ameyoIframeDiv");
iframeUrl=ameyoBaseUrl + " ameyowebaccess/toolbar-crm.htm?";
iframeUrl = iframeUrl + "origin=" + crmOrigin;
iframeHtml = '<iframe height="400px" width="200px" id="ameyoIframe" src="' + iframeUrl +
'"></iframe>';
iframeDiv.innerHTML=iframeHtml;
}
</script>
Here, <Host_server_IP> is the Ameyo Application Server's IP and <Port_No> is the Ameyo
1. When an incoming call lands on Ameyo and gets connected, the toolbar must
communicate with the CRM to show the CRM page for the connected customer,
2. When an agent clicks on a number on the CRM page, that number has to be dialed.
2. Third-party CRM API to be invoked by Ameyo (Default implementation for the third-
party API is present in the mentioned script. Alternatively, the third-party may
4. Single Sign-On
ameyo.integration.doLogin(username,password,authPolicy);
For Example
ameyo.integration.doLogin('agent','agent','auth.type.password')
2. If auth policy is auth.type.crm.http, then ameyo will call CRM API to authenticate user,
according to API response Ameyo will take action. Click here for the API details
CRM can achieve Single Sign-On (SSO) with Ameyo using CRM's pluggable Authentication
API. To enable SSO, a CRM should provide an HTTP API which Ameyo can use to authenticate
and create session with the CRM server & to send the logout event (API call) to CRM
application when the logout is initiated at Ameyo. For SSO, CRM user should be the same as
<Protocol>://<CRM_SERVER_IP>:<PORT_Number>/<SOME_PATH>/login_logout
The API will be required to accept the Post parameter request XML. The XML encoded data
will be passed in predefined XML formats. The same API will be called in both login and
logout operations.
For Example :
URL :
<Protocol>://<Application_Domain_Name_or_IP><CRM_Port_Number>/crm/l
ogin_logout
Post Data :
requestXml=
<request><command>login</command><userId>agent</userId><password>ag
ent
</password> </request>
4.1.3 Procedure
Users have to login with their user id and CRM login password. CRM should call doLogin
function (know more…). Ameyo Application Server will invoke a login URL with user id and
password as parameters in the request format. In return, the CRM server will respond with
The above-mentioned API will be called with login command along with the user id and
Once doLogin function is called, then the request will be passed to Application Server for
login. The server will check the user id in Ameyo application. If found, the login request will
be sent to the CRM application using the login_logout API. Only those users who are
requestXml=<request>
<command>login</command>
<userId>user</userId>
<password>pass</password>
</request>
Command is a mandatory attribute and rest of the attributes will depend on the command.
<response>
<status>success</status>
<message>Auth Successful</message>
<crmSessionId>100322323-aaa-32</crmSessionId>
</response>
<response>
<status>failed</status>
<message>Incorrect Password</message>
<crmSessionId></crmSessionId>
</response>
Status and Message are mandatory fields. Other fields will depend on the command where:
1. Status: This will indicate the status authentication request. Possible values of status
crmSessionId: This will be the unique session Id if the authentication request is successful.
This session Id will be then passed with other parameters of every web request (CRM /
4.2 Logout
Invoked by Ameyo to intimate CRM that the CRM session should be terminated, as the user
When the user invokes the logout even on Ameyo Client UI, the same will be processed at
Ameyo Application. On successful logout, the Application server will invoke the login_logout
API with logout event to notify the CRM application about the logout event. The command
requestXml=<request>
<command>logout</command>
<crmSessionId>100322323-aaa-32</crmSessionId>
</request>100322323-aaa-32</crmSessionId>
</request>
Command is a mandatory field and rest fields will depend on the command.
<response>
<status>success/failed</status>
<message></message>
</response>
Status and Message are mandatory fields. Other fields would depend on the command.
Where,
1. Status: Success or Failed, this will indicate the status authentication request.
3. crmSessionId: Will be the unique Session-Id for authenticated CRM session received
If a user logs out from Ameyo, Ameyo will invoke the SSO-URL with logout command. CRM
This will only be called if a login has been failed giving an error as force login.
Example:
ameyo.integration.doForceLogin();
The hidden data with the green line is the phone number of the agent who has logged in to
the toolbar.
For Example:
ameyo.integration.doDial(phone,customerId, additionalParameters);
For Example:
ameyo.integration.doDial('<Phone_Number>','567', '{}');
Rest all functionalities to transfer, confer, hold etc shall be provided from the toolbar itself.
populateNumberInDialBox(phone);
For Example
ameyo.integration.populateNumberInDialBox('<Phone_Number>');
6. Auto-Extension Selection
ameyo.integration.getExtensionInfo();
This function will be called from Ameyo, and it should return a JSON object containing
extension name and phone as a response of this function. If extension name and phone(in
case extension is not endpoint) are valid then the user's extension will be selected
automatically.
For Example:
function getExtensionInfo(){
var extensionInfo = {
name : '<Extension_Name>',
phone : '1111'
};
return extensionInfo;
}
Here, the "name" is the extension name which is defined in Ameyo for softphone/hard
Whenever Agent dials/receives the call, showCrm event is sent to CRM along with phone
In case the function is defined with a name other than showcrm then it needs to be
ameyo.integration.showCrm(phone,additionalParameters);
For Example:
ameyo.integration.showCrm('<Phone_Number>',{'customerId':'567'});
1. Incoming Call:As part of an Inbound campaign, the agent receives a call through ACD
4. Preview Dial:Agent previews the customer details before dialing either as part of a
defined in CRM
Following is the Sample JS to register showCrm event with other functions defined in CRM.
8. Call Disposition
1. Function 1- getDispositionCodes: CRM will call this function to get the two-level
• Request Method:
shall be the id of campaign for which we need to get the two-level disposition
For Example:
ameyo.integration.getDispositionCodes(1)
or
ameyo.integration.getDispositionCodes()
• Handler (Response):
be received in this type of handler. In this handler, the object will contain two-
call.
• Request Method
method disposition code shall be disposition with which respective call needs
to be disposed of.
For Example
ameyo.integration.disposeCallByDisposition("'Foreign
Language").
In default release disposition code "Callback" is not allowed, but the same
• Handler (Response):
method, the object is the status as success or failure, that is, whether the call
Ameyo will expose the dispose of & dial function to dispose of the current call and dial
another number:
disposeNDial: This function can be used to dispose of a call with a specific disposition code
1. Request Method:
should the user disposition with which current call needs to be disposed of, and the
phone should be the number which has to be dialed after disposing of the current
call.
For Example
2. Handler (Response):
status as success or failure, that is, whether the call is successfully disposed
status of call dialed on phone number (passed in request method) that is,
10. Logout
ameyo.integration.doLogout();
When user logs out from CRM then CRM should logout from toolbar using doLogout()
function.
For Example:
ameyo.integration.doLogout();
Just like showCrm event, toolbar provides few more events and handlers which are triggered
Function Parameter
When the event is called Request Data Data Passes / Response Send
Name s
OnSuccess:
message
Whenever a person first creates a
OnFailure:
session in Server and logins into the
3. “unknown.error.occured.p
lease.refresh.or.retry”
Logout -- Yes
Function Parameter
When the event is called Request Data Data Passes / Response Send
Name s
Login – Yes
1. currentPhone
phone, This event will be received
2. requested
showCrm additionalP whenever a call arrives, or preview
URL)
OnSuccess:
1. success
r extension OnException:
1. responseText detail
2. userCustomerCRTInfo
OnSuccess:
1. success
er extension OnException:
1. responseText detail
2. userCustomerCRTInfo
r Campaign.
Function Parameter
When the event is called Request Data Data Passes / Response Send
Name s
Response status:
4. Unavailable
OnSuccess:
This event will be received
hangupHan
status whenever an agent hang-ups the • "success"
dler
call
• userCustomerCRTInfo
Function Parameter
When the event is called Request Data Data Passes / Response Send
Name s
fetched.
handleDisp
Disposition Whenever a request is made for
ositionCod
code disposition codes.
es
disposeCall
disposition This function can be used to dispose call.disposed
ByDispositi
Code of the current call. userCustomerCRTInfo
on
handledisp
de
handledisp
Whenever a request is made to
oseCallByDi
Status dispose current call and dial a
spositionCo
number.
de
Function Parameter
When the event is called Request Data Data Passes / Response Send
Name s
handleFaile
When Exception occurs while
dDispositio Reason for failure of call with the
disposing of call or Null value of
nNotifyGen data type of String.
crtObjectId, disposition code.
eric
1. phoneNumber
ameyo.inte
2. selfCallBack
gration.dis
It is Called for setting callback using
poseAndSc 3. callBackTime
Third-Party CRM.
heduleCallb
4. callBackParams
ack
5. additionalParameters
ameyo.inte
gration.get
It is Called for getting disposition
Disposition
class with disposition code using campaignId
CodesWith
Third-Party CRM.
Disposition
Class
ameyo.inte 1. dispositionCode
gration.dis It is Called to schedule callback
2. additionalParameters
poseCallBy using Third-Party CRM.
Disposition 3. crtObjectId
ameyo.inte
It is called to get the list of
gration.get
disposition codes in the specified campaignId
Disposition
campaign
Codes
ameyo.inte 1. dispositionCode
It is Called to dispose of call with
gration.dis
disposition code using Third-Party 2. additionalParameters
poseCallBy
CRM.
Disposition 3. crtObjectId
ameyo.inte
It is Called to Force Login using
gration.doF
Third-Party CRM.
orceLogin
ameyo.inte
This function enables/disables dial
gration.pop
and preview button based on the phone It will populate Number as input
ulateNumb
input text
erInDialBox
Function Parameter
When the event is called Request Data Data Passes / Response Send
Name s
1. Phone
2. customerId
ameyo.inte
This function is Called to dial on
gration.do 3. additionalParams
Number using Third-Party CRM.
Dial
4. searchable
5. customerRecords
1. username
ameyo.inte Not working if a failure occurs.
This function is called for login using
gration.doL 2. password Message:
Third-Party CRM
ogin "already logged in"
3. authPolicy
ameyo.inte
This function is used to dispose and 1. dispositionCode
gration.dis doDisposeNDialInCrm not defined.
dial the call. 2. phone
poseNDial
ameyo.inte
This function is used for the callContextId Not method in ameyo-
gration.sele
selection of the extension. phone genericPlugin.js
ctExtension
ameyo.inte
gration.set This function is used for getting the extensionName No method called from ameyo-
fo
aameyo.int
This function is used to dispose of
egration.dis object
the chat conversation.
poseChat
ameyo.inte
This function is Called for refreshing
gration.refr
the telephony panel at third-party crtobjectId Not implemented in the toolbar
eshTelepho
CRM.
ny
Function Parameter
When the event is called Request Data Data Passes / Response Send
Name s