From 74ace9ad7282669f2ecf0703c4e44a7ba425bd89 Mon Sep 17 00:00:00 2001 From: Quan HL Date: Thu, 29 Feb 2024 15:39:08 +0700 Subject: [PATCH 1/3] allow send customer headers in re-invite --- app.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app.js b/app.js index c439689..8c13282 100644 --- a/app.js +++ b/app.js @@ -299,7 +299,7 @@ class SrsClient extends Emitter { return true; } - async pause() { + async pause({options}) { if (this.paused) return; const opts = { 'call-id': this.rtpEngineOpts.common['call-id'], @@ -315,7 +315,9 @@ class SrsClient extends Emitter { 'from-tag': fromTag }); } - await this.uac.modify(this.sdpOffer); + await this.uac.modify(this.sdpOffer, { + headers: options.headers || {} + }); this.paused = true; return true; } catch (err) { @@ -324,7 +326,7 @@ class SrsClient extends Emitter { return false; } - async resume() { + async resume({options}) { if (!this.paused) return; const opts = { 'call-id': this.rtpEngineOpts.common['call-id'], @@ -340,7 +342,9 @@ class SrsClient extends Emitter { 'from-tag': fromTag }); } - await this.uac.modify(this.sdpOffer); + await this.uac.modify(this.sdpOffer, { + headers: options.headers || {} + }); this.paused = false; return true; } catch (err) { From bb8717e66f635da5307a041b109418ca31be1f87 Mon Sep 17 00:00:00 2001 From: Quan HL Date: Fri, 1 Mar 2024 15:06:24 +0700 Subject: [PATCH 2/3] wip --- app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index 8c13282..66e60bb 100644 --- a/app.js +++ b/app.js @@ -316,7 +316,7 @@ class SrsClient extends Emitter { }); } await this.uac.modify(this.sdpOffer, { - headers: options.headers || {} + headers: options?.headers || {} }); this.paused = true; return true; @@ -343,7 +343,7 @@ class SrsClient extends Emitter { }); } await this.uac.modify(this.sdpOffer, { - headers: options.headers || {} + headers: options?.headers || {} }); this.paused = false; return true; From 604515583148574e4baef38aad883d0cac457d8b Mon Sep 17 00:00:00 2001 From: Quan HL Date: Mon, 4 Mar 2024 16:25:48 +0700 Subject: [PATCH 3/3] wip --- app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index 66e60bb..846c362 100644 --- a/app.js +++ b/app.js @@ -299,7 +299,7 @@ class SrsClient extends Emitter { return true; } - async pause({options}) { + async pause(options) { if (this.paused) return; const opts = { 'call-id': this.rtpEngineOpts.common['call-id'], @@ -326,7 +326,7 @@ class SrsClient extends Emitter { return false; } - async resume({options}) { + async resume(options) { if (!this.paused) return; const opts = { 'call-id': this.rtpEngineOpts.common['call-id'],