[asterisk-commits] oej: branch group/rana-early-media-is-gone-1.8 r389483 - /team/group/rana-ear...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed May 22 09:47:33 CDT 2013


Author: oej
Date: Wed May 22 09:47:30 2013
New Revision: 389483

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=389483
Log:
Locking into one channel as suggested by file. Thank you Josh for the feedback.

At this point untested, but soon that will change forever.

Modified:
    team/group/rana-early-media-is-gone-1.8/apps/app_dial.c

Modified: team/group/rana-early-media-is-gone-1.8/apps/app_dial.c
URL: http://svnview.digium.com/svn/asterisk/team/group/rana-early-media-is-gone-1.8/apps/app_dial.c?view=diff&rev=389483&r1=389482&r2=389483
==============================================================================
--- team/group/rana-early-media-is-gone-1.8/apps/app_dial.c (original)
+++ team/group/rana-early-media-is-gone-1.8/apps/app_dial.c Wed May 22 09:47:30 2013
@@ -1045,6 +1045,8 @@
 	/* single is set if only one destination is enabled */
 	int single = outgoing && !outgoing->next;
 	int earlymedia = 0;		/* Turn on if early media (AST_PROGRESS) is active */
+	struct ast_channel *early_channel = NULL; /* Channel that provides early media if earlymedia is turned on */
+
 	int caller_entertained = outgoing
 		&& ast_test_flag64(outgoing, OPT_MUSICBACK | OPT_RINGBACK);
 #ifdef HAVE_EPOLL
@@ -1347,11 +1349,14 @@
 					   the rest */
 					ast_verb(3, "%s is making progress passing it to %s\n", c->name, in->name);
 					/* Setup early media if appropriate */
+					if (!earlymedia) {
+						earlymedia = 1;		
+						early_channel = c;
+					}
 					if (!earlymedia && !caller_entertained
 						&& CAN_EARLY_BRIDGE(peerflags, in, c)) {
 						ast_channel_early_bridge(in, c);
 						ast_debug(4, "======> Enabled early bridge \n");
-						earlymedia = 1;		
 					}
 					if (!ast_test_flag64(outgoing, OPT_RINGBACK)) {
 						if (single || (!single && !pa->sentringing)) {
@@ -1474,9 +1479,13 @@
 				}
 				/* Fall through */
 			case AST_FRAME_TEXT:
-				if ((single || earlymedia)  && ast_write(in, f)) {
+				if (single  && ast_write(in, f)) {
 					ast_log(LOG_WARNING, "Unable to write frametype: %d\n",
 						f->frametype);
+				} else if (earlymedia && early_channel == c) {
+					if (ast_write(in, f)) {
+						ast_log(LOG_WARNING, "Unable to write frametype: %d\n", f->frametype);
+					}
 				}
 				break;
 			case AST_FRAME_HTML:




More information about the asterisk-commits mailing list