From bae96a67521c538a2429c43ce707884b078ec23b Mon Sep 17 00:00:00 2001 From: Anton Voylenko Date: Tue, 13 Aug 2024 16:45:58 +0300 Subject: [PATCH] fix: do not run snake case for customer data (#861) --- lib/tasks/conference.js | 27 +++++++++++++++++++-------- lib/utils/place-outdial.js | 2 +- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/lib/tasks/conference.js b/lib/tasks/conference.js index d98551c4..3176e229 100644 --- a/lib/tasks/conference.js +++ b/lib/tasks/conference.js @@ -135,15 +135,10 @@ class Conference extends Task { * @param {SipDialog} dlg */ async _init(cs, dlg) { - const friendlyName = this.confName; const {createHash, retrieveHash} = cs.srf.locals.dbHelpers; + this.friendlyName = this.confName; this.confName = `conf:${cs.accountSid}:${this.confName}`; - this.statusParams = Object.assign({ - conferenceSid: this.confName, - friendlyName - }, cs.callInfo); - // check if conference is in progress const obj = await retrieveHash(this.confName); if (obj) { @@ -693,8 +688,24 @@ class Conference extends Task { if (!params.time) params.time = (new Date()).toISOString(); if (!params.members && typeof this.participantCount === 'number') params.members = this.participantCount; cs.application.requestor - .request('verb:hook', this.statusHook, Object.assign(params, this.statusParams, httpHeaders)) - .catch((err) => this.logger.info(err, 'Conference:notifyConferenceEvent - error')); + .request( + 'verb:hook', + this.statusHook, + Object.assign( + params, + Object.assign( + { + conferenceSid: this.confName, + friendlyName: this.friendlyName, + }, + cs.callInfo.toJSON() + ), + httpHeaders + ) + ) + .catch((err) => + this.logger.info(err, 'Conference:notifyConferenceEvent - error') + ); } } diff --git a/lib/utils/place-outdial.js b/lib/utils/place-outdial.js index 030b789f..0df53522 100644 --- a/lib/utils/place-outdial.js +++ b/lib/utils/place-outdial.js @@ -441,7 +441,7 @@ class SingleDialer extends Emitter { }); app.requestor.request('session:adulting', '/adulting', { ...cs.callInfo.toJSON(), - parentCallInfo: this.parentCallInfo + parentCallInfo: this.parentCallInfo.toJSON() }).catch((err) => { newLogger.error({err}, 'doAdulting: error sending adulting request'); });