Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit 19fda67

Browse files
authored
Avoid abnormal sdp state when publication/subscription failed (#429)
1 parent 0a4767c commit 19fda67

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/sdk/conference/channel.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,13 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
301301
media: {tracks: trackOptions},
302302
attributes: stream.attributes,
303303
transport: {id: this._id, type: 'webrtc'},
304+
}).catch((e) => {
305+
// Send SDP even when failed to get Answer.
306+
this._signaling.sendSignalingMessage('soac', {
307+
id: this._id,
308+
signaling: localDesc,
309+
});
310+
throw e;
304311
});
305312
}).then((data) => {
306313
const publicationId = data.id;
@@ -504,6 +511,13 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
504511
return this._signaling.sendSignalingMessage('subscribe', {
505512
media: {tracks: trackOptions},
506513
transport: {id: this._id, type: 'webrtc'},
514+
}).catch((e) => {
515+
// Send SDP even when failed to get Answer.
516+
this._signaling.sendSignalingMessage('soac', {
517+
id: this._id,
518+
signaling: localDesc,
519+
});
520+
throw e;
507521
});
508522
}).then((data) => {
509523
const subscriptionId = data.id;

0 commit comments

Comments
 (0)