operata
v1.0.36
Published
Loads JS required to collect WebRTC stats.
Downloads
2
Readme
Operata JS library integration
If you want your own branding or softphone features then you will need to host your own Amazon Connect Softphone (CPP) and add the Operata JS library as shown in the steps below:
1. Source the Amazon Connect softphone, host it in your environment and test.
2. Once this is working, add the operata.js (or import operata) to softphone page, as below:
Loading the JS library
Load the Operata JS script in the <head>
of your application
<script src="https://static.operata.io/operata.js"></script>
or use our npm package (if you are using a javascript bundler like webpack or parcel)
Installation
npm i operata
Load library
import {Operata} from 'operata';
3. Initialise the AWS softphone with the reference set to your Amazon connect instance.
<script>
const softphoneDiv = document.getElementById('softphone');
const yourCCPPage = '<ccp url>';
const softphoneParams = {
"ccpUrl": yourCCPPage,
"loginPopup": true,
"softphone": { "allowFramedSoftphone": false }
};
connect.core.initCCP(softphoneDiv, softphoneParams);
connect.core.initSoftphoneManager({ allowFramedSoftphone: true });
</script>
4. Configure Operata options to your group instance and add the script tag contents at the bottom of the <body>
tag in your softphone deployment.
<script>
const operataOptions = {
awsCCPUrl: '<Your CCP URL>',
operataGroupID: '<Your Operata Group ID',
operataGroupSecret: '<Your Operata Group Secret>',
loadSoftphone: false, // This is optional. Enable a softphone here <defaults to false>. Skip step 3 if you set this options to true.
};
Operata(operataOptions).then(() => {
//execute anything after operata has been initialised.
}).catch((err) => {
//handle operata initialisation error.
});
</script>
5. Use your AWS console to allow https://softphone.operata.io to Integrate with your Amazon Connect instance, the Operata Help Centre has details.
Testing
To test stats collection, make a call from your Amazon Connect softphone and you will see the statistics updated every 10 seconds.
If you see 'Welcome to Operata Agent Assist' when you select the Operata Icon, then this is working.
If you have any issues then email us at [email protected]
Browser Support
Current browser support is limited to
Desktop
- Chrome: Latest
API
Initialisation Options
| option | optional | default | description |
|:-------------|:----------------:|:------------:|:---------------------------------------------------------------|
| awsCCPUrl | false | none | the required CCP URL is defined in your connect instance on AWS |
| operataGroupID | false | none | the required groupID
field defined by Operata in your account |
| operataGroupSecret | false | none | the required security token issued for you Operata group |
| loadSoftphone | true | false | enables a integrated softphone by simply setting a flag to true |
| loadAgentMessenger | true | false | enables Operata Agent Messenger widget |
| location | true | '' | set the location of this softphone. this can be used for filtering of data |
| ccpLogCollection | true | none | enables CCP log collection. Can be one of: ["TRACE", "DEBUG", "INFO", "LOG", "WARN", "ERROR", "CRITICAL"]|
Agent Issue Reporting
You can send an Agent reported issue via Operata stats collector API. This is done by sending an event on the Operata eventBus. Here is an example:
// Obtain a reference to the eventBus when Operata stats collection is initialised.
let eventBus = null;
Operata(operataOptions).then((eb) => {
console.log("Loaded Operata Softphone");
eventBus = eb;
}).catch((err) => {
console.error(err);
});
// ....
// Send the issue via the eventBus
eventBus.emit("agent-reported-issue", 'Missed call, Softphone did not ring', 'Default',
{extraField: 'Some optional data'}, function(sent){
if (sent){
alert('Issue submitted.');
}else{
alert('An error occurred while submitting the issue.');
}
});
eventBus.emit method accepts following arguments
| Argument | Mandatory | Description | |:-------------|:-------------|:---------------------------------------------------------------| | eventName | yes | Please use "agent-reported-issue" for Agent issue reporting. | | cause | yes | Cause of the issue. Customer defined. | | severity | no | Severity of the issue. Customer defined. | | extra | no | An object of extra data. Customer defined. | | callback | no | A callback method. This is called once the issue is submitted. |
Operata associates Agent reported issues with the callContactId using the following rules:
- Issue reported before taking the first call after going offline - associate with no callContactId
- Issue reported before taking the next call - associate with the last callContactId
- Issue reported while on a call - associate with the current callContactId
- Issue reported after taking a call - associate with the last callContactId
Recommended Versions of Amazon Connect Libraries
The versions below have been tested with the Operata library and are recommended.
| CCP | connect-streams | connect-rtc | | --------|:---------------:| :-----------:| | v2 | 1.5.1 | 1.1.7 |
Built With
- AWS Connect Streams - AWS Connect Streams
- AWS Connect RTC - AWS Connect RTC
Authors
- Operata Dev Team - Initial work - Operata