From 5fc658e33b350912000dfaeee8e70b5032fc8f07 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Thu, 13 Jan 2022 13:31:07 -0500 Subject: [PATCH] Squashed commit of the following: commit a2e5cfb8e5ac853c627de3745c5e2f0c834cef76 Author: Razvan Crainea Date: Thu Jan 13 16:16:19 2022 +0200 Add tests for subscribe requests on paused media commit fa58596a9fed94086365ba5f3c0dfad5cd8c75b8 Author: Razvan Crainea Date: Wed Jan 12 22:01:27 2022 +0200 Swap media direction check for `subscribe request` as @rfuchs mentioned in his review, the SEND/RECV media flags are set according to rtpengine's perspective, not the media flow's one. commit e1e9a157c015cbb3794d3db716854b292910a545 Author: Razvan Crainea Date: Wed Jan 12 19:27:42 2022 +0200 Fix `subscribe request` SDP media direction When building the SDP for a `subscribe request` command, take into consideration the media direction of the source stream - if stream is `recvonly`, then we do not have anything to send, thus the direction should be advertised as `inactive`, rather than `sendonly`. Change-Id: I2d78bbec8ad584774f3c90f0ce5cca42f57f7b0f --- daemon/call.c | 5 +- t/auto-daemon-tests-pubsub.pl | 231 ++++++++++++++++++++++++++++++++++ 2 files changed, 235 insertions(+), 1 deletion(-) diff --git a/daemon/call.c b/daemon/call.c index ce001de68..2b4992ade 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -2975,7 +2975,10 @@ static int monologue_subscribe_request1(struct call_monologue *src_ml, struct ca codec_handlers_update(dst_media, src_media, flags, sp); - MEDIA_SET(dst_media, SEND); + if (MEDIA_ISSET(src_media, RECV)) + MEDIA_SET(dst_media, SEND); + else + MEDIA_CLEAR(dst_media, SEND); MEDIA_CLEAR(dst_media, RECV); __rtcp_mux_set(flags, dst_media); diff --git a/t/auto-daemon-tests-pubsub.pl b/t/auto-daemon-tests-pubsub.pl index 90ed487d4..cce2ec46c 100755 --- a/t/auto-daemon-tests-pubsub.pl +++ b/t/auto-daemon-tests-pubsub.pl @@ -650,6 +650,237 @@ rcv($sock_c, $port_c, rtpm(8, 2001, 4160, -1, "\x2a" x 160)); +($sock_a, $sock_b, $sock_c, $sock_d) = + new_call([qw(198.51.100.14 6112)], [qw(198.51.100.14 6114)], [qw(198.51.100.14 6116)]); + +($port_a) = offer('sub pause/resume', + { }, < ft() }, < $ttr }, < tt(), 'to-tag' => ft() }, < tt(), 'to-tag' => ft() }, < ft(), 'to-tag' => $ttr }, < $ttr }, < tt(), 'to-tag' => ft() }, < tt(), 'to-tag' => ft() }, < ft(), 'to-tag' => $ttr }, < $ttr }, <