From d831a4ca7f29dc2b62c4bd8911548546c6aae674 Mon Sep 17 00:00:00 2001 From: Sam Machin Date: Sun, 20 Jul 2025 18:47:31 +0100 Subject: [PATCH] don't fetch if whisper is an object with a single verb in it (#1290) * don't fetch if whisper is an object with a single verb in it * disable URL fetching of verbs on whisper * fixes for lint * lint --- lib/session/call-session.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/session/call-session.js b/lib/session/call-session.js index f0516e5d..a331a567 100644 --- a/lib/session/call-session.js +++ b/lib/session/call-session.js @@ -1661,8 +1661,8 @@ Duration=${duration} ` async _lccWhisper(opts, callSid) { const {whisper} = opts; let tasks; - const b3 = this.b3; - const httpHeaders = b3 && {b3}; + //const b3 = this.b3; + //const httpHeaders = b3 && {b3}; // this whole thing requires us to be in a Dial verb const task = this.currentTask; @@ -1671,12 +1671,15 @@ Duration=${duration} ` } // allow user to provide a url object, a url string, an array of tasks, or a single task - if (typeof whisper === 'string' || (typeof whisper === 'object' && whisper.url)) { - // retrieve a url - const json = await this.requestor(opts.call_hook, this.callInfo.toJSON(), httpHeaders); - tasks = normalizeJambones(this.logger, json).map((tdata) => makeTask(this.logger, tdata)); - } - else if (Array.isArray(whisper)) { + // Disable passing a URL as not functional Sam Machin - 17/07/2025 + //if (typeof whisper === 'string' || (typeof whisper === 'object' && whisper.url && !whisper.verb)) { + // // retrieve a url + // const json = await this.requestor(opts.call_hook, this.callInfo.toJSON(), httpHeaders); + // tasks = normalizeJambones(this.logger, json).map((tdata) => makeTask(this.logger, tdata)); + //} + //else if (Array.isArray(whisper)) { + + if (Array.isArray(whisper)) { // an inline array of tasks tasks = normalizeJambones(this.logger, whisper).map((tdata) => makeTask(this.logger, tdata)); }