From 1c48c40496c389b913aa2c156445c05c0137680f Mon Sep 17 00:00:00 2001 From: Hoan Luu Huu <110280845+xquanluu@users.noreply.github.com> Date: Thu, 17 Oct 2024 18:18:58 +0700 Subject: [PATCH] Support sip_parent_callid for sbc-outbound (#939) * include X-CID for dial outbound if the call-session is outbound * include X-CID for dial outbound if the call-session is outbound * include X-CID for dial outbound if the call-session is outbound * include X-CID for dial outbound if the call-session is outbound --- lib/tasks/dial.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/tasks/dial.js b/lib/tasks/dial.js index e11ee78e..d14397fe 100644 --- a/lib/tasks/dial.js +++ b/lib/tasks/dial.js @@ -484,7 +484,7 @@ class TaskDial extends Task { } async _attemptCalls(cs) { - const {req, srf} = cs; + const {req, callInfo, direction, srf} = cs; const {getSBC} = srf.locals; const {lookupTeamsByAccount, lookupAccountBySid} = srf.locals.dbHelpers; const {lookupCarrier, lookupCarrierByPhoneNumber} = dbUtils(this.logger, cs.srf); @@ -496,6 +496,7 @@ class TaskDial extends Task { this.headers = { 'X-Account-Sid': cs.accountSid, ...(req && req.has('X-CID') && {'X-CID': req.get('X-CID')}), + ...(direction === 'outbound' && callInfo.sbcCallid && {'X-CID': callInfo.sbcCallid}), ...(req && req.has('P-Asserted-Identity') && !JAMBONZ_DISABLE_DIAL_PAI_HEADER && {'P-Asserted-Identity': req.get('P-Asserted-Identity')}), ...(req && req.has('X-Voip-Carrier-Sid') && {'X-Voip-Carrier-Sid': req.get('X-Voip-Carrier-Sid')}),