send error notification over websocket if tts fails

This commit is contained in:
Dave Horton
2022-04-21 14:33:49 -04:00
parent 698d12a95f
commit 13ea559cb1
3 changed files with 12 additions and 0 deletions

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';