|
@@ -90,10 +90,17 @@ public class ByeRequestProcessor extends SIPRequestProcessorParent implements In
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
// The request must match the pre-reply snapshot and both indexes at the durable write.
|
|
// The request must match the pre-reply snapshot and both indexes at the durable write.
|
|
|
- if (!sessionManager.rememberPeerBye(request, transaction)) return;
|
|
|
|
|
|
|
+ // A persistence failure must not skip media cleanup for a genuinely matching dialog; it
|
|
|
|
|
+ // only means the SIP termination stays unconfirmed, so the Invite/dialog is retained.
|
|
|
|
|
+ boolean recorded;
|
|
|
|
|
+ try { recorded = sessionManager.rememberPeerBye(request, transaction); }
|
|
|
|
|
+ catch (RuntimeException unavailable) { recorded = false; }
|
|
|
|
|
+ if (!recorded && !sessionManager.matchesPeerByeRequest(request, transaction)) return;
|
|
|
// Freeze original evidence before any Invite/dialog removal; unknown close stays retryable.
|
|
// Freeze original evidence before any Invite/dialog removal; unknown close stays retryable.
|
|
|
InviteInfo info = inviteStreamService.getInviteInfo(transaction.getType(), transaction.getChannelId(), transaction.getStream());
|
|
InviteInfo info = inviteStreamService.getInviteInfo(transaction.getType(), transaction.getChannelId(), transaction.getStream());
|
|
|
if (!rtpServerService.closeRTPServerForSession(transaction, info)) return;
|
|
if (!rtpServerService.closeRTPServerForSession(transaction, info)) return;
|
|
|
|
|
+ // Media is reclaimed; without durable peer evidence this is not a confirmed SIP termination.
|
|
|
|
|
+ if (!recorded) return;
|
|
|
if (info != null && !inviteStreamService.removeInviteInfoIfSame(info)) return;
|
|
if (info != null && !inviteStreamService.removeInviteInfoIfSame(info)) return;
|
|
|
if (!sessionManager.removeIfSame(transaction)) return;
|
|
if (!sessionManager.removeIfSame(transaction)) return;
|
|
|
if (transaction.getType() == InviteSessionType.PLAY) deviceChannelService.stopPlay(transaction.getChannelId());
|
|
if (transaction.getType() == InviteSessionType.PLAY) deviceChannelService.stopPlay(transaction.getChannelId());
|