mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-25 15:08:53 +00:00
Merged revisions 158603 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r158603 | murf | 2008-11-21 16:14:50 -0700 (Fri, 21 Nov 2008) | 11 lines In reference to the fix made for 13871, I was merging the fix into 1.6.0 and realized I missed the code in the h-exten block, and didn't catch it because my test case had the h-exten commented out. So, this corrects the code I missed, as a preventative against another crash report. Tested with the h-exten defined, all is well. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@158606 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -2468,7 +2468,7 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast
|
|||||||
autoloopflag = ast_test_flag(chan, AST_FLAG_IN_AUTOLOOP);
|
autoloopflag = ast_test_flag(chan, AST_FLAG_IN_AUTOLOOP);
|
||||||
ast_set_flag(chan, AST_FLAG_IN_AUTOLOOP);
|
ast_set_flag(chan, AST_FLAG_IN_AUTOLOOP);
|
||||||
if (res != AST_PBX_KEEPALIVE && !ast_test_flag(&(config->features_caller),AST_FEATURE_NO_H_EXTEN) && ast_exists_extension(chan, chan->context, "h", 1, chan->cid.cid_num)) {
|
if (res != AST_PBX_KEEPALIVE && !ast_test_flag(&(config->features_caller),AST_FEATURE_NO_H_EXTEN) && ast_exists_extension(chan, chan->context, "h", 1, chan->cid.cid_num)) {
|
||||||
struct ast_cdr *swapper;
|
struct ast_cdr *swapper = NULL;
|
||||||
char savelastapp[AST_MAX_EXTENSION];
|
char savelastapp[AST_MAX_EXTENSION];
|
||||||
char savelastdata[AST_MAX_EXTENSION];
|
char savelastdata[AST_MAX_EXTENSION];
|
||||||
char save_exten[AST_MAX_EXTENSION];
|
char save_exten[AST_MAX_EXTENSION];
|
||||||
@@ -2476,16 +2476,18 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast
|
|||||||
int found = 0; /* set if we find at least one match */
|
int found = 0; /* set if we find at least one match */
|
||||||
int spawn_error = 0;
|
int spawn_error = 0;
|
||||||
|
|
||||||
if (ast_opt_end_cdr_before_h_exten) {
|
if (bridge_cdr && ast_opt_end_cdr_before_h_exten) {
|
||||||
ast_cdr_end(bridge_cdr);
|
ast_cdr_end(bridge_cdr);
|
||||||
}
|
}
|
||||||
/* swap the bridge cdr and the chan cdr for a moment, and let the endbridge
|
/* swap the bridge cdr and the chan cdr for a moment, and let the endbridge
|
||||||
dialplan code operate on it */
|
dialplan code operate on it */
|
||||||
|
ast_channel_lock(chan);
|
||||||
|
if (bridge_cdr) {
|
||||||
swapper = chan->cdr;
|
swapper = chan->cdr;
|
||||||
ast_copy_string(savelastapp, bridge_cdr->lastapp, sizeof(bridge_cdr->lastapp));
|
ast_copy_string(savelastapp, bridge_cdr->lastapp, sizeof(bridge_cdr->lastapp));
|
||||||
ast_copy_string(savelastdata, bridge_cdr->lastdata, sizeof(bridge_cdr->lastdata));
|
ast_copy_string(savelastdata, bridge_cdr->lastdata, sizeof(bridge_cdr->lastdata));
|
||||||
ast_channel_lock(chan);
|
|
||||||
chan->cdr = bridge_cdr;
|
chan->cdr = bridge_cdr;
|
||||||
|
}
|
||||||
ast_copy_string(save_exten, chan->exten, sizeof(save_exten));
|
ast_copy_string(save_exten, chan->exten, sizeof(save_exten));
|
||||||
save_prio = chan->priority;
|
save_prio = chan->priority;
|
||||||
ast_copy_string(chan->exten, "h", sizeof(chan->exten));
|
ast_copy_string(chan->exten, "h", sizeof(chan->exten));
|
||||||
@@ -2503,13 +2505,16 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast
|
|||||||
ast_channel_lock(chan);
|
ast_channel_lock(chan);
|
||||||
ast_copy_string(chan->exten, save_exten, sizeof(chan->exten));
|
ast_copy_string(chan->exten, save_exten, sizeof(chan->exten));
|
||||||
chan->priority = save_prio;
|
chan->priority = save_prio;
|
||||||
|
if (bridge_cdr)
|
||||||
chan->cdr = swapper;
|
chan->cdr = swapper;
|
||||||
ast_set_flag(chan, AST_FLAG_BRIDGE_HANGUP_RUN);
|
ast_set_flag(chan, AST_FLAG_BRIDGE_HANGUP_RUN);
|
||||||
ast_channel_unlock(chan);
|
ast_channel_unlock(chan);
|
||||||
/* protect the lastapp/lastdata against the effects of the hangup/dialplan code */
|
/* protect the lastapp/lastdata against the effects of the hangup/dialplan code */
|
||||||
|
if (bridge_cdr) {
|
||||||
ast_copy_string(bridge_cdr->lastapp, savelastapp, sizeof(bridge_cdr->lastapp));
|
ast_copy_string(bridge_cdr->lastapp, savelastapp, sizeof(bridge_cdr->lastapp));
|
||||||
ast_copy_string(bridge_cdr->lastdata, savelastdata, sizeof(bridge_cdr->lastdata));
|
ast_copy_string(bridge_cdr->lastdata, savelastdata, sizeof(bridge_cdr->lastdata));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
ast_set2_flag(chan, autoloopflag, AST_FLAG_IN_AUTOLOOP);
|
ast_set2_flag(chan, autoloopflag, AST_FLAG_IN_AUTOLOOP);
|
||||||
|
|
||||||
/* obey the NoCDR() wishes. -- move the DISABLED flag to the bridge CDR if it was set on the channel during the bridge... */
|
/* obey the NoCDR() wishes. -- move the DISABLED flag to the bridge CDR if it was set on the channel during the bridge... */
|
||||||
|
Reference in New Issue
Block a user