From: Brian West Date: Mon, 14 Oct 2013 22:36:17 +0000 (-0500) Subject: Fix my snafu and allow [:port] [[:[:port] [[: 0 && iport < 0xFFFF) { + port = (switch_port_t) iport; + } + } else if (!zstr(src_ip)) { + ip = src_ip; } - if (pip) { - switch_copy_string(ip_buf, pip, sizeof(ip_buf)); + if ( !zstr(src_ip) ) { + switch_copy_string(ip_buf, src_ip, sizeof(ip_buf)); } else { switch_find_local_ip(ip_buf, sizeof(ip_buf), NULL, AF_INET); } @@ -6150,7 +6157,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_commands_load) SWITCH_ADD_API(commands_api_interface, "sql_escape", "Escape a string to prevent sql injection", sql_escape, SQL_ESCAPE_SYNTAX); SWITCH_ADD_API(commands_api_interface, "status", "Show current status", status_function, ""); SWITCH_ADD_API(commands_api_interface, "strftime_tz", "Display formatted time of timezone", strftime_tz_api_function, " [|][format string]"); - SWITCH_ADD_API(commands_api_interface, "stun", "Execute STUN lookup", stun_function, "[:port]"); + SWITCH_ADD_API(commands_api_interface, "stun", "Execute STUN lookup", stun_function, "[:port] [[: [count]"); SWITCH_ADD_API(commands_api_interface, "timer_test", "Exercise FS timer", timer_test_function, TIMER_TEST_SYNTAX);