Index: channel.c =================================================================== RCS file: /usr/cvsroot/asterisk/channel.c,v retrieving revision 1.254 diff -u -r1.254 channel.c --- channel.c 31 Oct 2005 15:34:11 -0000 1.254 +++ channel.c 1 Nov 2005 21:39:40 -0000 @@ -2355,8 +2355,12 @@ chan = ast_request(type, format, data, &cause); if (chan) { if (oh) { - ast_set_variables(chan, oh->vars); - ast_set_callerid(chan, oh->cid_num, oh->cid_name, oh->cid_num); + if (oh->vars) + ast_set_variables(chan, oh->vars); + if (oh->cid_num && *oh->cid_num && oh->cid_name && *oh->cid_name) + ast_set_callerid(chan, oh->cid_num, oh->cid_name, oh->cid_num); + if (oh->parent_channel) + ast_channel_inherit_variables(oh->parent_channel, chan); } ast_set_callerid(chan, cid_num, cid_name, cid_num); Index: include/asterisk/channel.h =================================================================== RCS file: /usr/cvsroot/asterisk/include/asterisk/channel.h,v retrieving revision 1.110 diff -u -r1.110 channel.h --- include/asterisk/channel.h 1 Nov 2005 15:28:01 -0000 1.110 +++ include/asterisk/channel.h 1 Nov 2005 21:39:40 -0000 @@ -434,6 +434,7 @@ oh.cid_num = cid_num; \ oh.cid_name = cid_name; \ oh.vars = vars; \ + oh.parent_channel = NULL; \ } struct outgoing_helper { @@ -443,6 +444,7 @@ const char *cid_num; const char *cid_name; struct ast_variable *vars; + struct ast_channel *parent_channel; }; #define AST_CDR_TRANSFER (1 << 0) Index: apps/app_parkandannounce.c =================================================================== RCS file: /usr/cvsroot/asterisk/apps/app_parkandannounce.c,v retrieving revision 1.20 diff -u -r1.20 app_parkandannounce.c --- apps/app_parkandannounce.c 26 Oct 2005 19:48:14 -0000 1.20 +++ apps/app_parkandannounce.c 1 Nov 2005 21:39:40 -0000 @@ -77,6 +77,7 @@ char *s,*orig_s; struct ast_channel *dchan; + struct outgoing_helper oh; int outstate; struct localuser *u; @@ -178,7 +179,9 @@ /* Now place the call to the extention */ - dchan = ast_request_and_dial(dialtech, AST_FORMAT_SLINEAR, dialstr,30000, &outstate, chan->cid.cid_num, chan->cid.cid_name); + memset(&oh, 0, sizeof(oh)); + oh.parent_channel = chan; + dchan = __ast_request_and_dial(dialtech, AST_FORMAT_SLINEAR, dialstr,30000, &outstate, chan->cid.cid_num, chan->cid.cid_name, &oh); if(dchan) { if(dchan->_state == AST_STATE_UP) {