Browse Source

MT#55283 scale final-timeout

Change-Id: I59f95f472477099cb71caebd828b2178f2577285
pull/1938/head
Richard Fuchs 8 months ago
parent
commit
d3dc92aca9
4 changed files with 11 additions and 10 deletions
  1. +2
    -3
      daemon/call.c
  2. +3
    -3
      daemon/cli.c
  3. +5
    -3
      daemon/main.c
  4. +1
    -1
      include/main.h

+ 2
- 3
daemon/call.c View File

@ -140,9 +140,8 @@ static void call_timer_iterator(call_t *c, struct iterator_helper *hlp) {
log_info_call(c);
// final timeout applicable to all calls (own and foreign)
if (atomic_get_na(&rtpe_config.final_timeout)
&& rtpe_now >= (c->created + atomic_get_na(&rtpe_config.final_timeout) * 1000000LL)) // XXX scale to micro
{
int64_t final_timeout = atomic_get_na(&rtpe_config.final_timeout_us);
if (final_timeout && rtpe_now >= (c->created + final_timeout)) {
ilog(LOG_INFO, "Closing call due to final timeout");
tmp_t_reason = FINAL_TIMEOUT;
for (__auto_type it = c->monologues.head; it; it = it->next) {


+ 3
- 3
daemon/cli.c View File

@ -516,7 +516,7 @@ RTPE_CONFIG_ENDPOINT_QUEUE_PARAMS
X(bw_limit, "max-bw") \
X(timeout_us, "timeout") \
X(silent_timeout_us, "silent-timeout") \
X(final_timeout, "final-timeout") \
X(final_timeout_us, "final-timeout") \
X(control_tos, "control-tos") \
X(redis_allowed_errors, "redis_allowed_errors") \
X(redis_disable_time, "redis_disable_time") \
@ -657,7 +657,7 @@ static void cli_incoming_list_silenttimeout(str *instr, struct cli_writer *cw, c
cw->cw_printf(cw, "SILENT_TIMEOUT=%" PRId64 "\n", rtpe_config.silent_timeout_us / 1000000L);
}
static void cli_incoming_list_finaltimeout(str *instr, struct cli_writer *cw, const cli_handler_t *handler) {
cw->cw_printf(cw, "FINAL_TIMEOUT=%u\n", rtpe_config.final_timeout);
cw->cw_printf(cw, "FINAL_TIMEOUT=%" PRId64 "\n", rtpe_config.final_timeout_us / 1000000L);
}
static void cli_incoming_list_offertimeout(str *instr, struct cli_writer *cw, const cli_handler_t *handler) {
cw->cw_printf(cw, "OFFER_TIMEOUT=%u\n", rtpe_config.offer_timeout);
@ -1084,7 +1084,7 @@ static void cli_incoming_set_silenttimeout(str *instr, struct cli_writer *cw, co
cli_incoming_set_gentimeout_us(instr, cw, &rtpe_config.silent_timeout_us);
}
static void cli_incoming_set_finaltimeout(str *instr, struct cli_writer *cw, const cli_handler_t *handler) {
cli_incoming_set_gentimeout(instr, cw, &rtpe_config.final_timeout);
cli_incoming_set_gentimeout_us(instr, cw, &rtpe_config.final_timeout_us);
}
static void cli_incoming_set_offertimeout(str *instr, struct cli_writer *cw, const cli_handler_t *handler) {
cli_incoming_set_gentimeout(instr, cw, &rtpe_config.offer_timeout);


+ 5
- 3
daemon/main.c View File

@ -674,6 +674,7 @@ static void options(int *argc, char ***argv, charp_ht templates) {
g_autoptr(char) transcode_config = NULL;
int silent_timeout = 0;
int timeout = 0;
int final_timeout = 0;
GOptionEntry e[] = {
{ "table", 't', 0, G_OPTION_ARG_INT, &rtpe_config.kernel_table, "Kernel table to use", "INT" },
@ -706,7 +707,7 @@ static void options(int *argc, char ***argv, charp_ht templates) {
{ "control-pmtu", 0,0, G_OPTION_ARG_STRING, &control_pmtu, "Path MTU discovery behaviour on UDP control sockets", "want|dont" },
{ "timeout", 'o', 0, G_OPTION_ARG_INT, &timeout, "RTP timeout", "SECS" },
{ "silent-timeout",'s',0,G_OPTION_ARG_INT, &silent_timeout, "RTP timeout for muted", "SECS" },
{ "final-timeout",'a',0,G_OPTION_ARG_INT, &rtpe_config.final_timeout, "Call timeout", "SECS" },
{ "final-timeout",'a',0,G_OPTION_ARG_INT, &final_timeout, "Call timeout", "SECS" },
{ "offer-timeout",0,0, G_OPTION_ARG_INT, &rtpe_config.offer_timeout, "Timeout for incomplete one-sided calls", "SECS" },
{ "port-min", 'm', 0, G_OPTION_ARG_INT, &rtpe_config.port_min, "Lowest port to use for RTP", "INT" },
{ "port-max", 'M', 0, G_OPTION_ARG_INT, &rtpe_config.port_max, "Highest port to use for RTP", "INT" },
@ -1084,8 +1085,9 @@ static void options(int *argc, char ***argv, charp_ht templates) {
if (rtpe_config.offer_timeout <= 0)
rtpe_config.offer_timeout = 3600;
if (rtpe_config.final_timeout <= 0)
rtpe_config.final_timeout = 0;
rtpe_config.final_timeout_us = final_timeout * 1000000LL;
if (rtpe_config.final_timeout_us <= 0)
rtpe_config.final_timeout_us = 0;
if (rtpe_config.rtcp_interval <= 0)
rtpe_config.rtcp_interval = 5000;


+ 1
- 1
include/main.h View File

@ -36,7 +36,6 @@ enum endpoint_learning {
#define RTPE_CONFIG_INT_PARAMS \
X(kernel_table) \
X(max_sessions) \
X(final_timeout) \
X(offer_timeout) \
X(moh_max_duration) \
X(moh_max_repeats) \
@ -106,6 +105,7 @@ enum endpoint_learning {
X(bw_limit) \
X(silent_timeout_us) \
X(timeout_us) \
X(final_timeout_us) \
#define RTPE_CONFIG_BOOL_PARAMS \
X(homer_rtcp_off) \


Loading…
Cancel
Save