TT#98901 add limit to length of DTX processing

Change-Id: I6fba28b985ff63de6185dccc2ca16f4264a0493d
pull/1116/head
Richard Fuchs 5 years ago
parent bae79d3fef
commit 17e22ade36

@ -74,6 +74,7 @@ struct dtx_buffer {
int tspp; // timestamp increment per packet
struct call *call;
unsigned long ts;
time_t start;
};
struct dtx_entry {
struct timerthread_queue_entry ttq_entry;
@ -1908,9 +1909,10 @@ static void __dtx_send_later(struct timerthread_queue *ttq, void *p) {
unsigned long dtxe_ts = dtxe->ts;
mutex_lock(&dtxb->lock);
unsigned int diff = rtpe_now.tv_sec - dtxb->start;
unsigned long dtxb_ts = dtxb->ts;
if (dtxe_ts == dtxb_ts) {
if (dtxe_ts == dtxb_ts && (rtpe_config.max_dtx <= 0 || diff < rtpe_config.max_dtx)) {
ilog(LOG_DEBUG, "RTP media for TS %lu+ missing, triggering DTX",
dtxe_ts);
@ -2301,6 +2303,7 @@ static int packet_decode(struct codec_ssrc_handler *ch, struct transcode_packet
mutex_lock(&dtxb->lock);
if (ts != dtxb->ts)
dtxb->ts = ts;
dtxb->start = rtpe_now.tv_sec;
mutex_unlock(&dtxb->lock);
struct dtx_entry *dtxe = g_slice_alloc0(sizeof(*dtxe));

@ -79,6 +79,7 @@ struct rtpengine_config rtpe_config = {
.media_num_threads = -1,
.dtls_rsa_key_size = 2048,
.dtls_signature = 256,
.max_dtx = 30,
};
static void sighandler(gpointer x) {
@ -461,6 +462,7 @@ static void options(int *argc, char ***argv) {
{ "http-threads", 0,0, G_OPTION_ARG_INT, &rtpe_config.http_threads,"Number of worker threads for HTTP and WS","INT"},
#ifdef WITH_TRANSCODING
{ "dtx-delay", 0,0, G_OPTION_ARG_INT, &rtpe_config.dtx_delay, "Delay in milliseconds to trigger DTX handling","INT"},
{ "max-dtx", 0,0, G_OPTION_ARG_INT, &rtpe_config.max_dtx, "Maximum duration of DTX handling", "INT"},
#endif
{ NULL, }

@ -738,6 +738,13 @@ time during a transmission gap, for example by generating comfort noise. The
delay should be configured to just slightly more than the expected incoming
jitter.
=item B<--max-dtx=>I<INT>
Maximum duration for DTX handling in seconds. If no further RTP media is
received within this time frame, then DTX processing will stop. Can be set to
zero or negative to disable and keep DTX processing on indefinitely. Defaults
to 30 seconds.
=back
=head1 INTERFACES

@ -107,6 +107,7 @@ struct rtpengine_config {
char *https_key;
int http_threads;
int dtx_delay;
int max_dtx;
};

Loading…
Cancel
Save