|
|
@@ -129,6 +129,21 @@ class VideoStopReceiptRestartTest {
|
|
|
assertEquals(2, world.closeRequests.size());
|
|
|
}
|
|
|
|
|
|
+ @Test void definitiveInviteRefusalLetsARealRtpCloseConvergeWithoutADialog() throws Exception {
|
|
|
+ External world = new External(); Instance instance = new Instance(world);
|
|
|
+ SSRCInfo allocation = instance.play.playManaged(world.node, "device", "channel", STREAM, (c, m, r) -> { });
|
|
|
+ assertNotNull(allocation);
|
|
|
+ Request invite = world.requests.get(world.requests.size() - 1);
|
|
|
+ // A final refusal means no dialog is ever established for this attempt. The real observer
|
|
|
+ // records the refusal before any error callback runs.
|
|
|
+ instance.response(invite, 486);
|
|
|
+ assertNull(instance.sessions.getSsrcTransactionByStream("rtp", STREAM));
|
|
|
+ // The exact RTP allocation is nonetheless real and must be reclaimable.
|
|
|
+ assertTrue(instance.rtp.closeManagedRTPServer(world.node, allocation));
|
|
|
+ assertTrue(new Instance(world).stopManaged(), "refused INVITE plus a positive RTP close must converge");
|
|
|
+ assertEquals(1, world.closeRequests.size());
|
|
|
+ }
|
|
|
+
|
|
|
@Test void managedStopRecoversOriginalDialogAfterByeReceiptAndLiveDialogDeletion() throws Exception {
|
|
|
External world = new External(); Instance first = new Instance(world);
|
|
|
first.managed();
|
|
|
@@ -303,8 +318,7 @@ class VideoStopReceiptRestartTest {
|
|
|
RTPServerParam param = new RTPServerParam(); param.setMediaServerItem(world.node); param.setStreamId(stream);
|
|
|
return rtp.openRTPServer(param, (code, msg, result) -> { });
|
|
|
}
|
|
|
- void managed() throws Exception {
|
|
|
- SSRCInfo info = play.playManaged(world.node, "device", "channel", STREAM, (c, m, r) -> { }); assertNotNull(info);
|
|
|
+ void managed() throws Exception { SSRCInfo info = play.playManaged(world.node, "device", "channel", STREAM, (c, m, r) -> { }); assertNotNull(info);
|
|
|
Request invite = world.requests.get(world.requests.size() - 1); assertEquals(Request.INVITE, invite.getMethod());
|
|
|
SIPResponse reply = reply(invite, 200);
|
|
|
reply.setContent("v=0\r\ns=Play\r\ny=" + info.getSsrc() + "\r\n",
|