diff --git a/lib/tasks/dial.js b/lib/tasks/dial.js index d9ca0963..167e9b27 100644 --- a/lib/tasks/dial.js +++ b/lib/tasks/dial.js @@ -500,8 +500,10 @@ class TaskDial extends Task { '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')}), + ...(!JAMBONZ_DISABLE_DIAL_PAI_HEADER && req && { + ...(req.has('P-Asserted-Identity') && {'P-Asserted-Identity': req.get('P-Asserted-Identity')}), + ...(req.has('Privacy') && {'Privacy': req.get('Privacy')}), + }), ...(req && req.has('X-Voip-Carrier-Sid') && {'X-Voip-Carrier-Sid': req.get('X-Voip-Carrier-Sid')}), // Put headers at the end to make sure opt.headers override all default behavior. ...this.headers