Kernel mode drops many DTMF events when DTMF packets are interleaved with audio packets
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 28/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- c, linux
- Lĩnh vực
- audio-video-rtc, networking
Hướng nghiên cứu
Start in kernel-module/xt_RTPENGINE.c at the pt_filter check (~lines 6268-6310) where packets with an unknown RTP payload type are dropped, then read daemon/media_socket.c (~1538-1560) where the kernel target's allowed payload-type list is built from payloads already observed. Reproduce with a g711 call carrying interleaved telephone-event packets (e.g. Cisco 7841). Done means DTMF still passes once the flow is kernelized, either by seeding the list from the SDP or by bubbling the unknown payload type up to userspace.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
rtpengine version the issue has been seen with
13.4.1.6-1~bpo12+1
Used distribution and its version
Debian 12
Linux kernel version used
6.1.0-38-amd64
CPU architecture issue was seen on (see uname -m)
x86_64
Expected behaviour you didn't see
1:1 Proxying of DTMF Events
Unexpected behaviour you saw
In kernel mode many DTMF events are dropped when DTMF packets are interleaved with audio packets.
When running rtpengine only in user mode then interleaved DTMF is passed without problems.
Steps to reproduce the problem
Generate a g711 call with interleaved DMTF in the style as shown in the screenshot. E.g. with a CISCO 7841 phone. DTMF packets of one event are sent with the same timestamp and increasing duration until the DTMF end packet has been reached, while interleaved audio packets have increasing timestamps. Interleaving of packets is unusual but allowed according to rfc4733 and rfc2833.
Additional program output to the terminal or logs illustrating the issue
Anything else?
Claude AI Code Analysis
I'll scan the kernel module and related RTP/DTMF handling to see how interleaved RTP and RFC2833 DTMF are processed, focusing on sequence/timestamp ordering, payload-type switching, and packet coalescing that could drop events. Running broad semantic and exact searches in parallel.
I'll look specifically inside the kernel module sources for RFC2833/4733 handling, sequence/timestamp checks, and any jitter/ordering assumptions that might drop interleaved events. Then I'll open the key files it points to.
I looked through the kernel module path (kernel-module/xt_RTPENGINE.c) and how userspace populates it (daemon/media_socket.c). The module doesn’t do any DTMF-specific parsing; it just forwards RTP if the payload type is allowed for that target.
Key observations:
- Kernel forwarding only passes payload types that were registered at kernelization time. See
pt_filterhandling:
// if RTP, only forward packets of known/passthrough payload types
if (rtp_pt_idx < 0) {
if (g->target.pt_filter)
goto out;
}
- The list of allowed payload types (
g->target.pt_stats[]) is built in userspace from the stream’s observed RTP payloads, then sorted and pushed down to the kernel:
struct rtp_stats *payload_types[RTPE_NUM_PAYLOAD_TYPES];
...
while (t_hash_table_iter_next(&iter, NULL, &rs) && s->num_payload_types < RTPE_NUM_PAYLOAD_TYPES)
s->payload_types[s->num_payload_types++] = rs;
qsort(s->payload_types, s->num_payload_types, sizeof(*s->payload_types), __rtp_stats_pt_sort);
...
if (!can_kernelize) {
reti->pt_filter = 1;
- Critically, that list is derived from payload types already seen on the stream, not from the SDP. So if you kernelize when only audio has been observed,
telephone-eventmay not be included. When DTMF later appears interleaved with audio, those packets have an “unknown” PT for the kernel target and are dropped (not propagated up to userspace), causing lost tones. - There’s no fallback to userspace on unknown PT when
pt_filteris set; packets are just dropped. - Nothing else in the kernel path (seq/jitter tracking, SRTP re-encrypt, pattern replacement, min_payload_len) explains selective loss tied specifically to interleaving. The
min_payload_lenandblackholegating only apply if configured, and don’t target DTMF by default.
Why interleaving triggers it:
- Audio continues, so the flow stays kernelized.
- First DTMF packets (start/continuations/end) come with PT
telephone-event, which wasn’t registered; the kernel drops them due topt_filter. - If the system never bubbles those packets to userspace, the kernel target never gets updated, so the receiver misses some or all tones.
Practical fixes:
- Userspace: when creating the kernel target, include
telephone-eventproactively based on SDP, not just observed traffic. Or always includetelephone-eventif negotiated in the stream’s codec set. - Userspace: if
pt_filteris enabled, on the first unknown payload type observed in userspace (or via a signal from kernel), reconfigure the kernel target to add it. - Kernel: instead of dropping unknown PT under
pt_filter, “propagate” the first unknown PT up to userspace so that it can update the kernel target, or temporarily forward unknown PT for a grace period. - Optional: for safety, treat
telephone-eventas allowed by default when RTP is allowed for the stream’s SSRC.
If you want, I can implement the userspace change in daemon/media_socket.c to seed the kernel target’s payload list from the SDP (including telephone-event) so interleaved DTMF isn’t dropped after kernelization.
// if RTP, only forward packets of known/passthrough payload types
if (rtp_pt_idx < 0) {
if (g->target.pt_filter)
goto out;
}
struct rtp_stats *payload_types[RTPE_NUM_PAYLOAD_TYPES];
...
while (t_hash_table_iter_next(&iter, NULL, &rs) && s->num_payload_types < RTPE_NUM_PAYLOAD_TYPES)
s->payload_types[s->num_payload_types++] = rs;
qsort(s->payload_types, s->num_payload_types, sizeof(*s->payload_types), __rtp_stats_pt_sort);
...
if (!can_kernelize) {
reti->pt_filter = 1;
- Ngôn ngữ chính
- Perl
- Star
- 992
- Fork
- 459
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của sipwise/rtpengine
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 2 ngày
-
HTTP/WS worker threads spin forever in `__websocket_write_done()` (`sched_yield` loop) — 100% CPU with `--listen-http`Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởbug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 15/100
sipwise/rtpengine#2197 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Kernel NULL pointer dereference in target_put() during target deletionCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởbug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
sipwise/rtpengine#2190 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Calls using a third logical interface are silently never written to Redis (breaks keyspace-notification HA)Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
sipwise/rtpengine#2181 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
sipwise/rtpengine#2162 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của sipwise/rtpengine
Issue tương tự
-
Add .gitattributes so share/skel keeps LF on a Windows git checkoutCó thể đã có người làm @sadhana-s-codez đã nhận 1 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
PerlDancer/Dancer2#1854 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
major/MySQLTuner-perl#1007 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 69/100
bioconda/bioconda-recipes#70187 ·
Maintainer thường phản hồi trong vòng 2 ngày