Comparison

util/prosodyctl/check.lua @ 12380:3a702f37e87c

prosodyctl: check turn: always show debug info even if test fails
author Matthew Wild <mwild1@gmail.com>
date Sat, 05 Mar 2022 16:07:47 +0000
parent 12379:6ac3c580c00d
child 12381:d999c2b3e289
comparison
equal deleted inserted replaced
12379:6ac3c580c00d 12380:3a702f37e87c
1251 local result = check_turn_service(turn_service, opts.ping); 1251 local result = check_turn_service(turn_service, opts.ping);
1252 if #result.warnings > 0 then 1252 if #result.warnings > 0 then
1253 print(("%d warnings:\n\n "):format(#result.warnings)); 1253 print(("%d warnings:\n\n "):format(#result.warnings));
1254 print(table.concat(result.warnings, "\n ")); 1254 print(table.concat(result.warnings, "\n "));
1255 end 1255 end
1256
1257 if opts.verbose then
1258 if result.external_ip then
1259 print(("External IP: %s"):format(result.external_ip.address));
1260 end
1261 if result.relayed_addresses then
1262 for i, relayed_address in ipairs(result.relayed_addresses) do
1263 print(("Relayed address %d: %s:%d"):format(i, relayed_address.address, relayed_address.port));
1264 end
1265 end
1266 if result.external_ip_pong then
1267 print(("TURN external IP: %s"):format(result.external_ip_pong.address));
1268 end
1269 end
1270
1256 if result.error then 1271 if result.error then
1257 print("Error: "..result.error.."\n"); 1272 print("Error: "..result.error.."\n");
1258 ok = false; 1273 ok = false;
1259 else 1274 else
1260 if opts.verbose then
1261 print(("External IP: %s"):format(result.external_ip.address));
1262 if result.relayed_addresses then
1263 for i, relayed_address in ipairs(result.relayed_addresses) do
1264 print(("Relayed address %d: %s:%d"):format(i, relayed_address.address, relayed_address.port));
1265 end
1266 end
1267 if result.external_ip_pong then
1268 print(("TURN external IP: %s"):format(result.external_ip_pong.address));
1269 end
1270 end
1271 print("Success!\n"); 1275 print("Success!\n");
1272 end 1276 end
1273 end 1277 end
1274 end 1278 end
1275 1279