提交 1e691217 authored 作者: Michael Jerris's avatar Michael Jerris

cleanup

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7421 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 3046c27b
...@@ -190,9 +190,6 @@ SWITCH_STANDARD_API(find_user_function) ...@@ -190,9 +190,6 @@ SWITCH_STANDARD_API(find_user_function)
return _find_user(cmd, session, stream, SWITCH_FALSE); return _find_user(cmd, session, stream, SWITCH_FALSE);
} }
SWITCH_STANDARD_API(xml_locate_function) SWITCH_STANDARD_API(xml_locate_function)
{ {
switch_xml_t xml = NULL, obj = NULL; switch_xml_t xml = NULL, obj = NULL;
...@@ -218,7 +215,6 @@ SWITCH_STANDARD_API(xml_locate_function) ...@@ -218,7 +215,6 @@ SWITCH_STANDARD_API(xml_locate_function)
goto end; goto end;
} }
mydata = strdup(cmd); mydata = strdup(cmd);
switch_assert(mydata); switch_assert(mydata);
...@@ -253,9 +249,7 @@ SWITCH_STANDARD_API(xml_locate_function) ...@@ -253,9 +249,7 @@ SWITCH_STANDARD_API(xml_locate_function)
goto end; goto end;
} }
end:
end:
switch_event_destroy(&params); switch_event_destroy(&params);
if (err) { if (err) {
...@@ -306,7 +300,6 @@ SWITCH_STANDARD_API(regex_function) ...@@ -306,7 +300,6 @@ SWITCH_STANDARD_API(regex_function)
goto error; goto error;
} }
if ((proceed = switch_regex_perform(argv[0], argv[1], &re, ovector, sizeof(ovector) / sizeof(ovector[0])))) { if ((proceed = switch_regex_perform(argv[0], argv[1], &re, ovector, sizeof(ovector) / sizeof(ovector[0])))) {
if (argc > 2) { if (argc > 2) {
len = strlen(argv[0]) * 3; len = strlen(argv[0]) * 3;
...@@ -335,7 +328,6 @@ SWITCH_STANDARD_API(regex_function) ...@@ -335,7 +328,6 @@ SWITCH_STANDARD_API(regex_function)
switch_safe_free(mydata); switch_safe_free(mydata);
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
typedef enum { typedef enum {
...@@ -462,8 +454,6 @@ SWITCH_STANDARD_API(cond_function) ...@@ -462,8 +454,6 @@ SWITCH_STANDARD_API(cond_function)
switch_safe_free(mydata); switch_safe_free(mydata);
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
...@@ -598,7 +588,6 @@ SWITCH_STANDARD_API(ctl_function) ...@@ -598,7 +588,6 @@ SWITCH_STANDARD_API(ctl_function)
goto end; goto end;
} }
stream->write_function(stream, "+OK\n"); stream->write_function(stream, "+OK\n");
end: end:
free(mydata); free(mydata);
...@@ -725,21 +714,31 @@ SWITCH_STANDARD_API(transfer_function) ...@@ -725,21 +714,31 @@ SWITCH_STANDARD_API(transfer_function)
switch_core_session_t *tsession = NULL, *other_session = NULL; switch_core_session_t *tsession = NULL, *other_session = NULL;
char *mycmd = NULL, *argv[5] = { 0 }; char *mycmd = NULL, *argv[5] = { 0 };
int argc = 0; int argc = 0;
char *tuuid = argv[0];
char *dest = argv[1];
char *dp = argv[2];
char *context = argv[3];
char *arg = NULL;
if (session) { if (session) {
return SWITCH_STATUS_FALSE; 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);
return SWITCH_STATUS_SUCCESS;
}
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 <= 5) { if (argc < 2 || argc > 5) {
char *tuuid = argv[0]; stream->write_function(stream, "-USAGE: %s\n", TRANSFER_SYNTAX);
char *dest = argv[1]; goto done;
char *dp = argv[2]; }
char *context = argv[3];
char *arg = NULL;
if ((tsession = switch_core_session_locate(tuuid))) { if (!(tsession = switch_core_session_locate(tuuid))) {
stream->write_function(stream, "-ERR No Such Channel!\n");
goto done;
}
if (*dest == '-') { if (*dest == '-') {
arg = dest; arg = dest;
...@@ -750,9 +749,9 @@ SWITCH_STANDARD_API(transfer_function) ...@@ -750,9 +749,9 @@ SWITCH_STANDARD_API(transfer_function)
if (arg) { if (arg) {
switch_channel_t *channel = switch_core_session_get_channel(tsession); switch_channel_t *channel = switch_core_session_get_channel(tsession);
const char *uuid = switch_channel_get_variable(channel, SWITCH_BRIDGE_VARIABLE);
arg++; arg++;
if (!strcasecmp(arg, "bleg")) { if (!strcasecmp(arg, "bleg")) {
const char *uuid = switch_channel_get_variable(channel, SWITCH_BRIDGE_VARIABLE);
if (uuid && (other_session = switch_core_session_locate(uuid))) { if (uuid && (other_session = switch_core_session_locate(uuid))) {
switch_core_session_t *tmp = tsession; switch_core_session_t *tmp = tsession;
tsession = other_session; tsession = other_session;
...@@ -760,7 +759,6 @@ SWITCH_STANDARD_API(transfer_function) ...@@ -760,7 +759,6 @@ SWITCH_STANDARD_API(transfer_function)
switch_core_session_rwunlock(tmp); switch_core_session_rwunlock(tmp);
} }
} else if (!strcasecmp(arg, "both")) { } else if (!strcasecmp(arg, "both")) {
const char *uuid = switch_channel_get_variable(channel, SWITCH_BRIDGE_VARIABLE);
if (uuid && (other_session = switch_core_session_locate(uuid))) { if (uuid && (other_session = switch_core_session_locate(uuid))) {
switch_ivr_session_transfer(other_session, dest, dp, context); switch_ivr_session_transfer(other_session, dest, dp, context);
switch_core_session_rwunlock(other_session); switch_core_session_rwunlock(other_session);
...@@ -776,15 +774,6 @@ SWITCH_STANDARD_API(transfer_function) ...@@ -776,15 +774,6 @@ SWITCH_STANDARD_API(transfer_function)
switch_core_session_rwunlock(tsession); switch_core_session_rwunlock(tsession);
} else {
stream->write_function(stream, "-ERR No Such Channel!\n");
}
goto done;
}
}
stream->write_function(stream, "-USAGE: %s\n", TRANSFER_SYNTAX);
done: done:
switch_safe_free(mycmd); switch_safe_free(mycmd);
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论