Make chan_local use the API call instead of inlining its own version.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366462 65c4cc65-6c06-0410-ace0-fbb531ad65f3
certified/11.2
Richard Mudgett 14 years ago
parent 767c26b926
commit 0798012e39

@ -861,8 +861,8 @@ static int local_call(struct ast_channel *ast, const char *dest, int timeout)
struct ast_channel *owner = NULL;
struct ast_channel *chan = NULL;
int res;
struct ast_var_t *varptr = NULL, *new;
size_t len, namelen;
struct ast_var_t *varptr;
struct ast_var_t *clone_var;
char *reduced_dest = ast_strdupa(dest);
char *slash;
const char *exten;
@ -919,12 +919,9 @@ static int local_call(struct ast_channel *ast, const char *dest, int timeout)
/* copy the channel variables from the incoming channel to the outgoing channel */
/* Note that due to certain assumptions, they MUST be in the same order */
AST_LIST_TRAVERSE(ast_channel_varshead(owner), varptr, entries) {
namelen = strlen(varptr->name);
len = sizeof(struct ast_var_t) + namelen + strlen(varptr->value) + 2;
if ((new = ast_calloc(1, len))) {
memcpy(new, varptr, len);
new->value = &(new->name[0]) + namelen + 1;
AST_LIST_INSERT_TAIL(ast_channel_varshead(chan), new, entries);
clone_var = ast_var_assign(varptr->name, varptr->value);
if (clone_var) {
AST_LIST_INSERT_TAIL(ast_channel_varshead(chan), clone_var, entries);
}
}
ast_channel_datastore_inherit(owner, chan);

Loading…
Cancel
Save