}
mydata = strdup(cmd);
- assert(mydata);
+ switch_assert(mydata);
argc = switch_separate_string(mydata, delim, argv, (sizeof(argv) / sizeof(argv[0])));
}
mydata = strdup(cmd);
- assert(mydata);
+ switch_assert(mydata);
argc = switch_separate_string(mydata, delim, argv, (sizeof(argv) / sizeof(argv[0])));
if (xml && x_user) {
xmlstr = switch_xml_toxml(x_user, SWITCH_FALSE);
- assert(xmlstr);
+ switch_assert(xmlstr);
stream->write_function(stream, "%s", xmlstr);
free(xmlstr);
mydata = strdup(cmd);
- assert(mydata);
+ switch_assert(mydata);
argc = switch_separate_string(mydata, delim, argv, (sizeof(argv) / sizeof(argv[0])));
if (argc == 1 && !strcasecmp(argv[0], "root")) {
- const char *err;
- xml = switch_xml_open_root(0, &err);
+ const char *error;
+ xml = switch_xml_open_root(0, &error);
obj = xml;
goto end;
}
tag_attr_val = argv[3];
params = switch_mprintf("section=%s&tag=%s&tag_attr_name=%s&tag_attr_val=%s", section, tag, tag_attr_name, tag_attr_val);
- assert(params);
+ switch_assert(params);
if (switch_xml_locate(section, tag, tag_attr_name, tag_attr_val, &xml, &obj, params) != SWITCH_STATUS_SUCCESS) {
stream->write_function(stream, "can't find anything\n");
goto end;
if (xml && obj) {
xmlstr = switch_xml_toxml(obj, SWITCH_FALSE);
- assert(xmlstr);
+ switch_assert(xmlstr);
stream->write_function(stream, "%s", xmlstr);
free(xmlstr);
}
mydata = strdup(cmd);
- assert(mydata);
+ switch_assert(mydata);
argc = switch_separate_string(mydata, '|', argv, (sizeof(argv) / sizeof(argv[0])));
if (argc > 2) {
len = strlen(argv[0]) * 3;
substituted = malloc(len);
- assert(substituted);
+ switch_assert(substituted);
memset(substituted, 0, len);
switch_replace_char(argv[2], '%','$', SWITCH_FALSE);
switch_perform_substitution(re, proceed, argv[2], argv[0], substituted, len, ovector);
}
mydata = strdup(cmd);
- assert(mydata);
+ switch_assert(mydata);
if ((p = strchr(mydata, '?'))) {
*p = ':';
if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
if (argc >= 2 && argc <= 5) {
- char *uuid = argv[0];
+ char *tuuid = argv[0];
char *dest = argv[1];
char *dp = argv[2];
char *context = argv[3];
char *arg = NULL;
- if ((tsession = switch_core_session_locate(uuid))) {
+ if ((tsession = switch_core_session_locate(tuuid))) {
if (*dest == '-') {
arg = dest;
}
} else if (!strcasecmp(arg, "both")) {
const char *uuid = switch_channel_get_variable(channel, SWITCH_BRIDGE_VARIABLE);
- switch_core_session_t *other_session;
if (uuid && (other_session = switch_core_session_locate(uuid))) {
switch_ivr_session_transfer(other_session, dest, dp, context);
switch_core_session_rwunlock(other_session);
}
mydata = strdup(cmd);
- assert(mydata != NULL);
+ switch_assert(mydata != NULL);
if ((argc = switch_separate_string(mydata, ' ', argv, sizeof(argv) / sizeof(argv[0]))) < 3) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "-ERR INVALID ARGS!\n");
}
mycmd = strdup(cmd);
- assert(mycmd);
+ switch_assert(mycmd);
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
if (argc < 2 || argc > 7) {
}
- for (x = 0; x < argc; x++) {
+ for (x = 0; x < argc && argv[x]; x++) {
if (!strcasecmp(argv[x], "undef")) {
argv[x] = NULL;
}
}
- if (!strcasecmp(argv[0], "machine")) {
+ if (argv[0] && !strcasecmp(argv[0], "machine")) {
machine = 1;
i++;
}
}
caller_channel = switch_core_session_get_channel(caller_session);
- assert(caller_channel != NULL);
+ switch_assert(caller_channel != NULL);
switch_channel_clear_state_handler(caller_channel, NULL);
if (*exten == '&' && *(exten + 1)) {
char *cmd, *arg = NULL;
switch_stream_handle_t stream = { 0 };
- assert(task);
+ switch_assert(task);
cmd = (char *) task->cmd_arg;
if (encoded) {
elen = (int) strlen(mystream.data) * 3;
edata = malloc(elen);
- assert(edata != NULL);
+ switch_assert(edata != NULL);
memset(edata, 0, elen);
switch_url_encode(mystream.data, edata, elen);
send = edata;
return SWITCH_STATUS_SUCCESS;
}
tm = strdup(cmd);
- assert(tm != NULL);
+ switch_assert(tm != NULL);
if ((group = strchr(tm, ' '))) {
uint32_t id;
holder.print_title = 1;
- if (!(cflags & SCF_USE_SQL) && !strcasecmp(command, "channels")) {
+ if (!(cflags & SCF_USE_SQL) && command && !strcasecmp(command, "channels")) {
stream->write_function(stream, "-ERR SQL DISABLED NO CHANNEL DATA AVAILABLE!\n");
return SWITCH_STATUS_SUCCESS;
}
switch_channel_t *channel;
channel = switch_core_session_get_channel(psession);
- assert(channel != NULL);
+ switch_assert(channel != NULL);
if (switch_strlen_zero(var_name)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No variable name specified.\n");
switch_channel_t *channel;
channel = switch_core_session_get_channel(psession);
- assert(channel != NULL);
+ switch_assert(channel != NULL);
if (switch_strlen_zero(var_name)) {
stream->write_function(stream, "-ERR No variable name specified!\n");