send error notification over websocket if tts fails

This commit is contained in:
Dave Horton committed 2022-04-21 14:33:49 -04:00
1 parent 698d12a95f
commit 13ea559cb1
3 files changed
+12

No files matched your search

+4
View File
@@ -50,7 +50,11 @@ class HttpRequestor extends BaseRequestor {
* @param {object} [params] - request parameters
*/
async request(type, hook, params, httpHeaders = {}) {
/* jambonz:error only sent over ws */
if (type === 'jambonz:error') return;
assert(HookMsgTypes.includes(type));
const payload = params ? snakeCaseKeys(params, ['customerData', 'sip']) : null;
const url = hook.url || hook;
const method = hook.method || 'POST';