|
@@ -124,7 +124,7 @@ LOW_DEFAULT_PORTS_BOUNDARY,HIGH_DEFAULT_PORTS_BOUNDARY,0,0,0,"",
|
|
|
/////////////// stop server ////////////////
|
|
|
0,
|
|
|
/////////////// MISC PARAMS ////////////////
|
|
|
-0,0,0,0,0,':',0,0,0,TURN_CREDENTIALS_NONE,0,0,0,0,0,0,
|
|
|
+0,0,0,0,0,':',0,0,0,0,TURN_CREDENTIALS_NONE,0,0,0,0,0,0,
|
|
|
///////////// Users DB //////////////
|
|
|
{ (TURN_USERDB_TYPE)0, {"\0"}, {0,NULL, {NULL,0}} },
|
|
|
///////////// CPUs //////////////////
|
|
@@ -549,6 +549,8 @@ static char Usage[] = "Usage: turnserver [options]\n"
|
|
|
" This option can be used, for example, together with the logrotate tool.\n"
|
|
|
" --stale-nonce[=<value>] Use extra security with nonce value having limited lifetime (default 600 secs).\n"
|
|
|
" --max-allocate-lifetime <value> Set the maximum value for the allocation lifetime. Default to 3600 secs.\n"
|
|
|
+" --channel-lifetime <value> Set the lifetime for channel binding, default to 600 secs.\n"
|
|
|
+" This value MUST not be changed for production purposes.\n"
|
|
|
" -S, --stun-only Option to set standalone STUN operation only, all TURN requests will be ignored.\n"
|
|
|
" --no-stun Option to suppress STUN functionality, only TURN requests will be processed.\n"
|
|
|
" --alternate-server <ip:port> Set the TURN server to redirect the allocate requests (UDP and TCP services).\n"
|
|
@@ -672,6 +674,7 @@ enum EXTRA_OPTS {
|
|
|
MAX_PORT_OPT,
|
|
|
STALE_NONCE_OPT,
|
|
|
MAX_ALLOCATE_LIFETIME_OPT,
|
|
|
+ CHANNEL_LIFETIME_OPT,
|
|
|
AUTH_SECRET_OPT,
|
|
|
DEL_ALL_AUTH_SECRETS_OPT,
|
|
|
STATIC_AUTH_SECRET_VAL_OPT,
|
|
@@ -790,6 +793,7 @@ static const struct myoption long_options[] = {
|
|
|
{ "no-tcp-relay", optional_argument, NULL, NO_TCP_RELAY_OPT },
|
|
|
{ "stale-nonce", optional_argument, NULL, STALE_NONCE_OPT },
|
|
|
{ "max-allocate-lifetime", optional_argument, NULL, MAX_ALLOCATE_LIFETIME_OPT },
|
|
|
+ { "channel-lifetime", optional_argument, NULL, CHANNEL_LIFETIME_OPT },
|
|
|
{ "stun-only", optional_argument, NULL, 'S' },
|
|
|
{ "no-stun", optional_argument, NULL, NO_STUN_OPT },
|
|
|
{ "cert", required_argument, NULL, CERT_FILE_OPT },
|
|
@@ -1054,6 +1058,9 @@ static void set_option(int c, char *value)
|
|
|
case MAX_ALLOCATE_LIFETIME_OPT:
|
|
|
turn_params.max_allocate_lifetime = get_int_value(value, STUN_DEFAULT_MAX_ALLOCATE_LIFETIME);
|
|
|
break;
|
|
|
+ case CHANNEL_LIFETIME_OPT:
|
|
|
+ turn_params.channel_lifetime = get_int_value(value, STUN_DEFAULT_CHANNEL_LIFETIME);
|
|
|
+ break;
|
|
|
case MAX_ALLOCATE_TIMEOUT_OPT:
|
|
|
TURN_MAX_ALLOCATE_TIMEOUT = atoi(value);
|
|
|
TURN_MAX_ALLOCATE_TIMEOUT_STUN_ONLY = atoi(value);
|