Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

RTPEngine invoked multiple times causes incorect SDP in last 200 OK

Đang mở
#1,671 5 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
15/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Lĩnh vực
audio-video-rtc

Hướng nghiên cứu

Start by locating where the log line "Not adding stray answer codec" is emitted in the codec negotiation path and how the codec list is filtered when an answer is processed. Reproduce with the exact four-command trace in the report (offer with strip/except PCMA, offer with mask/except, then two answers) and watch the codec_answer output. Done looks like the final 200 OK to CarrierA keeping PCMA/OPUS alongside telephone-event.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Hi,

during a call, when RTPengine is invoked multiple times, the final 200 OK response, which contains the SDP does not include any codecs. This results in audio issues, as no audio codecs are available for negotiation and use.
In the RTPengine log, when the last RTPengine call is made, there is a log entry stating "Not adding stray answer codec PCMA/8000 (8)." I think this log message indicates that the PCMA codec is not being included in the SDP of the final 200 OK response.

RTPEngine version:
Version: 11.2.1.4+0~mr11.2.1.4 git-mr11.2.1-1d93d9b4


Our call trace:
CarrierA -> Kamailio+RTPENGINE -> ..... -> Kamailio+RTPENGINE -> CarrierB

INVITEs

INVITE: CarrierA -> Kamailio+RTPENGINE

m=audio 20964 RTP/AVP 8 18 110
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=rtpmap:110 telephone-event/8000
a=ptime:20
a=3gOoBTC

RTPENGINE is invoked with following parameters:

