Browse Source

TT#92250 keep supp codecs last when transcoding in reverse

Change-Id: I20d9b6e54c38ab92dcbe4e706ed04bca7145c373
pull/1093/head
Richard Fuchs 5 years ago
parent
commit
2502b44ff8
2 changed files with 85 additions and 4 deletions
  1. +14
    -0
      daemon/codec.c
  2. +71
    -4
      t/auto-daemon-tests.pl

+ 14
- 0
daemon/codec.c View File

@ -563,6 +563,7 @@ static void __accept_transcode_codecs(struct call_media *receiver, struct call_m
STR_FMT(&pt->encoding_with_params));
MEDIA_SET(receiver, TRANSCODE);
// we need a new pt entry
pt = __rtp_payload_type_copy(pt);
pt->for_transcoding = 1;
@ -570,6 +571,19 @@ static void __accept_transcode_codecs(struct call_media *receiver, struct call_m
// this somewhat duplicates __rtp_payload_type_add_recv
g_hash_table_insert(receiver->codecs_recv, &pt->payload_type, pt);
__rtp_payload_type_add_name(receiver->codec_names_recv, pt);
// keep supplemental codecs last
ensure_codec_def(pt, receiver);
if (!pt->codec_def || !pt->codec_def->supplemental) {
while (insert_pos) {
struct rtp_payload_type *ipt = insert_pos->data;
ensure_codec_def(ipt, receiver);
if (!ipt->codec_def || !ipt->codec_def->supplemental)
break;
insert_pos = insert_pos->prev;
}
}
if (!insert_pos) {
g_queue_push_head(&receiver->codecs_prefs_recv, pt);
insert_pos = receiver->codecs_prefs_recv.head;


+ 71
- 4
t/auto-daemon-tests.pl View File

@ -1044,6 +1044,73 @@ rcv($sock_a, $port_b, rtpm(96, 1004, 4200, $ssrc, "\xf0\x14\x41\x00\x30\x44\x41\
}
new_call;
offer('DTMF-inject w tp-e', {
ICE => 'remove',
flags => ['inject-DTMF'],
codec => {transcode => ['G722']},
}, <<SDP);
v=0
o=Z 58440449 0 IN IP4 89.225.243.254
s=Z
c=IN IP4 89.225.243.254
t=0 0
m=audio 8000 RTP/AVP 0 8 9 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:9 G722/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
--------------------------------------
v=0
o=Z 58440449 0 IN IP4 89.225.243.254
s=Z
c=IN IP4 203.0.113.1
t=0 0
m=audio PORT RTP/AVP 0 8 9 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:9 G722/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
a=rtcp:PORT
SDP
answer('DTMF-inject w tp-e', {
ICE => 'remove',
flags => ['inject-DTMF'],
}, <<SDP);
v=0
o=Z 58440449 0 IN IP4 89.225.243.254
s=Z
c=IN IP4 89.225.243.254
t=0 0
m=audio 8000 RTP/AVP 8 0 101
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
--------------------------------------
v=0
o=Z 58440449 0 IN IP4 89.225.243.254
s=Z
c=IN IP4 203.0.113.1
t=0 0
m=audio PORT RTP/AVP 8 0 9 101
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:9 G722/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
a=rtcp:PORT
SDP
new_call;
offer('symmetric codecs w missing answer codec, no flag', {
@ -2008,12 +2075,12 @@ o=dev 5418 9648 IN IP4 8.8.8.60
s=SIP Call
c=IN IP4 8.8.8.60
t=0 0
m=audio PORT RTP/AVP 101 0 8 3
m=audio PORT RTP/AVP 0 8 3 101
c=IN IP4 203.0.113.1
a=rtpmap:101 telephone-event/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
a=rtcp:PORT
@ -4132,13 +4199,13 @@ s=pjmedia
b=AS:117
t=0 0
a=X-nat:0
m=audio PORT RTP/AVP 107 101 8
m=audio PORT RTP/AVP 107 8 101
c=IN IP4 203.0.113.1
b=TIAS:96000
a=ssrc:243811319 cname:04389d431bdd5c52
a=rtpmap:107 opus/48000/2
a=rtpmap:101 telephone-event/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:107 useinbandfec=1
a=fmtp:101 0-16
a=sendrecv


Loading…
Cancel
Save