Comparison

plugins/mod_turn_external.lua @ 13213:50324f66ca2a

plugins: Use integer config API with interval specification where sensible Many of these fall into a few categories: - util.cache size, must be >= 1 - byte or item counts that logically can't be negative - port numbers that should be in 1..0xffff
author Kim Alvefur <zash@zash.se>
date Mon, 17 Jul 2023 01:38:54 +0200
parent 13209:c8d949cf6b09
comparison
equal deleted inserted replaced
13212:3e6e98cc63e9 13213:50324f66ca2a
1 local set = require "prosody.util.set"; 1 local set = require "prosody.util.set";
2 2
3 local secret = module:get_option_string("turn_external_secret"); 3 local secret = module:get_option_string("turn_external_secret");
4 local host = module:get_option_string("turn_external_host", module.host); 4 local host = module:get_option_string("turn_external_host", module.host);
5 local user = module:get_option_string("turn_external_user"); 5 local user = module:get_option_string("turn_external_user");
6 local port = module:get_option_number("turn_external_port", 3478); 6 local port = module:get_option_integer("turn_external_port", 3478, 1, 65535);
7 local ttl = module:get_option_period("turn_external_ttl", "1 day"); 7 local ttl = module:get_option_period("turn_external_ttl", "1 day");
8 local tcp = module:get_option_boolean("turn_external_tcp", false); 8 local tcp = module:get_option_boolean("turn_external_tcp", false);
9 local tls_port = module:get_option_number("turn_external_tls_port"); 9 local tls_port = module:get_option_integer("turn_external_tls_port", nil, 1, 65535);
10 10
11 if not secret then 11 if not secret then
12 module:log_status("error", "Failed to initialize: the 'turn_external_secret' option is not set in your configuration"); 12 module:log_status("error", "Failed to initialize: the 'turn_external_secret' option is not set in your configuration");
13 return; 13 return;
14 end 14 end