diff --git a/lib/session/call-session.js b/lib/session/call-session.js index 38a8cc5d..788b55a7 100644 --- a/lib/session/call-session.js +++ b/lib/session/call-session.js @@ -622,8 +622,10 @@ class CallSession extends Emitter { const res = await this.dlg.request({ method: 'INFO', headers: { - 'X-Reason': 'pauseCallRecording' - } + 'X-Reason': 'pauseCallRecording', + ...(this.recordOptions.headers && {'Content-Type': 'application/json'}) + }, + ...(this.recordOptions.headers && {body: JSON.stringify(this.recordOptions.headers) + '\n'}) }); if (res.status === 200) { this._recordState = RecordState.RecordingPaused; @@ -644,8 +646,10 @@ class CallSession extends Emitter { const res = await this.dlg.request({ method: 'INFO', headers: { - 'X-Reason': 'resumeCallRecording' - } + 'X-Reason': 'resumeCallRecording', + ...(this.recordOptions.headers && {'Content-Type': 'application/json'}) + }, + ...(this.recordOptions.headers && {body: JSON.stringify(this.recordOptions.headers) + '\n'}) }); if (res.status === 200) { this._recordState = RecordState.RecordingOn;