OMG this rocks

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@102 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2005-12-09 22:19:08 +00:00
parent 86c1904cce
commit c5174dbcc8
8 changed files with 174 additions and 44 deletions

View File

@@ -33,6 +33,9 @@
static int switch_console_process(char *cmd)
{
switch_api_interface *api;
char *arg = NULL;
#ifdef EMBED_PERL
const char *perlhelp = "perl - execute some perl. (print to STDERR if you want to see it.)\n";
#else
@@ -53,6 +56,17 @@ static int switch_console_process(char *cmd)
return 1;
}
if (arg = strchr(cmd, ' ')) {
*arg++ = '\0';
}
if ((api = loadable_module_get_api_interface(cmd))) {
char retbuf[512] = "";
switch_status status = api->function(arg, retbuf, sizeof(retbuf));
switch_console_printf(SWITCH_CHANNEL_CONSOLE_CLEAN, "API CALL [%s(%s)] output:\n%s\n", cmd, arg ? arg : "", retbuf);
return 1;
}
#ifdef EMBED_PERL
if (!strncmp(cmd, "perl ", 5)) {
cmd += 5;