MT#55283 Keep the takeover grace period until media is accepted

After a takeover, FOREIGN_MEDIA holds off the media timeout until the
call receives media. The flag is cleared by the first packet that
arrives on any of the call's sockets, before the packet is checked, so
a packet that is then dropped, for example because of strict-source,
ends the grace period without refreshing the stream's last packet time.
A call that was restored longer than the timeout ago is then closed on
the next timer run, before its real media has had a chance to arrive.

With the peer address confirmation now restored from Redis, this is
what happens to an adopted strict-source call when a stray packet
arrives ahead of the peer's first one.

Clear the flag only once a packet has passed the address check. The
timer still clears it for kernel-forwarded media, and the grace period
stays bounded by the timeout after the takeover.

Ref #2184

Change-Id: Ib06a170d271e8aea709abc57cbfd3bcc59196ab5
(cherry picked from commit 1d783ba1b9)
(cherry picked from commit 4f9c4f3f13)
mr26.2.1
baseballyama 2 months ago committed by Richard Fuchs
parent a77702103a
commit e7f29214c0

@ -3510,8 +3510,6 @@ static int stream_packet(struct packet_handler_ctx *phc) {
if (!phc->mp.stream->selected_sfd)
goto out;
CALL_CLEAR(phc->mp.call, FOREIGN_MEDIA);
if (CALL_ISSET(phc->mp.call, DROP_TRAFFIC))
goto drop;
@ -3553,6 +3551,9 @@ static int stream_packet(struct packet_handler_ctx *phc) {
if (media_packet_address_check(phc))
goto drop;
// only media we accept ends the grace period after a takeover
CALL_CLEAR(phc->mp.call, FOREIGN_MEDIA);
PS_SET(phc->mp.stream, RECEIVED);
if (rtpe_config.active_switchover && IS_FOREIGN_CALL(phc->mp.call))

Loading…
Cancel
Save