TT#88603 don't remove transcoded codecs we added ourselves

closes #1058

Change-Id: I469b8e71d5a699c948a30cb2171467c267eec741
pull/1072/head
Richard Fuchs 5 years ago
parent 1147f856c0
commit ae5b1762b9

@ -968,8 +968,10 @@ void codec_handlers_update(struct call_media *receiver, struct call_media *sink,
if (MEDIA_ISSET(sink, TRANSCODE)) {
// if the other side is transcoding, we may come across a receiver entry
// (recv->recv) that wasn't originally offered (recv->send). we must eliminate
// those
if (!g_hash_table_lookup(receiver->codecs_send, &pt->payload_type)) {
// those, unless we added them ourselves for transcoding.
struct rtp_payload_type *recv_pt =
g_hash_table_lookup(receiver->codecs_send, &pt->payload_type);
if (!recv_pt && !pt->for_transcoding) {
ilog(LOG_DEBUG, "Eliminating transcoded codec " STR_FORMAT,
STR_FMT(&pt->encoding_with_params));
@ -2382,6 +2384,7 @@ void codec_rtp_payload_types(struct call_media *media, struct call_media *other_
pt = codec_add_payload_type(codec, media);
if (!pt)
continue;
pt->for_transcoding = 1;
if (__codec_synth_transcode_options(pt, flags, media))
continue;

@ -29,6 +29,8 @@ struct rtp_payload_type {
int bitrate;
const codec_def_t *codec_def;
int for_transcoding:1;
};

@ -36,6 +36,113 @@ my ($sock_a, $sock_b, $sock_c, $sock_d, $port_a, $port_b, $ssrc, $resp,
# GH 1058
new_call;
offer('missing codec in re-invite', {
ICE => 'remove',
flags => ["codec-mask-all", "codec-strip-telephone-event", "codec-transcode-PCMU", "codec-transcode-G722", "codec-transcode-t38", "codec-offer-telephone-event", "port-latching"],
'to-tag' => tt(),
}, <<SDP);
v=0
o=dev 623840 205550 IN IP4 8.8.8.61
s=SIP Media Capabilities
c=IN IP4 8.8.8.61
t=0 0
m=audio 6304 RTP/AVP 0 8 3 101
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=maxptime:20
--------------------------------------
v=0
o=dev 623840 205550 IN IP4 8.8.8.61
s=SIP Media Capabilities
c=IN IP4 203.0.113.1
t=0 0
m=audio PORT RTP/AVP 101 0 9
a=maxptime:20
a=rtpmap:101 telephone-event/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:9 G722/8000
a=fmtp:101 0-15
a=sendrecv
a=rtcp:PORT
SDP
answer('missing codec in re-invite', {
ICE => 'remove',
flags => ["trust-address", "symmetric-codecs"],
}, <<SDP);
v=0
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 6004 RTP/AVP 9 101
c=IN IP4 8.8.8.60
a=rtpmap:9 G722/8000
a=fmtp:9 bitrate=64
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
--------------------------------------
v=0
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
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=fmtp:101 0-15
a=sendrecv
a=rtcp:PORT
SDP
offer('missing codec in re-invite', {
ICE => 'remove',
flags => ["codec-mask-all", "codec-strip-telephone-event", "codec-transcode-PCMU", "codec-transcode-G722", "codec-transcode-t38", "codec-offer-telephone-event", "port-latching"],
'to-tag' => tt(),
}, <<SDP);
v=0
o=dev 623840 205550 IN IP4 8.8.8.61
s=SIP Media Capabilities
c=IN IP4 8.8.8.61
t=0 0
m=audio 6304 RTP/AVP 0 8 3 101
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=maxptime:20
--------------------------------------
v=0
o=dev 623840 205550 IN IP4 8.8.8.61
s=SIP Media Capabilities
c=IN IP4 203.0.113.1
t=0 0
m=audio PORT RTP/AVP 101 0 9
a=maxptime:20
a=rtpmap:101 telephone-event/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:9 G722/8000
a=fmtp:101 0-15
a=sendrecv
a=rtcp:PORT
SDP
# DTLS-reverse flag
new_call;

Loading…
Cancel
Save