ahs-cti 1.0.1-beta.1 → 1.0.1-beta.2
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 +8 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5793,19 +5793,19 @@ init_endPoint();
|
|
|
5793
5793
|
init_sdk_state();
|
|
5794
5794
|
init_storage();
|
|
5795
5795
|
function clickToCall(payload) {
|
|
5796
|
-
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
5796
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
5797
5797
|
const state = (0, import_vault7.getSession)(STORAGE_KEY);
|
|
5798
|
-
if (((_a2 = state == null ? void 0 : state.callData) == null ? void 0 : _a2.status) !== "IDLE") {
|
|
5798
|
+
if (((_a2 = state == null ? void 0 : state.callData) == null ? void 0 : _a2.status) !== "IDLE" && ((_b = state == null ? void 0 : state.callData) == null ? void 0 : _b.status) !== "ONCALL") {
|
|
5799
5799
|
return Promise.reject(new Error("Agent is not ready"));
|
|
5800
5800
|
}
|
|
5801
5801
|
const body = {
|
|
5802
5802
|
phone_number: payload.mobileNumber,
|
|
5803
|
-
user: (
|
|
5804
|
-
auto_answer: (
|
|
5805
|
-
convox_id: (
|
|
5806
|
-
reference_id: (
|
|
5807
|
-
call_source: (
|
|
5808
|
-
caseId: (
|
|
5803
|
+
user: (_d = (_c = payload.user) != null ? _c : state == null ? void 0 : state.agentId) != null ? _d : "",
|
|
5804
|
+
auto_answer: (_e = payload.auto_answer) != null ? _e : false,
|
|
5805
|
+
convox_id: (_h = (_g = (_f = state == null ? void 0 : state.callData) == null ? void 0 : _f.convox_id) != null ? _g : payload.convox_id) != null ? _h : "",
|
|
5806
|
+
reference_id: (_i = payload.reference_id) != null ? _i : "",
|
|
5807
|
+
call_source: (_j = payload.call_source) != null ? _j : "",
|
|
5808
|
+
caseId: (_k = payload.caseId) != null ? _k : ""
|
|
5809
5809
|
};
|
|
5810
5810
|
return axios_default.post(END_POINT.CLICK_TO_CALL, body).then((res) => {
|
|
5811
5811
|
try {
|