TT#100200 fix logic for DTMF detection trigger

Change-Id: I814112e7c3c9673f29bde42c05517ad3802de1fb
pull/1126/head
Richard Fuchs 5 years ago
parent aa5e024417
commit 9ea1303c6b

@ -1033,8 +1033,8 @@ void codec_handlers_update(struct call_media *receiver, struct call_media *sink,
if (dtmf_payload_type != -1) {
// find a matching output DTMF payload type
dtmf_pt = g_hash_table_lookup(sink->codecs_recv, &dtmf_payload_type);
reverse_dtmf_pt = g_hash_table_lookup(receiver->codecs_send, &dtmf_payload_type);
dtmf_pt = g_hash_table_lookup(sink->codecs_send, &dtmf_payload_type);
reverse_dtmf_pt = g_hash_table_lookup(receiver->codecs_recv, &dtmf_payload_type);
if (reverse_dtmf_pt && dtmf_pt && rtp_payload_type_cmp(reverse_dtmf_pt, dtmf_pt))
reverse_dtmf_pt = NULL;
}
@ -1059,9 +1059,11 @@ void codec_handlers_update(struct call_media *receiver, struct call_media *sink,
// do we need to detect PCM DTMF tones?
int pcm_dtmf_detect = 0;
if (reverse_dtmf_pt)
if ((MEDIA_ISSET(sink, TRANSCODE) || (flags && flags->always_transcode))
&& dtmf_payload_type != -1
&& !g_hash_table_lookup(receiver->codecs_send, &dtmf_payload_type))
&& dtmf_pt && (!reverse_dtmf_pt || reverse_dtmf_pt->for_transcoding ||
!g_hash_table_lookup(receiver->codecs_send, &dtmf_payload_type)))
pcm_dtmf_detect = 1;
@ -1111,6 +1113,8 @@ void codec_handlers_update(struct call_media *receiver, struct call_media *sink,
// we ignore output codec matches if we must transcode DTMF
if (dtmf_pt && !reverse_dtmf_pt)
;
else if (pcm_dtmf_detect)
;
else
dest_codecs = g_hash_table_lookup(sink->codec_names_send, &pt->encoding);
}
@ -1222,7 +1226,7 @@ next:
// if the sink does not support DTMF but we can receive it, we must transcode
// DTMF event packets to PCM. this requires all codecs to be transcoded to the
// sink's preferred destination codec.
if (!transcode_supplemental && dtmf_payload_type == -1)
if (!transcode_supplemental && !pcm_dtmf_detect)
__make_passthrough_ssrc(handler);
else if (dtmf_pt && reverse_dtmf_pt)
__make_passthrough_ssrc(handler);

Loading…
Cancel
Save