Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/api/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,16 @@ export abstract class Session {
this.logger.error(error.message);
this.logger.error("Failed to send re-INVITE");
this.pendingReinvite = false;
throw error;
// The offer was applied before the send failed, so undo it; otherwise
// the next attempt cannot create a description at all.
return this.rollbackOffer()
.catch((rollbackError: Error) => {
this.logger.error(rollbackError.message);
this.logger.error("Failed to rollback offer after a failed re-INVITE");
})
.then(() => {
throw error;
});
});
}

Expand Down