centralize api interface

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@197 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2005-12-23 02:55:25 +00:00
parent 32273a0c3f
commit f52b45c2c9
4 changed files with 25 additions and 23 deletions

View File

@@ -406,3 +406,17 @@ SWITCH_DECLARE(int) loadable_module_get_codecs_sorted(switch_memory_pool *pool,
return i;
}
SWITCH_DECLARE(switch_status) switch_api_execute(char *cmd, char *arg, char *retbuf, size_t len)
{
switch_api_interface *api;
if ((api = loadable_module_get_api_interface(cmd))) {
api->function(arg, retbuf, len);
} else {
snprintf(retbuf, len, "INVALID COMMAND [%s]", cmd);
return SWITCH_STATUS_FALSE;
}
return SWITCH_STATUS_SUCCESS;
}