mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-02 19:16:15 +00:00
issue #5564
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6935 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -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)
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user