let more commands in mod_commmands run from the dialplan via the eval app
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10790 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
4dc7d512e2
commit
0ff626934b
|
@ -457,10 +457,6 @@ SWITCH_STANDARD_API(reload_acl_function)
|
||||||
const char *err;
|
const char *err;
|
||||||
switch_xml_t xml_root;
|
switch_xml_t xml_root;
|
||||||
|
|
||||||
if (session) {
|
|
||||||
return SWITCH_STATUS_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cmd && !strcmp(cmd, "reloadxml")) {
|
if (cmd && !strcmp(cmd, "reloadxml")) {
|
||||||
if ((xml_root = switch_xml_open_root(1, &err))) {
|
if ((xml_root = switch_xml_open_root(1, &err))) {
|
||||||
switch_xml_free(xml_root);
|
switch_xml_free(xml_root);
|
||||||
|
@ -696,10 +692,6 @@ SWITCH_STANDARD_API(status_function)
|
||||||
int sps = 0, last_sps = 0;
|
int sps = 0, last_sps = 0;
|
||||||
const char *var;
|
const char *var;
|
||||||
|
|
||||||
if (session) {
|
|
||||||
return SWITCH_STATUS_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch_core_measure_time(switch_core_uptime(), &duration);
|
switch_core_measure_time(switch_core_uptime(), &duration);
|
||||||
|
|
||||||
if (stream->param_event) {
|
if (stream->param_event) {
|
||||||
|
@ -877,10 +869,6 @@ SWITCH_STANDARD_API(load_function)
|
||||||
{
|
{
|
||||||
const char *err;
|
const char *err;
|
||||||
|
|
||||||
if (session) {
|
|
||||||
return SWITCH_STATUS_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (switch_strlen_zero(cmd)) {
|
if (switch_strlen_zero(cmd)) {
|
||||||
stream->write_function(stream, "-USAGE: %s\n", LOAD_SYNTAX);
|
stream->write_function(stream, "-USAGE: %s\n", LOAD_SYNTAX);
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
|
@ -902,10 +890,6 @@ SWITCH_STANDARD_API(unload_function)
|
||||||
switch_bool_t force = SWITCH_FALSE;
|
switch_bool_t force = SWITCH_FALSE;
|
||||||
const char *p = cmd;
|
const char *p = cmd;
|
||||||
|
|
||||||
if (session) {
|
|
||||||
return SWITCH_STATUS_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (switch_strlen_zero(cmd)) {
|
if (switch_strlen_zero(cmd)) {
|
||||||
stream->write_function(stream, "-USAGE: %s\n", UNLOAD_SYNTAX);
|
stream->write_function(stream, "-USAGE: %s\n", UNLOAD_SYNTAX);
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
|
@ -950,10 +934,6 @@ SWITCH_STANDARD_API(reload_function)
|
||||||
switch_bool_t force = SWITCH_FALSE;
|
switch_bool_t force = SWITCH_FALSE;
|
||||||
const char *p = cmd;
|
const char *p = cmd;
|
||||||
|
|
||||||
if (session) {
|
|
||||||
return SWITCH_STATUS_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (switch_strlen_zero(cmd)) {
|
if (switch_strlen_zero(cmd)) {
|
||||||
stream->write_function(stream, "-USAGE: %s\n", UNLOAD_SYNTAX);
|
stream->write_function(stream, "-USAGE: %s\n", UNLOAD_SYNTAX);
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
|
@ -1003,10 +983,6 @@ SWITCH_STANDARD_API(reload_xml_function)
|
||||||
const char *err;
|
const char *err;
|
||||||
switch_xml_t xml_root;
|
switch_xml_t xml_root;
|
||||||
|
|
||||||
if (session) {
|
|
||||||
return SWITCH_STATUS_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((xml_root = switch_xml_open_root(1, &err))) {
|
if ((xml_root = switch_xml_open_root(1, &err))) {
|
||||||
switch_xml_free(xml_root);
|
switch_xml_free(xml_root);
|
||||||
}
|
}
|
||||||
|
@ -1023,10 +999,6 @@ SWITCH_STANDARD_API(kill_function)
|
||||||
char *mycmd = NULL, *kcause = NULL;
|
char *mycmd = NULL, *kcause = NULL;
|
||||||
switch_call_cause_t cause = SWITCH_CAUSE_NORMAL_CLEARING;
|
switch_call_cause_t cause = SWITCH_CAUSE_NORMAL_CLEARING;
|
||||||
|
|
||||||
if (session) {
|
|
||||||
return SWITCH_STATUS_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (switch_strlen_zero(cmd) || !(mycmd = strdup(cmd))) {
|
if (switch_strlen_zero(cmd) || !(mycmd = strdup(cmd))) {
|
||||||
stream->write_function(stream, "-USAGE: %s\n", KILL_SYNTAX);
|
stream->write_function(stream, "-USAGE: %s\n", KILL_SYNTAX);
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
|
@ -1057,10 +1029,6 @@ SWITCH_STANDARD_API(park_function)
|
||||||
{
|
{
|
||||||
switch_core_session_t *ksession = NULL;
|
switch_core_session_t *ksession = NULL;
|
||||||
|
|
||||||
if (session) {
|
|
||||||
return SWITCH_STATUS_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!cmd) {
|
if (!cmd) {
|
||||||
stream->write_function(stream, "-USAGE: %s\n", PARK_SYNTAX);
|
stream->write_function(stream, "-USAGE: %s\n", PARK_SYNTAX);
|
||||||
} else if ((ksession = switch_core_session_locate(cmd))) {
|
} else if ((ksession = switch_core_session_locate(cmd))) {
|
||||||
|
@ -1082,10 +1050,6 @@ SWITCH_STANDARD_API(transfer_function)
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
char *tuuid, *dest, *dp, *context, *arg = NULL;
|
char *tuuid, *dest, *dp, *context, *arg = NULL;
|
||||||
|
|
||||||
if (session) {
|
|
||||||
return SWITCH_STATUS_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (switch_strlen_zero(cmd) || !(mycmd = strdup(cmd))) {
|
if (switch_strlen_zero(cmd) || !(mycmd = strdup(cmd))) {
|
||||||
stream->write_function(stream, "-USAGE: %s\n", TRANSFER_SYNTAX);
|
stream->write_function(stream, "-USAGE: %s\n", TRANSFER_SYNTAX);
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
|
@ -1303,10 +1267,6 @@ SWITCH_STANDARD_API(sched_transfer_function)
|
||||||
char *mycmd = NULL, *argv[6] = { 0 };
|
char *mycmd = NULL, *argv[6] = { 0 };
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
|
|
||||||
if (session) {
|
|
||||||
return SWITCH_STATUS_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
|
if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
|
||||||
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||||
}
|
}
|
||||||
|
@ -1346,10 +1306,6 @@ SWITCH_STANDARD_API(sched_hangup_function)
|
||||||
char *mycmd = NULL, *argv[4] = { 0 };
|
char *mycmd = NULL, *argv[4] = { 0 };
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
|
|
||||||
if (session) {
|
|
||||||
return SWITCH_STATUS_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
|
if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
|
||||||
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||||
}
|
}
|
||||||
|
@ -1392,10 +1348,6 @@ SWITCH_STANDARD_API(uuid_media_function)
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
switch_status_t status = SWITCH_STATUS_FALSE;
|
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||||
|
|
||||||
if (session) {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
|
if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
|
||||||
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||||
}
|
}
|
||||||
|
@ -1427,10 +1379,6 @@ SWITCH_STANDARD_API(uuid_broadcast_function)
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
switch_status_t status = SWITCH_STATUS_FALSE;
|
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||||
|
|
||||||
if (session) {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
|
if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
|
||||||
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||||
}
|
}
|
||||||
|
@ -1467,10 +1415,6 @@ SWITCH_STANDARD_API(sched_broadcast_function)
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
switch_status_t status = SWITCH_STATUS_FALSE;
|
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||||
|
|
||||||
if (session) {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
|
if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
|
||||||
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||||
}
|
}
|
||||||
|
@ -1514,10 +1458,6 @@ SWITCH_STANDARD_API(uuid_hold_function)
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
switch_status_t status = SWITCH_STATUS_FALSE;
|
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||||
|
|
||||||
if (session) {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
|
if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
|
||||||
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||||
}
|
}
|
||||||
|
@ -1549,10 +1489,6 @@ SWITCH_STANDARD_API(uuid_display_function)
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
switch_status_t status = SWITCH_STATUS_FALSE;
|
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||||
|
|
||||||
if (session) {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
|
if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
|
||||||
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||||
}
|
}
|
||||||
|
@ -1589,10 +1525,6 @@ SWITCH_STANDARD_API(uuid_bridge_function)
|
||||||
char *mycmd = NULL, *argv[4] = { 0 };
|
char *mycmd = NULL, *argv[4] = { 0 };
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
|
|
||||||
if (session) {
|
|
||||||
return SWITCH_STATUS_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
|
if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
|
||||||
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||||
}
|
}
|
||||||
|
@ -1633,10 +1565,6 @@ SWITCH_STANDARD_API(session_record_function)
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
uint32_t limit = 0;
|
uint32_t limit = 0;
|
||||||
|
|
||||||
if (session) {
|
|
||||||
return SWITCH_STATUS_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (switch_strlen_zero(cmd)) {
|
if (switch_strlen_zero(cmd)) {
|
||||||
goto usage;
|
goto usage;
|
||||||
}
|
}
|
||||||
|
@ -1704,10 +1632,6 @@ SWITCH_STANDARD_API(session_displace_function)
|
||||||
uint32_t limit = 0;
|
uint32_t limit = 0;
|
||||||
char *flags = NULL;
|
char *flags = NULL;
|
||||||
|
|
||||||
if (session) {
|
|
||||||
return SWITCH_STATUS_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (switch_strlen_zero(cmd) || !(mycmd = strdup(cmd))) {
|
if (switch_strlen_zero(cmd) || !(mycmd = strdup(cmd))) {
|
||||||
goto usage;
|
goto usage;
|
||||||
}
|
}
|
||||||
|
@ -1769,10 +1693,6 @@ SWITCH_STANDARD_API(break_function)
|
||||||
char *mycmd, *flag;
|
char *mycmd, *flag;
|
||||||
switch_channel_t *channel = NULL;
|
switch_channel_t *channel = NULL;
|
||||||
|
|
||||||
if (session) {
|
|
||||||
return SWITCH_STATUS_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (switch_strlen_zero(cmd)) {
|
if (switch_strlen_zero(cmd)) {
|
||||||
stream->write_function(stream, "-USAGE: %s\n", BREAK_SYNTAX);
|
stream->write_function(stream, "-USAGE: %s\n", BREAK_SYNTAX);
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
|
@ -1812,10 +1732,6 @@ SWITCH_STANDARD_API(pause_function)
|
||||||
char *mycmd = NULL, *argv[4] = { 0 };
|
char *mycmd = NULL, *argv[4] = { 0 };
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
|
|
||||||
if (session) {
|
|
||||||
return SWITCH_STATUS_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
|
if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
|
||||||
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||||
}
|
}
|
||||||
|
@ -2368,10 +2284,6 @@ SWITCH_STANDARD_API(show_function)
|
||||||
switch_core_flag_t cflags = switch_core_flags();
|
switch_core_flag_t cflags = switch_core_flags();
|
||||||
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
||||||
|
|
||||||
if (session) {
|
|
||||||
return SWITCH_STATUS_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
db = switch_core_db_handle();
|
db = switch_core_db_handle();
|
||||||
|
|
||||||
holder.justcount = 0;
|
holder.justcount = 0;
|
||||||
|
@ -2657,10 +2569,6 @@ SWITCH_STANDARD_API(uuid_setvar_function)
|
||||||
char *mycmd = NULL, *argv[3] = { 0 };
|
char *mycmd = NULL, *argv[3] = { 0 };
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
|
|
||||||
if (session) {
|
|
||||||
return SWITCH_STATUS_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
|
if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
|
||||||
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||||
if ((argc == 2 || argc == 3) && !switch_strlen_zero(argv[0])) {
|
if ((argc == 2 || argc == 3) && !switch_strlen_zero(argv[0])) {
|
||||||
|
@ -2709,10 +2617,6 @@ SWITCH_STANDARD_API(uuid_setvar_multi_function)
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
char *var_name, *var_value = NULL;
|
char *var_name, *var_value = NULL;
|
||||||
|
|
||||||
if (session) {
|
|
||||||
return SWITCH_STATUS_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
|
if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
|
||||||
char *uuid = mycmd;
|
char *uuid = mycmd;
|
||||||
if (!(vars = strchr(uuid, ' '))) {
|
if (!(vars = strchr(uuid, ' '))) {
|
||||||
|
@ -2763,10 +2667,6 @@ SWITCH_STANDARD_API(uuid_getvar_function)
|
||||||
char *mycmd = NULL, *argv[4] = { 0 };
|
char *mycmd = NULL, *argv[4] = { 0 };
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
|
|
||||||
if (session) {
|
|
||||||
return SWITCH_STATUS_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
|
if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
|
||||||
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||||
if (argc >= 2 && !switch_strlen_zero(argv[0])) {
|
if (argc >= 2 && !switch_strlen_zero(argv[0])) {
|
||||||
|
@ -2814,10 +2714,6 @@ SWITCH_STANDARD_API(uuid_send_dtmf_function)
|
||||||
char *uuid = NULL, *dtmf_data = NULL;
|
char *uuid = NULL, *dtmf_data = NULL;
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
|
|
||||||
if (session) {
|
|
||||||
return SWITCH_STATUS_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (switch_strlen_zero(cmd)) {
|
if (switch_strlen_zero(cmd)) {
|
||||||
goto usage;
|
goto usage;
|
||||||
}
|
}
|
||||||
|
@ -2864,10 +2760,6 @@ SWITCH_STANDARD_API(uuid_dump_function)
|
||||||
char *mycmd = NULL, *argv[4] = { 0 };
|
char *mycmd = NULL, *argv[4] = { 0 };
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
|
|
||||||
if (session) {
|
|
||||||
return SWITCH_STATUS_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
|
if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
|
||||||
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||||
if (argc >= 0 && !switch_strlen_zero(argv[0])) {
|
if (argc >= 0 && !switch_strlen_zero(argv[0])) {
|
||||||
|
|
Loading…
Reference in New Issue