Skip to content

Commit

Permalink
fix(samples): avoid init failure for tokens without additional featur…
Browse files Browse the repository at this point in the history
…es (webex#3257)
  • Loading branch information
sreenara authored Dec 15, 2023
1 parent 00466bb commit ee6542d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
15 changes: 8 additions & 7 deletions docs/samples/calling/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,16 +285,9 @@ async function initCalling(e) {

if (window.voicemail === undefined) {
voicemail = window.voicemail = calling.voicemailClient;
const initResponse = await voicemail.init();

console.log(`Init response `, initResponse);
}

fetchLines();
fetchDNDSetting();
fetchCallForwardSetting();
fetchVoicemailSetting();
fetchCallWaitingSetting();
});
});

Expand All @@ -303,6 +296,13 @@ async function initCalling(e) {

credentialsFormElm.addEventListener('submit', initCalling);

function getSettings() {
fetchCallForwardSetting();
fetchVoicemailSetting();
fetchCallWaitingSetting();
fetchDNDSetting();
}

function toggleDisplay(elementId, status) {
const element = document.getElementById(elementId);

Expand Down Expand Up @@ -860,6 +860,7 @@ async function createCallHistory() {
* Function to use Voice Mail API's.
*/
async function createVoiceMail() {
await voicemail.init();
const backendConnector = calling.webex.internal.device.callingBehavior;

if (backendConnector === 'NATIVE_SIP_CALL_TO_UCM') {
Expand Down
3 changes: 2 additions & 1 deletion docs/samples/calling/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,8 @@ <h3>Pagination</h3>
<fieldset id="callSettingsSelection">
<legend>Call Settings</legend>
<div class="u-mv">
<button onclick="toggleDNDSetting()" id="DND-button" class="btn-code">DND</button>
<button onclick="getSettings()" id="fetch-setting">Get Settings</button>
<button onclick="toggleDNDSetting()" id="DND-button" class="btn-code">Toggle DND</button>
<button id="CallWaiting-button" class="btn-code">Call Waiting</button>
<div class="u-pt"><br></div>
<fieldset id="callForwardSelection">
Expand Down

0 comments on commit ee6542d

Please sign in to comment.