mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 17:38:59 +00:00
centralize api interface
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@197 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user