|
|
|
|
@ -708,7 +708,7 @@ static void __check_dtmf_injector(struct call_media *receiver, struct call_media
|
|
|
|
|
struct codec_handler *parent,
|
|
|
|
|
GHashTable *output_transcoders)
|
|
|
|
|
{
|
|
|
|
|
if (!sink->monologue->inject_dtmf)
|
|
|
|
|
if (!ML_ISSET(sink->monologue, INJECT_DTMF))
|
|
|
|
|
return;
|
|
|
|
|
if (parent->dtmf_payload_type != -1)
|
|
|
|
|
return;
|
|
|
|
|
@ -1095,9 +1095,9 @@ void __codec_handlers_update(struct call_media *receiver, struct call_media *sin
|
|
|
|
|
do_dtmf_detect = true;
|
|
|
|
|
|
|
|
|
|
if (a.flags && a.flags->inject_dtmf)
|
|
|
|
|
sink->monologue->inject_dtmf = 1;
|
|
|
|
|
ML_SET(sink->monologue, INJECT_DTMF);
|
|
|
|
|
|
|
|
|
|
bool use_ssrc_passthrough = MEDIA_ISSET(receiver, ECHO) || sink->monologue->inject_dtmf;
|
|
|
|
|
bool use_ssrc_passthrough = MEDIA_ISSET(receiver, ECHO) || ML_ISSET(sink->monologue, INJECT_DTMF);
|
|
|
|
|
|
|
|
|
|
// do we have to force everything through the transcoding engine even if codecs match?
|
|
|
|
|
bool force_transcoding = do_pcm_dtmf_blocking || do_dtmf_blocking || use_audio_player;
|
|
|
|
|
@ -1200,7 +1200,7 @@ sink_pt_fixed:;
|
|
|
|
|
&& sink_dtmf_pt->for_transcoding)
|
|
|
|
|
pcm_dtmf_detect = true;
|
|
|
|
|
|
|
|
|
|
if (receiver->monologue->detect_dtmf)
|
|
|
|
|
if (ML_ISSET(receiver->monologue, DETECT_DTMF))
|
|
|
|
|
pcm_dtmf_detect = true;
|
|
|
|
|
|
|
|
|
|
// special mode for DTMF blocking
|
|
|
|
|
@ -1298,7 +1298,7 @@ sink_pt_fixed:;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// force transcoding if we want DTMF injection and there's no DTMF PT
|
|
|
|
|
if (!sink_dtmf_pt && sink->monologue->inject_dtmf)
|
|
|
|
|
if (!sink_dtmf_pt && ML_ISSET(sink->monologue, INJECT_DTMF))
|
|
|
|
|
goto transcode;
|
|
|
|
|
|
|
|
|
|
// everything matches - we can do passthrough
|
|
|
|
|
@ -1657,7 +1657,7 @@ static int handler_func_passthrough(struct codec_handler *h, struct media_packet
|
|
|
|
|
codec_calc_jitter(mp->ssrc_in, ts, h->source_pt.clock_rate, &mp->tv);
|
|
|
|
|
codec_calc_lost(mp->ssrc_in, ntohs(mp->rtp->seq_num));
|
|
|
|
|
|
|
|
|
|
if (mp->media->monologue->block_short && h->source_pt.codec_def
|
|
|
|
|
if (ML_ISSET(mp->media->monologue, BLOCK_SHORT) && h->source_pt.codec_def
|
|
|
|
|
&& h->source_pt.codec_def->fixed_sizes)
|
|
|
|
|
{
|
|
|
|
|
if (!h->payload_len)
|
|
|
|
|
@ -1667,7 +1667,7 @@ static int handler_func_passthrough(struct codec_handler *h, struct media_packet
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
mp->media->monologue->dtmf_injection_active = 0;
|
|
|
|
|
ML_CLEAR(mp->media->monologue, DTMF_INJECTION_ACTIVE);
|
|
|
|
|
|
|
|
|
|
__buffer_delay_raw(h->delay_buffer, h, codec_add_raw_packet, mp, h->source_pt.clock_rate);
|
|
|
|
|
|
|
|
|
|
@ -2237,7 +2237,7 @@ static int packet_dtmf(struct codec_ssrc_handler *ch, struct codec_ssrc_handler
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else if (!input_ch->dtmf_events.length)
|
|
|
|
|
mp->media->monologue->dtmf_injection_active = 0;
|
|
|
|
|
ML_CLEAR(mp->media->monologue, DTMF_INJECTION_ACTIVE);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -2519,7 +2519,7 @@ static int handler_func_passthrough_ssrc(struct codec_handler *h, struct media_p
|
|
|
|
|
add_packet_fn = codec_add_raw_packet_dup;
|
|
|
|
|
}
|
|
|
|
|
else if (!ch->dtmf_events.length)
|
|
|
|
|
mp->media->monologue->dtmf_injection_active = 0;
|
|
|
|
|
ML_CLEAR(mp->media->monologue, DTMF_INJECTION_ACTIVE);
|
|
|
|
|
|
|
|
|
|
obj_put(&ch->h);
|
|
|
|
|
}
|
|
|
|
|
|