ahs-cti 0.0.2-beta.8 → 0.0.2-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3474,7 +3474,7 @@ function CallControls({ onDataChange }) {
|
|
|
3474
3474
|
}
|
|
3475
3475
|
}, [state.agentId]);
|
|
3476
3476
|
const connectWebSocket = () => {
|
|
3477
|
-
var _a3, _b2
|
|
3477
|
+
var _a3, _b2;
|
|
3478
3478
|
if (!state.agentId) {
|
|
3479
3479
|
return;
|
|
3480
3480
|
}
|
|
@@ -3483,7 +3483,7 @@ function CallControls({ onDataChange }) {
|
|
|
3483
3483
|
reconnectTimeoutRef.current = null;
|
|
3484
3484
|
}
|
|
3485
3485
|
try {
|
|
3486
|
-
webSocketRef.current = new WebSocket(`${(_a3 = state.urlConfig) == null ? void 0 : _a3.webSocketURL}?
|
|
3486
|
+
webSocketRef.current = new WebSocket(`${(_a3 = state.urlConfig) == null ? void 0 : _a3.webSocketURL}/api/v1/ws/agent/events?token=${(_b2 = state.authorization) == null ? void 0 : _b2.accessToken}`);
|
|
3487
3487
|
webSocketRef.current.onopen = () => {
|
|
3488
3488
|
console.log("\u{1F310} WebSocket connection established");
|
|
3489
3489
|
reconnectAttemptsRef.current = 0;
|
|
@@ -3501,7 +3501,7 @@ function CallControls({ onDataChange }) {
|
|
|
3501
3501
|
}, 3e4);
|
|
3502
3502
|
};
|
|
3503
3503
|
webSocketRef.current.onmessage = (event) => {
|
|
3504
|
-
var _a4, _b3,
|
|
3504
|
+
var _a4, _b3, _c2, _d2, _e2;
|
|
3505
3505
|
try {
|
|
3506
3506
|
const data = JSON.parse(event.data);
|
|
3507
3507
|
if (data.type === "pong") {
|
|
@@ -3580,7 +3580,7 @@ function CallControls({ onDataChange }) {
|
|
|
3580
3580
|
isMergeCall: false
|
|
3581
3581
|
}
|
|
3582
3582
|
]);
|
|
3583
|
-
if ((data == null ? void 0 : data.mode) !== "manual" && audioRef.current && ((
|
|
3583
|
+
if ((data == null ? void 0 : data.mode) !== "manual" && audioRef.current && ((_c2 = state == null ? void 0 : state.sdkConfig) == null ? void 0 : _c2.enableRingtone)) {
|
|
3584
3584
|
audioRef.current.play().catch((error) => {
|
|
3585
3585
|
console.error("Failed to play ringtone:", error);
|
|
3586
3586
|
});
|