Browse Source

TT#92250 use matching output codec with inject-DTMF

Change-Id: I220947872303c534368363e8f980b94bd7d406a5
pull/1099/head
Richard Fuchs 5 years ago
parent
commit
74fd959ccc
2 changed files with 75 additions and 2 deletions
  1. +7
    -2
      daemon/codec.c
  2. +68
    -0
      t/auto-daemon-tests.pl

+ 7
- 2
daemon/codec.c View File

@ -1059,8 +1059,6 @@ void codec_handlers_update(struct call_media *receiver, struct call_media *sink,
// we ignore output codec matches if we must transcode DTMF // we ignore output codec matches if we must transcode DTMF
if (dtmf_pt && !reverse_dtmf_pt) if (dtmf_pt && !reverse_dtmf_pt)
; ;
else if (flags && flags->inject_dtmf)
;
else else
dest_codecs = g_hash_table_lookup(sink->codec_names_send, &pt->encoding); dest_codecs = g_hash_table_lookup(sink->codec_names_send, &pt->encoding);
} }
@ -1098,6 +1096,13 @@ void codec_handlers_update(struct call_media *receiver, struct call_media *sink,
goto transcode; goto transcode;
} }
if (flags && flags->inject_dtmf) {
// we have a matching output codec, but we were told that we might
// want to inject DTMF, so we must still go through our transcoding
// engine, despite input and output codecs being the same.
goto transcode;
}
// XXX check format parameters as well // XXX check format parameters as well
ilog(LOG_DEBUG, "Sink supports codec " STR_FORMAT, STR_FMT(&pt->encoding_with_params)); ilog(LOG_DEBUG, "Sink supports codec " STR_FORMAT, STR_FMT(&pt->encoding_with_params));
__make_passthrough_gsl(handler, &passthrough_handlers); __make_passthrough_gsl(handler, &passthrough_handlers);


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

@ -36,6 +36,74 @@ my ($sock_a, $sock_b, $sock_c, $sock_d, $port_a, $port_b, $ssrc, $resp,
# inject DTMF with mismatched codecs
new_call;
($sock_a, $sock_b) = new_call([qw(198.51.100.11 3000)], [qw(198.51.100.11 3002)]);
($port_a) = offer('inject, U/A offer',
{ ICE => 'remove', replace => ['origin'], flags => [qw(inject-DTMF)] }, <<SDP);
v=0
o=- 1545997027 1 IN IP4 198.51.100.11
s=tester
t=0 0
m=audio 3000 RTP/AVP 0 8 101
c=IN IP4 198.51.100.11
a=sendrecv
a=rtpmap:101 telephone-event/8000
----------------------------------
v=0
o=- 1545997027 1 IN IP4 203.0.113.1
s=tester
t=0 0
m=audio PORT RTP/AVP 0 8 101
c=IN IP4 203.0.113.1
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=sendrecv
a=rtcp:PORT
SDP
($port_b) = answer('inject, A/U offer',
{ ICE => 'remove', replace => ['origin'], flags => [qw(inject-DTMF)] }, <<SDP);
v=0
o=- 1545997027 1 IN IP4 198.51.100.11
s=tester
t=0 0
m=audio 3002 RTP/AVP 8 0 101
c=IN IP4 198.51.100.11
a=sendrecv
a=rtpmap:101 telephone-event/8000
----------------------------------
v=0
o=- 1545997027 1 IN IP4 203.0.113.1
s=tester
t=0 0
m=audio PORT RTP/AVP 8 0 101
c=IN IP4 203.0.113.1
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=sendrecv
a=rtcp:PORT
SDP
snd($sock_a, $port_b, rtp(8, 1000, 3000, 0x1234, "\x00" x 160));
rcv($sock_b, $port_a, rtpm(8, 1000, 3000, -1, "\x00" x 160));
snd($sock_b, $port_a, rtp(8, 2000, 4000, 0x3210, "\x00" x 160));
rcv($sock_a, $port_b, rtpm(8, 2000, 4000, -1, "\x00" x 160));
snd($sock_a, $port_b, rtp(0, 4000, 6000, 0x21d4, "\x00" x 160));
rcv($sock_b, $port_a, rtpm(0, 4000, 6000, -1, "\x00" x 160));
snd($sock_b, $port_a, rtp(0, 5000, 7000, 0x41b0, "\x00" x 160));
rcv($sock_a, $port_b, rtpm(0, 5000, 7000, -1, "\x00" x 160));
if (0) { if (0) {
# AMR-WB mode tests # AMR-WB mode tests


Loading…
Cancel
Save