Browse Source

MT#60347 fix fringe DTMF payload type case

Change-Id: I2fbb659c445ec9733b87f01d75e38c50e69caf3a
(cherry picked from commit d799c66ba3)
mr11.5
Richard Fuchs 1 year ago
parent
commit
e030aaa71c
2 changed files with 78 additions and 4 deletions
  1. +12
    -4
      daemon/codec.c
  2. +66
    -0
      t/auto-daemon-tests.pl

+ 12
- 4
daemon/codec.c View File

@ -5423,8 +5423,12 @@ void __codec_store_answer(struct codec_store *dst, struct codec_store *src, stru
// handle associated supplemental codecs
if (h->cn_payload_type != -1) {
pt = g_hash_table_lookup(orig_dst.codecs, GINT_TO_POINTER(h->cn_payload_type));
if (!pt && a.allow_asymmetric)
pt = g_hash_table_lookup(src->codecs, GINT_TO_POINTER(h->cn_payload_type));
if (a.allow_asymmetric) {
struct rtp_payload_type *src_pt
= g_hash_table_lookup(src->codecs, GINT_TO_POINTER(h->cn_payload_type));
if (src_pt && (!pt || !rtp_payload_type_eq_compat(src_pt, pt)))
pt = src_pt;
}
if (!pt)
ilogs(codec, LOG_DEBUG, "CN payload type %i is missing", h->cn_payload_type);
else
@ -5435,8 +5439,12 @@ void __codec_store_answer(struct codec_store *dst, struct codec_store *src, stru
dtmf_payload_type = h->real_dtmf_payload_type;
if (dtmf_payload_type != -1) {
pt = g_hash_table_lookup(orig_dst.codecs, GINT_TO_POINTER(dtmf_payload_type));
if (!pt && a.allow_asymmetric)
pt = g_hash_table_lookup(src->codecs, GINT_TO_POINTER(dtmf_payload_type));
if (a.allow_asymmetric) {
struct rtp_payload_type *src_pt
= g_hash_table_lookup(src->codecs, GINT_TO_POINTER(dtmf_payload_type));
if (src_pt && (!pt || !rtp_payload_type_eq_compat(src_pt, pt)))
pt = src_pt;
}
if (!pt)
ilogs(codec, LOG_DEBUG, "DTMF payload type %i is missing", dtmf_payload_type);
else


+ 66
- 0
t/auto-daemon-tests.pl View File

@ -356,6 +356,72 @@ a=sendrecv
a=rtcp:PORT
SDP
new_call;
offer('duplicate t-e', { codec => {
strip => ['all'],
except => [qw/opus G722 PCMA telephone-event/],
transcode => ['telephone-event'],
} }, <<SDP);
v=0
o=- 1545997027 1 IN IP4 198.51.100.11
s=tester
t=0 0
m=audio 3000 RTP/AVP 127 98 97 9 8 101 102
c=IN IP4 198.51.100.50
a=sendrecv
a=rtpmap:127 EVS/16000/1
a=fmtp:127 evs-mode-switch=0;br=5.9-24.4;bw=nb-wb;cmr=-1;ch-aw-recv=0;max-red=0
a=rtpmap:98 AMR-WB/16000/1
a=fmtp:98 octet-align=0;mode-change-capability=2;max-red=0
a=rtpmap:97 AMR/8000/1
a=fmtp:97 octet-align=0;mode-change-capability=2;max-red=0
a=rtpmap:101 telephone-event/16000
a=rtpmap:102 telephone-event/8000
-------------------------------------------
v=0
o=- 1545997027 1 IN IP4 198.51.100.11
s=tester
t=0 0
m=audio PORT RTP/AVP 9 8 102
c=IN IP4 203.0.113.1
a=rtpmap:9 G722/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:102 telephone-event/8000
a=sendrecv
a=rtcp:PORT
SDP
answer('duplicate t-e', { flags => ['allow asymmetric codecs'] }, <<SDP);
v=0
o=- 1545997027 1 IN IP4 198.51.100.11
s=tester
t=0 0
m=audio 3000 RTP/AVP 8 101
c=IN IP4 198.51.100.50
a=sendrecv
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
-------------------------------------------
v=0
o=- 1545997027 1 IN IP4 198.51.100.11
s=tester
t=0 0
m=audio PORT RTP/AVP 8 101
c=IN IP4 203.0.113.1
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
a=rtcp:PORT
SDP
new_call;
offer('mismatched t-p-e with strip/except control', { codec => {


Loading…
Cancel
Save