create macro to define api command prototypes.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5167 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris committed 2007-05-12 21:36:15 +00:00
1 parent 493fdf5ba8
commit 521eac756e
12 files changed
+132 -128

No files matched your search

+1 -1
View File
@@ -1522,7 +1522,7 @@ static switch_status_t place_call(char **argv, int argc, switch_stream_handle_t
return SWITCH_STATUS_SUCCESS;
}
static switch_status_t pa_cmd(const char *cmd, switch_core_session_t *isession, switch_stream_handle_t *stream)
SWITCH_STANDARD_API(pa_cmd)
{
char *argv[1024] = { 0 };
int argc = 0;
+16 -16
View File
@@ -2028,7 +2028,7 @@ static void set_profile_val(mdl_profile_t *profile, char *var, char *val)
}
}
static switch_status_t dl_debug(const char *tf, switch_core_session_t *session, switch_stream_handle_t *stream)
SWITCH_STANDARD_API(dl_debug)
{
int on, cur;
@@ -2036,8 +2036,8 @@ static switch_status_t dl_debug(const char *tf, switch_core_session_t *session,
return SWITCH_STATUS_FALSE;
}
if (tf) {
on = switch_true(tf);
if (cmd) {
on = switch_true(cmd);
cur = ldl_global_debug(on);
} else {
cur = ldl_global_debug(-1);
@@ -2049,7 +2049,7 @@ static switch_status_t dl_debug(const char *tf, switch_core_session_t *session,
return SWITCH_STATUS_SUCCESS;
}
static switch_status_t dl_pres(const char *profile_name, switch_core_session_t *session, switch_stream_handle_t *stream)
SWITCH_STANDARD_API(dl_pres)
{
mdl_profile_t *profile;
@@ -2057,26 +2057,26 @@ static switch_status_t dl_pres(const char *profile_name, switch_core_session_t *
return SWITCH_STATUS_FALSE;
}
if (!profile_name) {
if (!cmd) {
stream->write_function(stream, "USAGE: %s\n", pres_api_interface.syntax);
return SWITCH_STATUS_SUCCESS;
}
if ((profile = switch_core_hash_find(globals.profile_hash, profile_name))) {
if ((profile = switch_core_hash_find(globals.profile_hash, cmd))) {
if (profile->user_flags & LDL_FLAG_COMPONENT) {
sign_on(profile);
stream->write_function(stream, "OK\n");
} else {
stream->write_function(stream, "NO PROFILE %s NOT A COMPONENT\n", profile_name);
stream->write_function(stream, "NO PROFILE %s NOT A COMPONENT\n", cmd);
}
} else {
stream->write_function(stream, "NO SUCH PROFILE %s\n", profile_name);
stream->write_function(stream, "NO SUCH PROFILE %s\n", cmd);
}
return SWITCH_STATUS_SUCCESS;
}
static switch_status_t dl_logout(const char *profile_name, switch_core_session_t *session, switch_stream_handle_t *stream)
SWITCH_STANDARD_API(dl_logout)
{
mdl_profile_t *profile;
@@ -2084,22 +2084,22 @@ static switch_status_t dl_logout(const char *profile_name, switch_core_session_t
return SWITCH_STATUS_FALSE;
}
if (!profile_name) {
if (!cmd) {
stream->write_function(stream, "USAGE: %s\n", logout_api_interface.syntax);
return SWITCH_STATUS_SUCCESS;
}
if ((profile = switch_core_hash_find(globals.profile_hash, profile_name))) {
if ((profile = switch_core_hash_find(globals.profile_hash, cmd))) {
ldl_handle_stop(profile->handle);
stream->write_function(stream, "OK\n");
} else {
stream->write_function(stream, "NO SUCH PROFILE %s\n", profile_name);
stream->write_function(stream, "NO SUCH PROFILE %s\n", cmd);
}
return SWITCH_STATUS_SUCCESS;
}
static switch_status_t dl_login(const char *arg, switch_core_session_t *session, switch_stream_handle_t *stream)
SWITCH_STANDARD_API(dl_login)
{
char *argv[10] = { 0 };
int argc = 0;
@@ -2111,16 +2111,16 @@ static switch_status_t dl_login(const char *arg, switch_core_session_t *session,
return SWITCH_STATUS_FALSE;
}
if (switch_strlen_zero(arg)) {
if (switch_strlen_zero(cmd)) {
stream->write_function(stream, "USAGE: %s\n", login_api_interface.syntax);
return SWITCH_STATUS_SUCCESS;
}
myarg = strdup(arg);
myarg = strdup(cmd);
argc = switch_separate_string(myarg, ';', argv, (sizeof(argv) / sizeof(argv[0])));
if (switch_strlen_zero(arg) || argc != 1) {
if (switch_strlen_zero(cmd) || argc != 1) {
stream->write_function(stream, "USAGE: %s\n", login_api_interface.syntax);
return SWITCH_STATUS_SUCCESS;
}
@@ -1711,13 +1711,13 @@ static switch_status_t place_call(char **argv, int argc, switch_stream_handle_t
return SWITCH_STATUS_SUCCESS;
}
static switch_status_t padep(const char *cmd, switch_core_session_t *isession, switch_stream_handle_t *stream)
SWITCH_STANDARD_API(padep)
{
stream->write_function(stream, "This command no longer exists (try 'pa help')\n");
return SWITCH_STATUS_SUCCESS;
}
static switch_status_t pa_cmd(const char *cmd, switch_core_session_t *isession, switch_stream_handle_t *stream)
SWITCH_STANDARD_API(pa_cmd)
{
char *argv[1024] = { 0 };
int argc = 0;
+2 -2
View File
@@ -1175,7 +1175,7 @@ static switch_status_t cmd_profile(char **argv, int argc, switch_stream_handle_t
return SWITCH_STATUS_SUCCESS;
}
static switch_status_t sofia_function(const char *cmd, switch_core_session_t *isession, switch_stream_handle_t *stream)
SWITCH_STANDARD_API(sofia_function)
{
char *argv[1024] = { 0 };
int argc = 0;
@@ -1190,7 +1190,7 @@ static switch_status_t sofia_function(const char *cmd, switch_core_session_t *is
"sofia status [[profile | gateway] <name>]\n"
"--------------------------------------------------------------------------------\n";
if (isession) {
if (session) {
return SWITCH_STATUS_FALSE;
}