SDES: new crypto key in re-INVITE answer (hold) but ROC/SSRC kept -> one-way audio after resume
Los mantenedores suelen responder en 2 días
@matteocanevari94-dot ya está trabajando en esto.
Desde el 4/11/2026.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- perl
- Área
- audio-video-rtc, security
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Perl
- Estrellas
- 992
- Forks
- 459
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de sipwise/rtpengine
-
RTCP SR/RR length check ignores the fixed header, report blocks are read past the packet endAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 2 días
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
Los mantenedores suelen responder en 2 días
-
bug
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
sipwise/rtpengine#2231 · 2 comentarios ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 57/100
Los mantenedores suelen responder en 2 días
Todos los issues de sipwise/rtpengine
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
libwww-perl/HTTP-Message#236 ·
-
1.severity: security
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
wave-followup
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
-
benchmarks/README: 'perl BNG2.pl model.bngl' runs the whole protocol, not just generate_networkAbiertodocumentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
virtualmin/virtualmin-gpl#1322 ·