diff --git a/lib/session/call-session.js b/lib/session/call-session.js index 193ed23a..2f563f6c 100644 --- a/lib/session/call-session.js +++ b/lib/session/call-session.js @@ -1635,59 +1635,63 @@ Duration=${duration} ` async updateCall(opts, callSid) { this.logger.debug(opts, 'CallSession:updateCall'); - if (opts.call_status) { - return this._lccCallStatus(opts); - } - if (opts.call_hook || opts.child_call_hook) { - return await this._lccCallHook(opts); - } - if (opts.listen_status) { - await this._lccListenStatus(opts); - } - if (opts.transcribe_status) { - await this._lccTranscribeStatus(opts); - } - else if (opts.mute_status) { - await this._lccMuteStatus(opts.mute_status === 'mute', callSid); - } - else if (opts.conf_hold_status) { - await this._lccConfHoldStatus(opts); - } - else if (opts.conf_mute_status) { - await this._lccConfMuteStatus(opts); - } - else if (opts.sip_request) { - const res = await this._lccSipRequest(opts, callSid); - return {status: res.status, reason: res.reason}; - } else if (opts.dtmf) { - await this._lccDtmf(opts, callSid); - } - else if (opts.record) { - await this.notifyRecordOptions(opts.record); - } - else if (opts.tag) { - return this._lccTag(opts); - } - else if (opts.conferenceParticipantAction) { - return this._lccConferenceParticipantAction(opts.conferenceParticipantAction); - } - else if (opts.dub) { - return this._lccDub(opts); - } - else if (opts.boostAudioSignal) { - return this._lccBoostAudioSignal(opts, callSid); - } - else if (opts.llm_tool_output) { - return this._lccToolOutput(opts.tool_call_id, opts.llm_tool_output, callSid); - } - else if (opts.llm_update) { - return this._lccLlmUpdate(opts.llm_update, callSid); - } - - // whisper may be the only thing we are asked to do, or it may that - // we are doing a whisper after having muted, paused recording etc.. - if (opts.whisper) { - return this._lccWhisper(opts, callSid); + try { + if (opts.call_status) { + return this._lccCallStatus(opts); + } + if (opts.call_hook || opts.child_call_hook) { + return await this._lccCallHook(opts); + } + if (opts.listen_status) { + await this._lccListenStatus(opts); + } + if (opts.transcribe_status) { + await this._lccTranscribeStatus(opts); + } + else if (opts.mute_status) { + await this._lccMuteStatus(opts.mute_status === 'mute', callSid); + } + else if (opts.conf_hold_status) { + await this._lccConfHoldStatus(opts); + } + else if (opts.conf_mute_status) { + await this._lccConfMuteStatus(opts); + } + else if (opts.sip_request) { + const res = await this._lccSipRequest(opts, callSid); + return {status: res.status, reason: res.reason}; + } else if (opts.dtmf) { + await this._lccDtmf(opts, callSid); + } + else if (opts.record) { + await this.notifyRecordOptions(opts.record); + } + else if (opts.tag) { + return this._lccTag(opts); + } + else if (opts.conferenceParticipantAction) { + return this._lccConferenceParticipantAction(opts.conferenceParticipantAction); + } + else if (opts.dub) { + return this._lccDub(opts); + } + else if (opts.boostAudioSignal) { + return this._lccBoostAudioSignal(opts, callSid); + } + else if (opts.llm_tool_output) { + return this._lccToolOutput(opts.tool_call_id, opts.llm_tool_output, callSid); + } + else if (opts.llm_update) { + return this._lccLlmUpdate(opts.llm_update, callSid); + } + + // whisper may be the only thing we are asked to do, or it may that + // we are doing a whisper after having muted, paused recording etc.. + if (opts.whisper) { + return this._lccWhisper(opts, callSid); + } + } catch (err) { + this.logger.info({err, opts, callSid}, 'CallSession:updateCall - error updating call'); } }