[asterisk-commits] file: branch 1.4 r84158 - /branches/1.4/apps/app_dial.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Oct 1 08:49:36 CDT 2007
Author: file
Date: Mon Oct 1 08:49:36 2007
New Revision: 84158
URL: http://svn.digium.com/view/asterisk?view=rev&rev=84158
Log:
Only attempt early bridging if the options given to Dial() permit it.
(closes issue #10861)
Reported by: peekyb
Modified:
branches/1.4/apps/app_dial.c
Modified: branches/1.4/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/apps/app_dial.c?view=diff&rev=84158&r1=84157&r2=84158
==============================================================================
--- branches/1.4/apps/app_dial.c (original)
+++ branches/1.4/apps/app_dial.c Mon Oct 1 08:49:36 2007
@@ -291,6 +291,8 @@
AST_APP_OPTION('W', OPT_CALLER_MONITOR),
});
+#define CAN_EARLY_BRIDGE(flags) (!ast_test_flag(flags, OPT_CALLEE_HANGUP) && !ast_test_flag(flags, OPT_CALLER_HANGUP) && !ast_test_flag(flags, OPT_CALLEE_TRANSFER) && !ast_test_flag(flags, OPT_CALLER_TRANSFER) && !ast_test_flag(flags, OPT_CALLEE_MONITOR) && !ast_test_flag(flags, OPT_CALLER_MONITOR) && !ast_test_flag(flags, OPT_CALLEE_PARK) && !ast_test_flag(flags, OPT_CALLER_PARK))
+
/* We define a custom "local user" structure because we
use it not only for keeping track of what is in use but
also for keeping track of who we're dialing. */
@@ -584,7 +586,8 @@
ast_copy_string(c->dialcontext, "", sizeof(c->dialcontext));
ast_copy_string(c->exten, "", sizeof(c->exten));
/* Setup RTP early bridge if appropriate */
- ast_rtp_early_bridge(in, peer);
+ if (CAN_EARLY_BRIDGE(peerflags))
+ ast_rtp_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;
@@ -612,7 +615,7 @@
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "%s is ringing\n", c->name);
/* Setup early media if appropriate */
- if (single)
+ if (single && CAN_EARLY_BRIDGE(peerflags))
ast_rtp_early_bridge(in, c);
if (!(*sentringing) && !ast_test_flag(outgoing, OPT_MUSICBACK)) {
ast_indicate(in, AST_CONTROL_RINGING);
@@ -623,7 +626,7 @@
if (option_verbose > 2)
ast_verbose (VERBOSE_PREFIX_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_rtp_early_bridge(in, c);
if (!ast_test_flag(outgoing, OPT_RINGBACK))
ast_indicate(in, AST_CONTROL_PROGRESS);
@@ -636,7 +639,7 @@
case AST_CONTROL_PROCEEDING:
if (option_verbose > 2)
ast_verbose (VERBOSE_PREFIX_3 "%s is proceeding passing it to %s\n", c->name, in->name);
- if (single)
+ if (single && CAN_EARLY_BRIDGE(peerflags))
ast_rtp_early_bridge(in, c);
if (!ast_test_flag(outgoing, OPT_RINGBACK))
ast_indicate(in, AST_CONTROL_PROCEEDING);
More information about the asterisk-commits
mailing list