Skip to content

Commit

Permalink
nat_traversal: remove min interval limit
Browse files Browse the repository at this point in the history
  • Loading branch information
okhowang committed Mar 23, 2023
1 parent 921fa4f commit 726246b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions modules/nat_traversal/nat_traversal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1763,6 +1763,7 @@ restore_keepalive_state(void)
static int
mod_init(void)
{
#define MIN_KEEPALIVE_INTERVAL 2
int *param;

if (keepalive_interval <= 0) {
Expand Down Expand Up @@ -1836,10 +1837,10 @@ mod_init(void)
restore_keepalive_state();

// check keepalive interval and add keepalive timer process
if (keepalive_interval < 10) {
LM_WARN("keepalive_interval should be at least 10 seconds\n");
LM_NOTICE("using 10 seconds for keepalive_interval\n");
keepalive_interval = 10;
if (keepalive_interval < MIN_KEEPALIVE_INTERVAL) {
LM_WARN("keepalive_interval should be at least %d seconds\n", MIN_KEEPALIVE_INTERVAL);
LM_NOTICE("using %d seconds for keepalive_interval\n", MIN_KEEPALIVE_INTERVAL);
keepalive_interval = MIN_KEEPALIVE_INTERVAL;
}

// allocate a shm variable to keep the counter used by the keepalive
Expand Down

0 comments on commit 726246b

Please sign in to comment.