Skip to content

rtp: keep recently finished calls when matching media streams - #563

Open
Kaian wants to merge 1 commit into
masterfrom
fix/rtp-late-media
Open

rtp: keep recently finished calls when matching media streams#563
Kaian wants to merge 1 commit into
masterfrom
fix/rtp-late-media

Conversation

@Kaian

@Kaian Kaian commented Aug 17, 2026

Copy link
Copy Markdown
Member

Regression introduced in #547

Matching RTP against the active call list instead of the full one is a big speedup, but calls leave that list the moment their dialog finishes, while endpoints usually keep sending RTP/RTCP for a while after that.

Finished dialogs are no longer removed from the active call list right away. They are kept until their last SIP message is older than SIP_CALL_ACTIVE_GRACE_SECS (60 seconds), and pruned in sip_active_calls_expire() on every captured SIP message.

Since commit dc4148b RTP streams are only matched against calls in the
active call list, which greatly reduces processing time on large
captures. But calls are removed from that list as soon as their dialog
finishes, and endpoints usually keep sending RTP/RTCP for a while after
the dialog has been terminated.

Keep finished dialogs in the active call list until their last SIP
message is older than SIP_CALL_ACTIVE_GRACE_SECS (60 seconds), using the
capture timeline as reference so offline captures behave like live ones.
@Kaian

Kaian commented Aug 17, 2026

Copy link
Copy Markdown
Member Author

This requires additional testing, not sure how slow this will be with big pcap files

@seanbright

Copy link
Copy Markdown
Contributor

You could look for RTCP BYE packets (there's one in tests/aaa.pcap) to know when to end the stream, but those aren't strictly required or could get lost I suppose.

I think ending the call after a timeout is reasonable. 60 seconds seems a little high but I don't think it's problematic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants