[asterisk-commits] file: trunk r84159 - in /trunk: ./ apps/app_dial.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Oct 1 08:53:10 CDT 2007


Author: file
Date: Mon Oct  1 08:53:09 2007
New Revision: 84159

URL: http://svn.digium.com/view/asterisk?view=rev&rev=84159
Log:
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

........

Modified:
    trunk/   (props changed)
    trunk/apps/app_dial.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_dial.c?view=diff&rev=84159&r1=84158&r2=84159
==============================================================================
--- trunk/apps/app_dial.c (original)
+++ trunk/apps/app_dial.c Mon Oct  1 08:53:09 2007
@@ -313,6 +313,8 @@
 	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 @@
 							       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 @@
 				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 @@
 				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 @@
 					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);




More information about the asterisk-commits mailing list