[Freeswitch-svn] [commit] r13102 - freeswitch/trunk/src/mod/applications/mod_commands
FreeSWITCH SVN
anthm at freeswitch.org
Tue Apr 21 10:41:54 PDT 2009
Author: anthm
Date: Tue Apr 21 12:41:54 2009
New Revision: 13102
Log:
fix arg parsing in new command
Modified:
freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c
Modified: freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c Tue Apr 21 12:41:54 2009
@@ -532,6 +532,11 @@
switch_core_session_t *xsession;
char uuid[80] = "";
+ if (switch_strlen_zero(cmd)) {
+ stream->write_function(stream, "-ERR, no input\n");
+ return SWITCH_STATUS_SUCCESS;
+ }
+
dup = strdup(cmd);
mycmd = dup;
@@ -558,8 +563,10 @@
*arg++ = '\0';
}
- expanded = switch_event_expand_headers(stream->param_event, arg);
- status = switch_api_execute(mycmd, expanded, session, stream);
+ expanded = arg ? switch_event_expand_headers(stream->param_event, arg) : arg;
+ if ((status = switch_api_execute(mycmd, expanded, session, stream)) != SWITCH_STATUS_SUCCESS) {
+ stream->write_function(stream, "-ERR, error executing command\n");
+ }
if (expanded != arg) {
free(expanded);
@@ -569,7 +576,7 @@
free(dup);
dup = NULL;
- return status;
+ return SWITCH_STATUS_SUCCESS;
}
More information about the Freeswitch-svn
mailing list