From 2d420ec11b65839e274ec5cfa43dba0346c0f792 Mon Sep 17 00:00:00 2001 From: Jean-Roch Maitre Date: Thu, 8 Dec 2016 11:31:18 -0800 Subject: [PATCH] UI-2499: handle 404 on virtual receptionist --- i18n/en-US.json | 6 +++++- submodules/strategy/strategy.js | 12 +++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/i18n/en-US.json b/i18n/en-US.json index 77243eb..dd26527 100644 --- a/i18n/en-US.json +++ b/i18n/en-US.json @@ -918,7 +918,11 @@ "info": "Customize your conference greeting message using our Text-to-Speech feature. Simply type your greeting message in the input field below.", "mainConfMissing": "Your Main Conference could not be found.", "tooltip": "Your Main Conference has a custom greeting message." - } + }, + + "__comment": "UI-2499: Handle case where greeting has been deleted", + "__version": "4.0", + "greetingMissing": "The greeting that was configured on this Virtual Receptionist is missing. Please setup a new greeting." }, "callLogs": { diff --git a/submodules/strategy/strategy.js b/submodules/strategy/strategy.js index ef0b268..c8931df 100644 --- a/submodules/strategy/strategy.js +++ b/submodules/strategy/strategy.js @@ -2109,11 +2109,21 @@ define(function(require){ resource: 'media.get', data: { accountId: self.accountId, - mediaId: menu.media.greeting + mediaId: menu.media.greeting, + generateError: false }, success: function(data, status) { greeting = data.data; showPopup(); + }, + error: function(data, status, globalHandler) { + if(data && data.error === '404') { + showPopup(); + toastr.warning(self.i18n.active().strategy.greetingMissing); + } + else { + globalHandler(data, { generateError: true }); + } } }); } else {