@webex/contact-center 3.10.0-next.30 → 3.10.0-next.32
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/cc.js +30 -31
- package/dist/cc.js.map +1 -1
- package/dist/webex.js +1 -1
- package/package.json +2 -2
- package/src/cc.ts +39 -42
- package/umd/contact-center.min.js +2 -2
- package/umd/contact-center.min.js.map +1 -1
package/src/cc.ts
CHANGED
|
@@ -693,52 +693,49 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
|
|
|
693
693
|
module: CC_FILE,
|
|
694
694
|
method: METHODS.CONNECT_WEBSOCKET,
|
|
695
695
|
});
|
|
696
|
+
|
|
696
697
|
try {
|
|
697
|
-
|
|
698
|
-
.
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
698
|
+
const data = (await this.services.webSocketManager.initWebSocket({
|
|
699
|
+
body: this.getConnectionConfig(),
|
|
700
|
+
})) as WelcomeEvent;
|
|
701
|
+
|
|
702
|
+
const agentId = data.agentId;
|
|
703
|
+
const orgId = this.$webex.credentials.getOrgId();
|
|
704
|
+
this.agentConfig = await this.services.config.getAgentConfig(orgId, agentId);
|
|
705
|
+
|
|
706
|
+
LoggerProxy.log(`Agent config is fetched successfully`, {
|
|
707
|
+
module: CC_FILE,
|
|
708
|
+
method: METHODS.CONNECT_WEBSOCKET,
|
|
709
|
+
});
|
|
710
|
+
|
|
711
|
+
// TODO: Make profile a singleton to make it available throughout app/sdk so we dont need to inject info everywhere
|
|
712
|
+
this.taskManager.setWrapupData(this.agentConfig.wrapUpData);
|
|
713
|
+
this.taskManager.setAgentId(this.agentConfig.agentId);
|
|
714
|
+
this.taskManager.setWebRtcEnabled(this.agentConfig.webRtcEnabled);
|
|
715
|
+
|
|
716
|
+
if (
|
|
717
|
+
this.agentConfig.webRtcEnabled &&
|
|
718
|
+
this.agentConfig.loginVoiceOptions.includes(LoginOption.BROWSER)
|
|
719
|
+
) {
|
|
720
|
+
try {
|
|
721
|
+
await this.$webex.internal.mercury.connect();
|
|
722
|
+
LoggerProxy.log('Authentication: webex.internal.mercury.connect successful', {
|
|
706
723
|
module: CC_FILE,
|
|
707
724
|
method: METHODS.CONNECT_WEBSOCKET,
|
|
708
725
|
});
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
module: CC_FILE,
|
|
723
|
-
method: METHODS.CONNECT_WEBSOCKET,
|
|
724
|
-
});
|
|
725
|
-
})
|
|
726
|
-
.catch((error) => {
|
|
727
|
-
LoggerProxy.error(`Error occurred during mercury.connect() ${error}`, {
|
|
728
|
-
module: CC_FILE,
|
|
729
|
-
method: METHODS.CONNECT_WEBSOCKET,
|
|
730
|
-
});
|
|
731
|
-
});
|
|
732
|
-
}
|
|
733
|
-
if (this.$config && this.$config.allowAutomatedRelogin) {
|
|
734
|
-
await this.silentRelogin();
|
|
735
|
-
}
|
|
736
|
-
|
|
737
|
-
return this.agentConfig;
|
|
738
|
-
})
|
|
739
|
-
.catch((error) => {
|
|
740
|
-
throw error;
|
|
741
|
-
});
|
|
726
|
+
} catch (error) {
|
|
727
|
+
LoggerProxy.error(`Error occurred during mercury.connect() ${error}`, {
|
|
728
|
+
module: CC_FILE,
|
|
729
|
+
method: METHODS.CONNECT_WEBSOCKET,
|
|
730
|
+
});
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
if (this.$config && this.$config.allowAutomatedRelogin) {
|
|
735
|
+
await this.silentRelogin();
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
return this.agentConfig;
|
|
742
739
|
} catch (error) {
|
|
743
740
|
LoggerProxy.error(`Error during register: ${error}`, {
|
|
744
741
|
module: CC_FILE,
|