summaryrefslogtreecommitdiff
path: root/channel.c
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2004-01-30 06:48:01 +0000
committerMark Spencer <markster@digium.com>2004-01-30 06:48:01 +0000
commit068fd1d8394f36b3382566a55f1614ebacf2c6df (patch)
tree52356a00e56b590cb015bc187bf80631b6b7a47c /channel.c
parent81cf763a977093780aa5e4597d321295b3eb06b0 (diff)
Merge variable lists
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2097 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channel.c')
-rwxr-xr-xchannel.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/channel.c b/channel.c
index 72540bc53..9e6495533 100755
--- a/channel.c
+++ b/channel.c
@@ -1929,7 +1929,7 @@ static int ast_do_masquerade(struct ast_channel *original)
int x,i;
int res=0;
char *tmp;
- void *tmpv;
+ struct ast_var_t *varptr;
struct ast_frame *cur, *prev;
struct ast_channel_pvt *p;
struct ast_channel *clone = original->masq;
@@ -2037,10 +2037,19 @@ static int ast_do_masquerade(struct ast_channel *original)
for (x=0;x<AST_MAX_FDS;x++) {
original->fds[x] = clone->fds[x];
}
- /* Move the variables */
- tmpv = original->varshead.first;
+ /* Append variables from clone channel into original channel */
+ /* XXX Is this always correct? We have to in order to keep MACROS working XXX */
+ varptr = original->varshead.first;
+ if (varptr) {
+ while(varptr->entries.next) {
+ varptr = varptr->entries.next;
+ }
+ varptr->entries.next = clone->varshead.first;
+ } else {
+ original->varshead.first = clone->varshead.first;
+ }
+ clone->varshead.first = NULL;
original->varshead.first = clone->varshead.first;
- clone->varshead.first = tmpv;
/* Presense of ADSI capable CPE follows clone */
original->adsicpe = clone->adsicpe;
/* Bridge remains the same */