SDES: new crypto key in re-INVITE answer (hold) but ROC/SSRC kept -> one-way audio after resume
Maintainers usually reply within 2 days
@matteocanevari94-dot is already working on this.
Since Nov 4, 2026.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- perl
- Domain
- audio-video-rtc, security
Research direction
Start by tracing how rtpengine handles SDES keys and SRTP index/ROC state during a re-INVITE that puts a call on hold, then compare that path with the endpoint-change reset described in #1277. Use the supplied SIP, ng, and RTP captures to confirm whether the answer's new key is paired with the existing ROC. Done means the resumed phone can authenticate incoming audio after the sequence number has wrapped.
Written by the indexing model from the issue text.
Description
rtpengine version the issue has been seen with
11.2.2.0 git-mr11.2-db152948
Used distribution and its version
Ubuntu 24.04.5 LTS (container image of NethVoice proxy on NethServer 8), host Rocky Linux 9.8
Linux kernel version used
5.14.0-687.31.1.el9_8.x86_64
CPU architecture issue was seen on (see uname -m)
x86_64
Expected behaviour you didn't see
On a re-INVITE (hold) where nothing changed on the phone side, either:
- rtpengine keeps the same SDES key in the answer to the phone, or
- if it sends a new key, it starts a fresh SRTP context towards the phone (index/ROC reset or new SSRC), since the phone will create a new crypto context for the new key.
Audio towards the phone should keep working after resume.
Unexpected behaviour you saw
Setup: rtpengine driven by Kamailio with rtpengine_manage() (NethVoice proxy on NethServer 8, we can't upgrade rtpengine independently). Phones use SDES-SRTP (RTP/SAVP) towards rtpengine. No SDES-* flags in the options. Seen on 3 different phones (Fanvil X5 two hw/fw versions, Yealink DECT).
- When the phone puts the call on hold (re-INVITE sendonly), the answer to the phone contains a NEW a=crypto key. The phone keeps its own key. Happens on every hold, on every call.
- rtpengine keeps sending to the phone with the same SSRC and the same sequence/index as before.
- If the seq towards the phone already wrapped past 65535 before the hold (ROC = 1), after resume packets are encrypted with the new key but still with ROC 1. The phone starts the new context at ROC 0 and fails auth on everything -> phone hears nothing, the other side still hears the phone.
- If the wrap didn't happen yet (ROC 0) everything works, so it looks random. At 50 pps the wrap always happens within about 22 minutes.
In the other direction the phone starts a new SSRC with ROC 0 on every resume and rtpengine accepts it fine.
Steps to reproduce the problem
- Incoming call to a phone using SDES-SRTP via rtpengine.
- Keep the call up until the RTP seq towards the phone wraps past 65535 (max ~22 min at 50 pps; can be computed from the initial seq).
- Put the call on hold from the phone, then resume.
- The phone hears nothing from now on.
Reproduced twice: once on a production call (hold ~17 s after the wrap) and once in a lab test (wrap at ~16 min, hold and resume a few minutes later -> phone muted).
Additional program output to the terminal or logs illustrating the issue
SRTP auth tag recomputed on captured packets rtpengine -> phone, keys taken from the ng control channel (keys not shown here):
before wrap : original key + ROC 0 -> valid
after wrap : original key + ROC 1 -> valid
hold re-INVITE answer : rtpengine sends a new a=crypto key to the phone
after resume : new key + ROC 1 -> valid (same SSRC)
new key + ROC 0 -> no packet valid (what the phone uses)
Anything else?
Related: #1277 (ROC desync on hold/unhold, fixed by resetting the index on endpoint change - here the endpoint doesn't change, rtpengine changes its own key) and #71.
Questions:
- Is it intended that rtpengine generates a new SDES key in the answer to a re-INVITE when nothing changed on the phone side?
- If the outgoing key changes, shouldn't the index/ROC be reset (or a new SSRC used)?
- Is SDES-static the recommended workaround, and are there downsides?
- Was anything in this area changed after mr11.2?
We have SIP + ng + RTP captures and can share sanitized extracts if useful.
- Dominant language
- Perl
- Stars
- 992
- Forks
- 459
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from sipwise/rtpengine
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 2 days
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 75/100
Maintainers usually reply within 2 days
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 25/100
sipwise/rtpengine#2231 · 2 comments ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 57/100
Maintainers usually reply within 2 days
All issues in sipwise/rtpengine
Similar issues
-
ai-driven-fuzzing bug claude Minor
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
linagora/lemonldap-ng-plugins#170 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
libwww-perl/HTTP-Message#236 ·
-
1.severity: security
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
wave-followup
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
benchmarks/README: 'perl BNG2.pl model.bngl' runs the whole protocol, not just generate_networkOpendocumentation
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day