[control] Dump for 'offer' from 1.2.3.4:57451: { "supports": [ "load limit" ], "sdp": "v=0
May 31 13:13:13 rtpengine2 rtpengine[768]: ", "ICE": "remove", "direction": [ "public", "internal_voice_network" ], "flags": [ "trust-address" ], "replace": [ "origin", "session-connection" ], "codec": { "strip": [ "all" ], "except": [ "PCMA", "telephone-event" ], "transcode": [ "OPUS" ] }, "rtcp-mux": [ "demux" ], "call-id": "d241db67-af69-46ca-b3f2-3ae2d6df8b85", "received-from": [ "IP4", "1.2.3.7" ], "from-tag": "SaU99KpKHKFvp", "command": "offer" }

INVITE: Kamailio+RTPENGINE -> ...... -> Kamailio+RTPENGINE (SDP is correctly modified)

m=audio 44606 RTP/AVP 8 96 97 110
a=3gOoBTC
a=rtpmap:8 PCMA/8000
a=rtpmap:96 OPUS/48000/2
a=rtpmap:97 telephone-event/48000
a=fmtp:97 0-15
a=rtpmap:110 telephone-event/8000
a=sendrecv
a=rtcp:44607
a=ptime:20

RTPENGINE is invoked with following parameters:

[control] Dump for 'offer' from 1.2.3.5:44685: { "supports": [ "load limit" ], "sdp": "v=0
May 31 13:13:13 rtpengine2 rtpengine[768]: ", "ICE": "remove", "direction": [ "internal_voice_network", "public" ], "flags": [ "trust-address" ], "replace": [ "origin", "session-connection" ], "codec": { "mask": [ "all" ], "except": [ "telephone-event" ], "transcode": [ "PCMU", "PCMA" ] }, "rtcp-mux": [ "demux" ], "call-id": "d241db67-af69-46ca-b3f2-3ae2d6df8b85", "received-from": [ "IP4", "1.2.3.8" ], "from-tag": "SaU99KpKHKFvp", "command": "offer" }

INVITE: Kamailio+RTPENGINE -> CarrierB (SDP is correctly modified)

m=audio 50102 RTP/AVP 0 8 110
a=3gOoBTC
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:110 telephone-event/8000
a=sendrecv
a=rtcp:50103
a=ptime:20

200 OKs

200 OK CarrierB -> Kamailio+RTPENGINE

m=audio 26848 RTP/AVP 0 110
a=rtpmap:0 PCMU/8000
a=rtpmap:110 telephone-event/8000
a=fmtp:110 0-15
a=silenceSupp:off - - - -
a=ptime:20

RTPENGINE is invoked with following parameters:

[control] Dump for 'answer' from 1.2.3.5:55824: { "supports": [ "load limit" ], "sdp": "v=0
May 31 13:13:14 rtpengine2 rtpengine[768]: ", "ICE": "remove", "direction": [ "public", "internal_voice_network" ], "flags": [ "trust-address" ], "replace": [ "origin", "session-connection" ], "codec": { "mask": [ "all" ], "except": [ "telephone-event" ], "transcode": [ "PCMU", "PCMA" ] }, "rtcp-mux": [ "demux" ], "call-id": "d241db67-af69-46ca-b3f2-3ae2d6df8b85", "received-from": [ "IP4", "1.2.3.7" ], "from-tag": "SaU99KpKHKFvp", "to-tag": "tKm2BF7pev5ej", "command": "answer" }

200 OK Kamailio+RTPENGINE -> ..... -> Kamailio+RTPENGINE (SDP is correctly modified)

m=audio 44626 RTP/AVP 8 110
a=silenceSupp:off - - - -
a=rtpmap:8 PCMA/8000
a=rtpmap:110 telephone-event/8000
a=sendrecv
a=rtcp:44627
a=ptime:20

RTPENGINE is invoked 4th time with following parameters:

[control] Dump for 'answer' from 1.2.3.4:57451: { "supports": [ "load limit" ], "sdp": "v=0
May 31 13:13:14 rtpengine2 rtpengine[768]: ", "ICE": "remove", "direction": [ "internal_voice_network", "public" ], "flags": [ "trust-address" ], "replace": [ "origin", "session-connection" ], "codec": { "strip": [ "all" ], "except": [ "PCMA", "telephone-event" ], "transcode": [ "OPUS" ] }, "rtcp-mux": [ "demux" ], "call-id": "d241db67-af69-46ca-b3f2-3ae2d6df8b85", "received-from": [ "IP4", "1.2.3.6" ], "from-tag": "SaU99KpKHKFvp", "to-tag": "tKm2BF7pev5ej", "command": "answer" }

200 OK Kamailio+RTPENGINE -> CarrierA (SDP is incorrect and missing PCMA and OPUS codec.)

m=audio 50082 RTP/AVP 110
a=silenceSupp:off - - - -
a=rtpmap:110 telephone-event/8000
a=sendrecv
a=rtcp:50083
a=ptime:20

Log from rtpengine:

[codec] Updating codecs for answerer tKm2BF7pev5ej #1
[codec] Not adding stray answer codec PCMA/8000 (8)
[codec] Adding codec telephone-event/8000 (110)
[codec] Setting up codec handlers for tKm2BF7pev5ej #1 -> SaU99KpKHKFvp #1
[codec] Default sink codec is PCMA/8000
[codec] Checking receiver codec telephone-event/8000/1 (110)
[codec] Sink codec is telephone-event/8000/1 (110)
[codec] Sink supports codec telephone-event/8000 for passthrough
[codec] Using passthrough handler for telephone-event/8000 with DTMF 110, CN -1
[codec] Codec answer for tKm2BF7pev5ej #1
[codec] Reverse codec for telephone-event/8000 (110) is telephone-event/8000 (110)
[codec] telephone-event/8000/1 payload type 110 already present, skip
[codec] Setting up codec handlers for SaU99KpKHKFvp #1 -> tKm2BF7pev5ej #1
[codec] Checking receiver codec telephone-event/8000/1 (110)
[codec] Sink codec is telephone-event/8000/1 (110)
[codec] Sink supports codec telephone-event/8000 for passthrough
[codec] Using passthrough handler for telephone-event/8000 with DTMF 110, CN -1
[codec] Updating supplemental codecs for SaU99KpKHKFvp #1
[codec] Updating supplemental codecs for tKm2BF7pev5ej #1
[codec] Setting up codec handlers for SaU99KpKHKFvp #1 -> tKm2BF7pev5ej #1
[codec] Checking receiver codec telephone-event/8000/1 (110)
[codec] Sink codec is telephone-event/8000/1 (110)
[codec] Sink supports codec telephone-event/8000 for passthrough
[codec] Using passthrough handler for telephone-event/8000 with DTMF 110, CN -1
[codec] Setting up codec handlers for tKm2BF7pev5ej #1 -> SaU99KpKHKFvp #1
[codec] Checking receiver codec telephone-event/8000/1 (110)
[codec] Sink codec is telephone-event/8000/1 (110)
[codec] Sink supports codec telephone-event/8000 for passthrough
[codec] Using passthrough handler for telephone-event/8000 with DTMF 110, CN -1
[control] Replying to 'answer' from 1.2.3.4:57451 (elapsed time 0.000299 sec)
[control] Response dump for 'answer' to 1.2.3.4:57451: { "sdp": "v=0
[core] Not switching from local socket 1.2.3.10:50102 to 1.2.3.9:44606 (not in list)
[core] Too many packets in UDP receive queue (more than 50), aborting loop. Dropped packets possible

I think the issue is the line with "[codec] Not adding stray answer codec PCMA/8000 (8)".
Why is the message Not adding stray codec generated? And what does it do?

Could you please help me to find out what can cause the issue and how to fix it?

Thank you in advance.

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

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của sipwise/rtpengine

Tất cả issue của sipwise/rtpengine

Issue tương tự

Thêm issue về Perl

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.