/* Find all candidate extensions */
while(v) {
/* Find a candidate extension */
- start = strdup(v->value);
+ start = ast_strdup(v->value);
if (start && !strcasestr(start, "hidefromdir=yes")) {
stringp=start;
strsep(&stringp, ",");
/* User Number || Conf Command option*/
if (strstr(line, "mute") || strstr(line, "kick")) {
if (state == 0 && (strstr(line, "kick") || strstr(line,"mute")) && !strncasecmp(word, "all", len))
- return strdup("all");
+ return ast_strdup("all");
which++;
AST_LIST_LOCK(&confs);
}
}
AST_LIST_UNLOCK(&confs);
- return usr ? strdup(usrno) : NULL;
+ return usr ? ast_strdup(usrno) : NULL;
} else if ( strstr(line, "list") && ( 0 == state ) )
- return strdup("concise");
+ return ast_strdup("concise");
}
return NULL;
static char *message_template_parse_emailbody(const char *configuration)
{
char *tmpread, *tmpwrite;
- char *emailbody = strdup(configuration);
+ char *emailbody = ast_strdup(configuration);
/* substitute strings \t and \n into the apropriate characters */
tmpread = tmpwrite = emailbody;
if (pos > 4)
return NULL;
if (pos == 3)
- return (state == 0) ? strdup("for") : NULL;
+ return (state == 0) ? ast_strdup("for") : NULL;
wordlen = strlen(word);
AST_LIST_TRAVERSE(&minivm_accounts, vmu, list) {
if (!strncasecmp(word, vmu->domain, wordlen)) {
if (domain && strcmp(domain, vmu->domain) && ++which > state)
- return strdup(vmu->domain);
+ return ast_strdup(vmu->domain);
/* ignore repeated domains ? */
domain = vmu->domain;
}
speech->processing_sound = NULL;
}
- speech->processing_sound = strdup(data);
+ speech->processing_sound = ast_strdup(data);
ast_module_user_remove(u);
speech->results = ast_calloc(1, sizeof(*speech->results));
if (speech->results != NULL) {
speech->results->score = 1000;
- speech->results->text = strdup(dtmf);
- speech->results->grammar = strdup("dtmf");
+ speech->results->text = ast_strdup(dtmf);
+ speech->results->grammar = ast_strdup("dtmf");
}
}
ast_log(LOG_DTMF, "Begin sending inband digit %c on %s\n", digit, c->name);
}
pvt->txDtmfDigit = digit;
- token = pvt->cd.call_token ? strdup(pvt->cd.call_token) : NULL;
+ token = pvt->cd.call_token ? ast_strdup(pvt->cd.call_token) : NULL;
ast_mutex_unlock(&pvt->lock);
h323_send_tone(token, digit);
if (token) {
ast_log(LOG_DTMF, "End sending inband digit %c on %s, duration %d\n", digit, c->name, duration);
}
pvt->txDtmfDigit = ' ';
- token = pvt->cd.call_token ? strdup(pvt->cd.call_token) : NULL;
+ token = pvt->cd.call_token ? ast_strdup(pvt->cd.call_token) : NULL;
ast_mutex_unlock(&pvt->lock);
h323_send_tone(token, ' ');
if (token) {
ast_debug(1, "Answering on %s\n", c->name);
ast_mutex_lock(&pvt->lock);
- token = pvt->cd.call_token ? strdup(pvt->cd.call_token) : NULL;
+ token = pvt->cd.call_token ? ast_strdup(pvt->cd.call_token) : NULL;
ast_mutex_unlock(&pvt->lock);
res = h323_answering_call(token, 0);
if (token)
/* Start the process if it's not already started */
if (!pvt->alreadygone && !pvt->hangupcause) {
- call_token = pvt->cd.call_token ? strdup(pvt->cd.call_token) : NULL;
+ call_token = pvt->cd.call_token ? ast_strdup(pvt->cd.call_token) : NULL;
if (call_token) {
/* Release lock to eliminate deadlock */
ast_mutex_unlock(&pvt->lock);
int got_progress;
ast_mutex_lock(&pvt->lock);
- token = (pvt->cd.call_token ? strdup(pvt->cd.call_token) : NULL);
+ token = (pvt->cd.call_token ? ast_strdup(pvt->cd.call_token) : NULL);
got_progress = pvt->got_progress;
if (condition == AST_CONTROL_PROGRESS)
pvt->got_progress = 1;
ch->cid.cid_ton = pvt->cd.type_of_number;
if (!ast_strlen_zero(pvt->exten) && strcmp(pvt->exten, "s")) {
- ch->cid.cid_dnid = strdup(pvt->exten);
+ ch->cid.cid_dnid = ast_strdup(pvt->exten);
}
if (pvt->cd.transfer_capability >= 0)
ch->transfercapability = pvt->cd.transfer_capability;
ast_mutex_unlock(&c->lock);
}
if (c) {
- ret = strdup(c->name);
+ ret = ast_strdup(c->name);
ast_mutex_unlock(&c->lock);
} else
ret = NULL;
switch (pos) {
case 4:
if (*word == 'p')
- return strdup("port");
+ return ast_strdup("port");
else if (*word == 'o')
- return strdup("only");
+ return ast_strdup("only");
break;
case 6:
if (*word == 'o')
- return strdup("only");
+ return ast_strdup("only");
break;
}
return NULL;
switch (pos) {
case 3:
if ((!strncmp(word, "description", wordlen)) && (++which > state))
- return strdup("description");
+ return ast_strdup("description");
if ((!strncmp(word, "descriptions", wordlen)) && (++which > state))
- return strdup("descriptions");
+ return ast_strdup("descriptions");
if ((!strncmp(word, "0", wordlen)) && (++which > state))
- return strdup("0");
+ return ast_strdup("0");
while ((port = misdn_cfg_get_next_port(port)) != -1) {
snprintf(buffer, sizeof(buffer), "%d", port);
if ((!strncmp(word, buffer, wordlen)) && (++which > state)) {
- return strdup(buffer);
+ return ast_strdup(buffer);
}
}
break;
misdn_cfg_get_name(elem, buffer, sizeof(buffer));
if (!wordlen || !strncmp(word, buffer, wordlen)) {
if (++which > state)
- return strdup(buffer);
+ return ast_strdup(buffer);
}
}
} else if (strstr(line, "descriptions ")) {
if ((!wordlen || !strncmp(word, "general", wordlen)) && (++which > state))
- return strdup("general");
+ return ast_strdup("general");
if ((!wordlen || !strncmp(word, "ports", wordlen)) && (++which > state))
- return strdup("ports");
+ return ast_strdup("ports");
}
break;
}
if ( !ast_strlen_zero(bc->rad) ) {
if (ast->cid.cid_rdnis)
ast_free(ast->cid.cid_rdnis);
- ast->cid.cid_rdnis = strdup(bc->rad);
+ ast->cid.cid_rdnis = ast_strdup(bc->rad);
}
misdn_cfg_get(bc->port, MISDN_CFG_OVERLAP_DIAL, &ch->overlap_dial, sizeof(ch->overlap_dial));
if (cli_struct->ra_cldn[0]=='\0'){
/*
- owner->cid.cid_num = strdup(cli_struct->cldn);
- owner->cid.cid_name = strdup(cli_struct->cn);
+ owner->cid.cid_num = ast_strdup(cli_struct->cldn);
+ owner->cid.cid_name = ast_strdup(cli_struct->cn);
*/
if (owner){
ast_set_callerid(owner, cli_struct->cldn, cli_struct->cn, cli_struct->cldn);
int oldformat;
struct vpb_pvt *p;
struct ast_channel *tmp = NULL;
- char *name = strdup(data ? (char *)data : "");
+ char *name = ast_strdup(data ? (char *)data : "");
char *s, *sepstr;
int group=-1;
} else if (strcasecmp(v->name, "language") == 0) {
strncpy(language, v->value, sizeof(language)-1);
} else if (strcasecmp(v->name, "callerid") == 0) {
- callerid = strdup(v->value);
+ callerid = ast_strdup(v->value);
} else if (strcasecmp(v->name, "mode") == 0) {
if (strncasecmp(v->value, "di", 2) == 0)
mode = MODE_DIALTONE;
ast_mutex_lock(&provlock);
for (c = templates; c; c = c->next) {
if (!strncasecmp(word, c->name, wordlen) && ++which > state) {
- ret = strdup(c->name);
+ ret = ast_strdup(c->name);
break;
}
}
}
}
- match_list[matches++] = strdup(retstr);
+ match_list[matches++] = ast_strdup(retstr);
}
if (!match_list)
AST_LIST_TRAVERSE(&backends, cl, list) {
if (!strncasecmp(word, cl->tech->type, wordlen) && ++which > state) {
- ret = strdup(cl->tech->type);
+ ret = ast_strdup(cl->tech->type);
break;
}
}
if (c && word[0] != '/')
c += (strlen(ast_config_AST_MODULE_DIR) + 1);
- return c ? strdup(c) : c;
+ return c ? ast_strdup(c) : c;
}
static char *handle_load(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
/* XXX remember to handle the optional "off" */
if (a->pos != e->args)
return NULL;
- return a->n == 0 ? strdup("all") : ast_complete_channels(a->line, a->word, a->pos, a->n - 1, e->args);
+ return a->n == 0 ? ast_strdup("all") : ast_complete_channels(a->line, a->word, a->pos, a->n - 1, e->args);
}
/* 'core set debug channel {all|chan_id}' */
if (a->argc == e->args + 2) {
char buf[80];
ast_join(buf, sizeof(buf), e->cmda);
- e->_full_cmd = strdup(buf);
+ e->_full_cmd = ast_strdup(buf);
if (!e->_full_cmd) {
ast_log(LOG_WARNING, "-- cannot allocate <%s>\n", buf);
return -1;
if (strncasecmp(token, word, lw)) /* no match */
return NULL;
*actual = 1;
- return (pos != 0) ? NULL : strdup(token);
+ return (pos != 0) ? NULL : ast_strdup(token);
}
/* now handle regexp match */
continue;
(*actual)++;
if (pos-- == 0)
- return strdup(s);
+ return ast_strdup(s);
}
return NULL;
}
if ((p = ast_realloc(c->naptr_rrs, sizeof(*c->naptr_rrs) * (c->naptr_rrs_count + 1)))) {
c->naptr_rrs = p;
memcpy(&c->naptr_rrs[c->naptr_rrs_count].naptr, answer, sizeof(c->naptr_rrs->naptr));
- c->naptr_rrs[c->naptr_rrs_count].result = strdup(c->dst);
- c->naptr_rrs[c->naptr_rrs_count].tech = strdup(c->tech);
+ c->naptr_rrs[c->naptr_rrs_count].result = ast_strdup(c->dst);
+ c->naptr_rrs[c->naptr_rrs_count].tech = ast_strdup(c->tech);
c->naptr_rrs[c->naptr_rrs_count].sort_pos = c->naptr_rrs_count;
c->naptr_rrs_count++;
}
fs->fmt = f;
fs->flags = flags;
fs->mode = mode;
- fs->filename = strdup(filename);
+ fs->filename = ast_strdup(filename);
fs->vfs = NULL;
break;
}
fs->flags = flags;
fs->mode = mode;
if (orig_fn) {
- fs->realfilename = strdup(orig_fn);
- fs->filename = strdup(fn);
+ fs->realfilename = ast_strdup(orig_fn);
+ fs->filename = ast_strdup(fn);
} else {
fs->realfilename = NULL;
- fs->filename = strdup(filename);
+ fs->filename = ast_strdup(filename);
}
fs->vfs = NULL;
/* If truncated, we'll be at the beginning; if not truncated, then append */
out404:
*status = 404;
- *title = strdup("Not Found");
+ *title = ast_strdup("Not Found");
return ast_http_error(404, "Not Found", NULL, "Nothing to see here. Move along.");
out403:
*status = 403;
- *title = strdup("Access Denied");
+ *title = ast_strdup("Access Denied");
return ast_http_error(403, "Access Denied", NULL, "Sorry, I cannot let you do that, Dave.");
}
out = ast_http_error(302, "Moved Temporarily", buf,
"There is no spoon...");
*status = 302;
- *title = strdup("Moved Temporarily");
+ *title = ast_strdup("Moved Temporarily");
break;
}
}
out = ast_http_error(404, "Not Found", NULL,
"The requested URL was not found on this server.");
*status = 404;
- *title = strdup("Not Found");
+ *title = ast_strdup("Not Found");
}
cleanup:
if (!strncasecmp(word, cur->resource, l) &&
(cur->info->reload || !needsreload) &&
++which > state) {
- ret = strdup(cur->resource);
+ ret = ast_strdup(cur->resource);
break;
}
}
if (!ret) {
for (i=0; !ret && reload_classes[i].name; i++) {
if (!strncasecmp(word, reload_classes[i].name, l) && ++which > state)
- ret = strdup(reload_classes[i].name);
+ ret = ast_strdup(reload_classes[i].name);
}
}
AST_RWLIST_RDLOCK(&acf_root);
AST_RWLIST_TRAVERSE(&acf_root, acf, acflist) {
if (!strncasecmp(word, acf->name, wordlen) && ++which > state) {
- ret = strdup(acf->name);
+ ret = ast_strdup(acf->name);
break;
}
}
AST_RWLIST_RDLOCK(&apps);
AST_RWLIST_TRAVERSE(&apps, a, list) {
if (!strncasecmp(word, a->name, wordlen) && ++which > state) {
- ret = strdup(a->name);
+ ret = ast_strdup(a->name);
break;
}
}
if (!con) /* Still no context? Bad */
ast_log(LOG_ERROR, "Parking context '%s' does not exist and unable to create\n", parking_con);
else { /* Add extension to context */
- if (!ast_add_extension2(con, 1, pu->parkingexten, 1, NULL, NULL, parkedcall, strdup(pu->parkingexten), ast_free, registrar))
+ if (!ast_add_extension2(con, 1, pu->parkingexten, 1, NULL, NULL, parkedcall, ast_strdup(pu->parkingexten), ast_free, registrar))
notify_metermaids(pu->parkingexten, parking_con);
}
/* Tell the peer channel the number of the parking space */
if (con) {
char returnexten[AST_MAX_EXTENSION];
snprintf(returnexten, sizeof(returnexten), "%s||t", peername);
- ast_add_extension2(con, 1, peername, 1, NULL, NULL, "Dial", strdup(returnexten), ast_free, registrar);
+ ast_add_extension2(con, 1, peername, 1, NULL, NULL, "Dial", ast_strdup(returnexten), ast_free, registrar);
}
if (comebacktoorigin) {
set_c_e_p(chan, parking_con_dial, peername, 1);
return -1;
}
ts->next = NULL;
- ts->name = strdup(v->name);
- ts->data = strdup(v->value);
+ ts->name = ast_strdup(v->name);
+ ts->data = ast_strdup(v->value);
if (ps)
ps->next = ts;
else
int directory = strchr(fname_base, '/') ? 1 : 0;
/* try creating the directory just in case it doesn't exist */
if (directory) {
- char *name = strdup(fname_base);
+ char *name = ast_strdup(fname_base);
snprintf(tmp, sizeof(tmp), "mkdir -p \"%s\"",dirname(name));
ast_free(name);
ast_safe_system(tmp);
/* Determine file format */
if (!ast_strlen_zero(format_spec)) {
- monitor->format = strdup(format_spec);
+ monitor->format = ast_strdup(format_spec);
} else {
- monitor->format = strdup("wav");
+ monitor->format = ast_strdup("wav");
}
/* open files */
int directory = strchr(fname_base, '/') ? 1 : 0;
/* try creating the directory just in case it doesn't exist */
if (directory) {
- char *name = strdup(fname_base);
+ char *name = ast_strdup(fname_base);
snprintf(tmp, sizeof(tmp), "mkdir -p %s",dirname(name));
ast_free(name);
ast_safe_system(tmp);