From: Raymond Chandler Date: Tue, 28 Sep 2010 15:02:35 +0000 (-0400) Subject: add nat_map usage X-Git-Tag: v1.2-rc1~291^2~40^2~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7577b8aae8d19e61bb2f4412ac2f2ff5eef0da26;p=thirdparty%2Ffreeswitch.git add nat_map usage --- diff --git a/src/mod/applications/mod_commands/mod_commands.c b/src/mod/applications/mod_commands/mod_commands.c index 9b5455bac5..6a16a9c7e5 100644 --- a/src/mod/applications/mod_commands/mod_commands.c +++ b/src/mod/applications/mod_commands/mod_commands.c @@ -135,7 +135,7 @@ SWITCH_STANDARD_API(nat_map_function) switch_bool_t sticky = SWITCH_FALSE; if (!cmd) { - goto error; + goto usage; } if (!switch_nat_is_initialized()) { @@ -147,9 +147,8 @@ SWITCH_STANDARD_API(nat_map_function) switch_assert(mydata); argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0]))); - if (argc < 1) { - goto error; + goto usage; } if (argv[0] && switch_stristr("status", argv[0])) { tmp = switch_nat_status(); @@ -197,6 +196,10 @@ SWITCH_STANDARD_API(nat_map_function) error: stream->write_function(stream, "false"); + goto ok; + + usage: + stream->write_function(stream, "USAGE: nat_map [status|reinit|republish] | [add|del] [tcp|udp] [sticky]"); ok: