Comparison

plugins/mod_turn_external.lua @ 12437:9f5d0b77e3df 0.12

mod_turn_external: Update status and friendlier handling of missing secret option (fixes #1727)
author Matthew Wild <mwild1@gmail.com>
date Mon, 28 Mar 2022 10:47:21 +0100
parent 12290:aa7a8aa64d3f
child 12977:74b9e05af71e
comparison
equal deleted inserted replaced
12435:1ee72c0013f3 12437:9f5d0b77e3df
6 local port = module:get_option_number("turn_external_port", 3478); 6 local port = module:get_option_number("turn_external_port", 3478);
7 local ttl = module:get_option_number("turn_external_ttl", 86400); 7 local ttl = module:get_option_number("turn_external_ttl", 86400);
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_number("turn_external_tls_port");
10 10
11 if not secret then error("mod_" .. module.name .. " requires that 'turn_external_secret' be set") end 11 if not secret then
12 module:log_status("error", "Failed to initialize: the 'turn_external_secret' option is not set in your configuration");
13 return;
14 end
12 15
13 local services = set.new({ "stun-udp"; "turn-udp" }); 16 local services = set.new({ "stun-udp"; "turn-udp" });
14 if tcp then 17 if tcp then
15 services:add("stun-tcp"); 18 services:add("stun-tcp");
16 services:add("turn-tcp"); 19 services:add("turn-tcp");