aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-10-01 13:53:09 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-10-01 13:53:09 +0000
commit68cc072bd55fdb9c3e5a40152c2c71e5cd07042c (patch)
tree94296274c663b7e0ef0cf963b0d3bcfc5a9f01b5 /apps
parent1a1fd41bba80b8f1f64044a549ad2a0092636004 (diff)
Merged revisions 84158 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r84158 | file | 2007-10-01 10:49:36 -0300 (Mon, 01 Oct 2007) | 4 lines Only attempt early bridging if the options given to Dial() permit it. (closes issue #10861) Reported by: peekyb ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@84159 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_dial.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index ce763653f..87b3dcc4f 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -313,6 +313,8 @@ AST_APP_OPTIONS(dial_exec_options, {
AST_APP_OPTION('W', OPT_CALLER_MONITOR),
});
+#define CAN_EARLY_BRIDGE(flags) (!ast_test_flag64(flags, OPT_CALLEE_HANGUP) && !ast_test_flag64(flags, OPT_CALLER_HANGUP) && !ast_test_flag64(flags, OPT_CALLEE_TRANSFER) && !ast_test_flag64(flags, OPT_CALLER_TRANSFER) && !ast_test_flag64(flags, OPT_CALLEE_MONITOR) && !ast_test_flag64(flags, OPT_CALLER_MONITOR) && !ast_test_flag64(flags, OPT_CALLEE_PARK) && !ast_test_flag64(flags, OPT_CALLER_PARK))
+
/*
* The list of active channels
*/
@@ -660,8 +662,9 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
DIAL_NOFORWARDHTML);
ast_copy_string(c->dialcontext, "", sizeof(c->dialcontext));
ast_copy_string(c->exten, "", sizeof(c->exten));
- /* Setup early bridge if appropriate */
- ast_channel_early_bridge(in, peer);
+ if (CAN_EARLY_BRIDGE(peerflags))
+ /* Setup early bridge if appropriate */
+ ast_channel_early_bridge(in, peer);
}
/* If call has been answered, then the eventual hangup is likely to be normal hangup */
in->hangupcause = AST_CAUSE_NORMAL_CLEARING;
@@ -686,7 +689,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
case AST_CONTROL_RINGING:
ast_verb(3, "%s is ringing\n", c->name);
/* Setup early media if appropriate */
- if (single)
+ if (single && CAN_EARLY_BRIDGE(peerflags))
ast_channel_early_bridge(in, c);
if (!(pa->sentringing) && !ast_test_flag64(outgoing, OPT_MUSICBACK)) {
ast_indicate(in, AST_CONTROL_RINGING);
@@ -696,7 +699,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
case AST_CONTROL_PROGRESS:
ast_verb(3, "%s is making progress passing it to %s\n", c->name, in->name);
/* Setup early media if appropriate */
- if (single)
+ if (single && CAN_EARLY_BRIDGE(peerflags))
ast_channel_early_bridge(in, c);
if (!ast_test_flag64(outgoing, OPT_RINGBACK))
ast_indicate(in, AST_CONTROL_PROGRESS);
@@ -707,7 +710,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
break;
case AST_CONTROL_PROCEEDING:
ast_verb(3, "%s is proceeding passing it to %s\n", c->name, in->name);
- if (single)
+ if (single && CAN_EARLY_BRIDGE(peerflags))
ast_channel_early_bridge(in, c);
if (!ast_test_flag64(outgoing, OPT_RINGBACK))
ast_indicate(in, AST_CONTROL_PROCEEDING);