callstats.io monitors and analyzes the performance of Amazon Connect real-time communications, enabling you to rapidly troubleshoot issues and deliver high-quality services to your customers.
Integration Steps
1. Include callstats.js and callstats-amazon-shim.js
Add the callstats.js and callstats-amazon-shim.js to the HEAD tag. Please refer to our API page for more information on dependencies.
<script src="connect-rtc.js"></script>
<script src="amazon-connect.js"></script>
// Add the callstats.js and callstats-amazon-shim.js
<script src="https://api.callstats.io/static/callstats.min.js"></script>
<script src="https://api.callstats.io/static/callstats-amazon-shim.js"></script>
The AppID is available on your dashboard page, and the AppSecret is available on the Security tab for the application.
2. Initialize Connect Contact Panel
The parameters that must be configured before initializing Connect Contact Panel (CCP) are explained in the AWS connect-rtc-js repository. Please read this carefully before proceeding further.
//replace with the CCP URL for your Amazon Connect instance
var ccpUrl = "ccpUrl";
connect.core.initCCP(containerDiv, {
ccpUrl: ccpUrl,
loginPopup: true,
softphone: {
allowFramedSoftphone: false
}
});
connect.core.initSoftphoneManager({allowFramedSoftphone: true});
connect.agent(subscribeToAgentEvents);
3. Initialize callstats.js
var localUserId;
var appId = "appID";
var appSecret = "appSecret";
function csInitCallback (err, msg){
console.log("CallStats Initializing Status: err="+err+" msg="+msg);
}
function subscribeToAgentEvents(agent) {
console.log("subscribeToAgentEvents");
localUserId = agent.getName();
var callstats = window.CallstatsAmazonShim.initialize(connect, appId, appSecret, localUserId, configParams, csInitCallback, csStatsCallback);
}
Important Parameters
-
AppID: The AppID is a String obtained from the callstats.io dashboard.
-
AppSecret: The AppSecret is a String obtained from the callstats.io dashboard.
-
localUserId: The localUserId is a String with a maximum length of 256 bytes that MUST NOT be null or empty. It is provided by the developer or fetched from the agent.getName() call of the Connect SDK.
-
configParams: configParams is OPTIONAL. It is the set of parameters used to enable or disable certain features in the library. See the API section for JSON for configParams.
-
csInitCallback: csInitCallback is OPTIONAL. It provides a callback function that asynchronously reports failure or success. See Callback and Error Handling from the callstats.io API page.
-
csStatsCallback: csStatsCallback is OPTIONAL. It provides a callback that asynchronously reports conference statistics. See Callback and Error Handling from the callstats.io API page.
Comments
0 comments
Please sign in to leave a comment.