From 690b3b5b72ef75a82d65b8f73003e4462f4c5caa Mon Sep 17 00:00:00 2001 From: Moises Silva Date: Mon, 9 May 2011 02:32:31 -0400 Subject: [PATCH] add uuid completion to uuid_outgoing_answer fix segfault due to typo in uuid_outgoing_answer --- src/mod/applications/mod_commands/mod_commands.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/mod/applications/mod_commands/mod_commands.c b/src/mod/applications/mod_commands/mod_commands.c index 4a3502b35b..ae84463868 100644 --- a/src/mod/applications/mod_commands/mod_commands.c +++ b/src/mod/applications/mod_commands/mod_commands.c @@ -2050,7 +2050,7 @@ SWITCH_STANDARD_API(kill_function) #define OUTGOING_ANSWER_SYNTAX "" SWITCH_STANDARD_API(outgoing_answer_function) { - switch_core_session_t *asession = NULL; + switch_core_session_t *outgoing_session = NULL; char *mycmd = NULL; if (zstr(cmd) || !(mycmd = strdup(cmd))) { @@ -2058,17 +2058,17 @@ SWITCH_STANDARD_API(outgoing_answer_function) return SWITCH_STATUS_SUCCESS; } - if (zstr(mycmd) || !(asession = switch_core_session_locate(mycmd))) { + if (zstr(mycmd) || !(outgoing_session = switch_core_session_locate(mycmd))) { stream->write_function(stream, "-ERR No Such Channel!\n"); } else { - switch_channel_t *channel = switch_core_session_get_channel(asession); + switch_channel_t *channel = switch_core_session_get_channel(outgoing_session); if (switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_OUTBOUND) { switch_channel_mark_answered(channel); stream->write_function(stream, "+OK\n"); } else { stream->write_function(stream, "-ERR Not an outbound channel!\n"); } - switch_core_session_rwunlock(session); + switch_core_session_rwunlock(outgoing_session); } switch_safe_free(mycmd); @@ -5210,6 +5210,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_commands_load) switch_console_set_complete("add uuid_hold ::console::list_uuid"); switch_console_set_complete("add uuid_jitterbuffer ::console::list_uuid"); switch_console_set_complete("add uuid_kill ::console::list_uuid"); + switch_console_set_complete("add uuid_outgoing_answer ::console::list_uuid"); switch_console_set_complete("add uuid_limit_release ::console::list_uuid"); switch_console_set_complete("add uuid_loglevel ::console::list_uuid console"); switch_console_set_complete("add uuid_loglevel ::console::list_uuid alert");