From 1c18df850d11224af7b579b6c5ac82f5151e80e8 Mon Sep 17 00:00:00 2001 From: Sreekanth Narayanan Date: Thu, 21 Dec 2023 19:02:52 +0530 Subject: [PATCH] fix(calling): remove logging of personal info --- .../CallingClient/calling/CallerId/index.ts | 44 +++---------------- packages/calling/src/common/Utils.ts | 8 ---- 2 files changed, 6 insertions(+), 46 deletions(-) diff --git a/packages/calling/src/CallingClient/calling/CallerId/index.ts b/packages/calling/src/CallingClient/calling/CallerId/index.ts index 88b7b385997..e78e5470bbd 100644 --- a/packages/calling/src/CallingClient/calling/CallerId/index.ts +++ b/packages/calling/src/CallingClient/calling/CallerId/index.ts @@ -138,10 +138,6 @@ export class CallerId implements ICallerId { if (nameMatch) { result.name = nameMatch[0].trimEnd(); - log.info(`Parsed Name: ${result.name}`, { - file: CALLER_ID_FILE, - method: 'parseSipUri', - }); } else { log.warn(`Name field not found!`, { file: CALLER_ID_FILE, @@ -153,10 +149,6 @@ export class CallerId implements ICallerId { if (phoneMatch && phoneMatch[0].length === num.length) { result.num = num; - log.info(`Parsed Number: ${result.num}`, { - file: CALLER_ID_FILE, - method: 'parseSipUri', - }); } else { log.warn(`Number field not found!`, { file: CALLER_ID_FILE, @@ -183,7 +175,7 @@ export class CallerId implements ICallerId { this.callerInfo.num = undefined; if ('p-asserted-identity' in callerId) { - log.info(`Parsing p-asserted-identity:- ${callerId['p-asserted-identity']}`, { + log.info('Parsing p-asserted-identity within remote party information', { file: CALLER_ID_FILE, method: 'fetchCallerDetails', }); @@ -192,29 +184,16 @@ export class CallerId implements ICallerId { /* For P-Asserted-Identity, we update the callerInfo blindly, as it is of highest preference */ this.callerInfo.name = result.name; this.callerInfo.num = result.num; - - log.info( - `CallerId retrieved from p-asserted-identity: name: ${this.callerInfo.name} , num: ${this.callerInfo.num}`, - { - file: CALLER_ID_FILE, - method: 'fetchCallerDetails', - } - ); } if (callerId.from) { - log.info(`Parsing from header:- ${callerId.from}`, { + log.info('Parsing from header within the remote party information', { file: CALLER_ID_FILE, method: 'fetchCallerDetails', }); const result = this.parseSipUri(callerId.from); - log.info(`CallerId retrieved from FROM: name: ${result.name} , num: ${result.num}`, { - file: CALLER_ID_FILE, - method: 'fetchCallerDetails', - }); - /* For From header , we should only update if not filled already by P-Asserted-Identity */ if (!this.callerInfo.name && result.name) { log.info('Updating name field from From header', { @@ -241,25 +220,14 @@ export class CallerId implements ICallerId { /* We need to parse x-broadworks-remote-party-info if present asynchronously */ if ('x-broadworks-remote-party-info' in callerId) { - log.info( - `Parsing x-broadworks-remote-party-info:- ${callerId['x-broadworks-remote-party-info']}`, - { - file: CALLER_ID_FILE, - method: 'fetchCallerDetails', - } - ); + log.info('Parsing x-broadworks-remote-party-info within remote party information', { + file: CALLER_ID_FILE, + method: 'fetchCallerDetails', + }); this.parseRemotePartyInfo(callerId['x-broadworks-remote-party-info'] as string); } - log.log( - `Intermediate callerId :- name: ${this.callerInfo.name} , num: ${this.callerInfo.num}`, - { - file: CALLER_ID_FILE, - method: 'fetchCallerDetails', - } - ); - return this.callerInfo; } } diff --git a/packages/calling/src/common/Utils.ts b/packages/calling/src/common/Utils.ts index a1254af13a0..0d3fcf45d64 100644 --- a/packages/calling/src/common/Utils.ts +++ b/packages/calling/src/common/Utils.ts @@ -1250,14 +1250,6 @@ export async function resolveCallerIdDisplay(filter: string) { displayResult.avatarSrc = photo ? photo.value : 'unknown'; displayResult.id = scimResource.id; - - log.info( - `Extracted details:- name: ${displayResult.name} , number: ${displayResult.num}, photo: ${displayResult.avatarSrc}, id: ${displayResult.id}`, - { - file: UTILS_FILE, - method: 'resolveCallerIdDisplay', - } - ); } return displayResult;