diff options
-rwxr-xr-x | ChangeLog | 4 | ||||
-rwxr-xr-x | apps/app_parkandannounce.c | 5 | ||||
-rwxr-xr-x | channel.c | 8 | ||||
-rwxr-xr-x | include/asterisk/channel.h | 2 |
4 files changed, 16 insertions, 3 deletions
@@ -1,5 +1,9 @@ 2005-11-01 Kevin P. Fleming <kpfleming@digium.com> + * apps/app_parkandannounce.c (parkandannounce_exec): supply parent channel to ast_request_and_dial so channel variables can be inherited (issue #5564) + * include/asterisk/channel.h: add parent_channel field + * channel.c (__ast_request_and_dial): use parent_channel field to inherit variables into new channel + * apps/app_cut.c (cut_internal): use ast_separate_app_args() instead of open code (issue #5560) * apps/app_mixmonitor.c (launch_monitor_thread): ast_strlen_zero can handle NULL input (issue #5561) diff --git a/apps/app_parkandannounce.c b/apps/app_parkandannounce.c index 6c9650fdb..1db9101a5 100755 --- a/apps/app_parkandannounce.c +++ b/apps/app_parkandannounce.c @@ -77,6 +77,7 @@ static int parkandannounce_exec(struct ast_channel *chan, void *data) char *s,*orig_s; struct ast_channel *dchan; + struct outgoing_helper oh; int outstate; struct localuser *u; @@ -178,7 +179,9 @@ static int parkandannounce_exec(struct ast_channel *chan, void *data) /* 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) { @@ -2355,8 +2355,12 @@ struct ast_channel *__ast_request_and_dial(const char *type, int format, void *d 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); diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h index 6599edbb5..ce5975dbe 100755 --- a/include/asterisk/channel.h +++ b/include/asterisk/channel.h @@ -434,6 +434,7 @@ struct chanmon; oh.cid_num = cid_num; \ oh.cid_name = cid_name; \ oh.vars = vars; \ + oh.parent_channel = NULL; \ } struct outgoing_helper { @@ -443,6 +444,7 @@ struct outgoing_helper { const char *cid_num; const char *cid_name; struct ast_variable *vars; + struct ast_channel *parent_channel; }; #define AST_CDR_TRANSFER (1 << 0) |