Skip to content

Commit b65d010

Browse files
committed
fix(voice-call): avoid retaining replaced bridges
1 parent b738c6e commit b65d010

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎extensions/voice-call/src/webhook/realtime-handler.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ export class RealtimeCallHandler {
771771
typeof this.providerConfig.interruptResponseOnInputAudio === "boolean"
772772
? this.providerConfig.interruptResponseOnInputAudio
773773
: undefined;
774-
const predecessorBridge = this.activeBridgesByCallId.get(callId);
774+
const hadPredecessorOnAdmission = this.activeBridgesByCallId.has(callId);
775775
// Providers may close synchronously before createBridge returns; no consult can exist yet.
776776
const nativeConsultOwner: { current?: ActiveRealtimeVoiceBridge } = {};
777777
// Provisional ownership accepts callbacks fired during createBridge. Commit
@@ -1019,7 +1019,7 @@ export class RealtimeCallHandler {
10191019
// The active predecessor still owns call termination until creation succeeds.
10201020
if (
10211021
(owner && !ownsCallState) ||
1022-
(!owner && predecessorBridge && this.isActiveBridgeOwner(callId, predecessorBridge))
1022+
(!owner && hadPredecessorOnAdmission && this.activeBridgesByCallId.has(callId))
10231023
) {
10241024
return;
10251025
}

0 commit comments

Comments
 (0)