From 7577b8aae8d19e61bb2f4412ac2f2ff5eef0da26 Mon Sep 17 00:00:00 2001 From: Raymond Chandler Date: Tue, 28 Sep 2010 11:02:35 -0400 Subject: [PATCH] add nat_map usage --- src/mod/applications/mod_commands/mod_commands.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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: