aboutsummaryrefslogtreecommitdiffstats
path: root/main/features.c
diff options
context:
space:
mode:
authortwilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-10-31 21:49:23 +0000
committertwilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-10-31 21:49:23 +0000
commit9a2130e9dec6e913af3b75006c23feb0520d6814 (patch)
tree0fe680978e874f715b2f88a28ab07f74bd16a988 /main/features.c
parentcdffe98f294fed367720b68ae5893b20b78de5ae (diff)
Merged revisions 153181 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r153181 | twilson | 2008-10-31 13:55:33 -0500 (Fri, 31 Oct 2008) | 5 lines Recent CDR fixes moved execution of the 'h' exten into the bridging code, so variables that were set after ast_bridge_call was called would not show up in the 'h' exten. Added a callback function to handle setting variables, etc. from w/in the bridging code. Calls back into a nested function within the function calling ast_bridge_call (closes issue #13793) Reported by: greenfieldtech ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@153265 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/features.c')
-rw-r--r--main/features.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/main/features.c b/main/features.c
index 8ce02bb75..d7b1bf640 100644
--- a/main/features.c
+++ b/main/features.c
@@ -1907,6 +1907,7 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast
int diff;
int hasfeatures=0;
int hadfeatures=0;
+ int autoloopflag;
struct ast_option_header *aoh;
struct ast_bridge_config backup_config;
struct ast_cdr *bridge_cdr = NULL;
@@ -2170,7 +2171,13 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast
new_chan_cdr = pick_unlocked_cdr(chan->cdr); /* the proper chan cdr, if there are forked cdrs */
new_peer_cdr = pick_unlocked_cdr(peer->cdr); /* the proper chan cdr, if there are forked cdrs */
- if (!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 && config->end_bridge_callback) {
+ config->end_bridge_callback();
+ }
+
+ autoloopflag = ast_test_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)) {
struct ast_cdr *swapper;
char savelastapp[AST_MAX_EXTENSION];
char savelastdata[AST_MAX_EXTENSION];
@@ -2214,6 +2221,7 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast
ast_copy_string(bridge_cdr->lastapp, savelastapp, sizeof(bridge_cdr->lastapp));
ast_copy_string(bridge_cdr->lastdata, savelastdata, sizeof(bridge_cdr->lastdata));
}
+ ast_set2_flag(chan, autoloopflag, AST_FLAG_IN_AUTOLOOP);
/* obey the NoCDR() wishes. */
if (new_chan_cdr && ast_test_flag(new_chan_cdr, AST_CDR_FLAG_POST_DISABLED) && new_peer_cdr && !ast_test_flag(new_peer_cdr, AST_CDR_FLAG_POST_DISABLED))