[svn-commits] russell: branch 1.4 r73512 - /branches/1.4/res/res_features.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Jul 5 15:50:09 CDT 2007


Author: russell
Date: Thu Jul  5 15:50:08 2007
New Revision: 73512

URL: http://svn.digium.com/view/asterisk?view=rev&rev=73512
Log:
Pass HOLD and UNHOLD frames to the other channel when they are returned from a
native bridge function.  This fixes a problem where when two zap channels are
natively bridged and one does a flash hook, the other channel did not receive
music on hold.  (Reported to me directly by Doug Bailey at Digium)

Modified:
    branches/1.4/res/res_features.c

Modified: branches/1.4/res/res_features.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/res/res_features.c?view=diff&rev=73512&r1=73511&r2=73512
==============================================================================
--- branches/1.4/res/res_features.c (original)
+++ branches/1.4/res/res_features.c Thu Jul  5 15:50:08 2007
@@ -1470,17 +1470,24 @@
 		/* many things should be sent to the 'other' channel */
 		other = (who == chan) ? peer : chan;
 		if (f->frametype == AST_FRAME_CONTROL) {
-			if (f->subclass == AST_CONTROL_RINGING)
-				ast_indicate(other, AST_CONTROL_RINGING);
-			else if (f->subclass == -1)
-				ast_indicate(other, -1);
-			else if (f->subclass == AST_CONTROL_FLASH)
-				ast_indicate(other, AST_CONTROL_FLASH);
-			else if (f->subclass == AST_CONTROL_OPTION) {
+			switch (f->subclass) {
+			case AST_CONTROL_RINGING:
+			case AST_CONTROL_FLASH:
+			case -1:
+				ast_indicate(other, f->subclass);
+				break;
+			case AST_CONTROL_HOLD:
+			case AST_CONTROL_UNHOLD:
+				ast_indicate_data(other, f->subclass, f->data, f->datalen);
+				break;
+			case AST_CONTROL_OPTION:
 				aoh = f->data;
 				/* Forward option Requests */
-				if (aoh && aoh->flag == AST_OPTION_FLAG_REQUEST)
-					ast_channel_setoption(other, ntohs(aoh->option), aoh->data, f->datalen - sizeof(struct ast_option_header), 0);
+				if (aoh && aoh->flag == AST_OPTION_FLAG_REQUEST) {
+					ast_channel_setoption(other, ntohs(aoh->option), aoh->data, 
+						f->datalen - sizeof(struct ast_option_header), 0);
+				}
+				break;
 			}
 		} else if (f->frametype == AST_FRAME_DTMF_BEGIN) {
 			/* eat it */




More information about the svn-commits mailing list