[asterisk-commits] russell: branch russell/sla_rewrite r53527 - /team/russell/sla_rewrite/channels/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Feb 7 17:49:43 MST 2007


Author: russell
Date: Wed Feb  7 18:49:42 2007
New Revision: 53527

URL: http://svn.digium.com/view/asterisk?view=rev&rev=53527
Log:
Don't do the check to see if there is a bridged peer before checking for 
HOLD/UNHOLD.  It made sense a long time ago when this block of code actually
started and stopped music on hold on the bridged peer directly.  However, since
it now just queues a frame, I don't think it is appropriate.

chan_sip experts - If you can think of a reason why this shouldn't change,
please let me know ...

Modified:
    team/russell/sla_rewrite/channels/chan_sip.c

Modified: team/russell/sla_rewrite/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/russell/sla_rewrite/channels/chan_sip.c?view=diff&rev=53527&r1=53526&r2=53527
==============================================================================
--- team/russell/sla_rewrite/channels/chan_sip.c (original)
+++ team/russell/sla_rewrite/channels/chan_sip.c Wed Feb  7 18:49:42 2007
@@ -4705,7 +4705,6 @@
 	int iterator;
 	int sendonly = 0;
 	int numberofports;
-	struct ast_channel *bridgepeer = NULL;
 	struct ast_rtp *newaudiortp, *newvideortp;	/* Buffers for codec handling */
 	int newjointcapability;				/* Negotiated capability */
 	int newpeercapability;
@@ -5196,22 +5195,21 @@
 		ast_set_write_format(p->owner, p->owner->writeformat);
 	}
 	
-	/* Turn on/off music on hold if we are holding/unholding */
-	if ((bridgepeer = ast_bridged_channel(p->owner))) {
-		if (sin.sin_addr.s_addr && !sendonly) {
-			ast_queue_control(p->owner, AST_CONTROL_UNHOLD);
-			/* Activate a re-invite */
-			ast_queue_frame(p->owner, &ast_null_frame);
-		} else if (!sin.sin_addr.s_addr || sendonly) {
-			ast_queue_control_data(p->owner, AST_CONTROL_HOLD, 
-					       S_OR(p->mohsuggest, NULL),
-					       !ast_strlen_zero(p->mohsuggest) ? strlen(p->mohsuggest) + 1 : 0);
-			if (sendonly)
-				ast_rtp_stop(p->rtp);
-			/* RTCP needs to go ahead, even if we're on hold!!! */
-			/* Activate a re-invite */
-			ast_queue_frame(p->owner, &ast_null_frame);
-		}
+	if (sin.sin_addr.s_addr && !sendonly) {
+		ast_log(LOG_DEBUG, "Queueing UNHOLD!\n");
+		ast_queue_control(p->owner, AST_CONTROL_UNHOLD);
+		/* Activate a re-invite */
+		ast_queue_frame(p->owner, &ast_null_frame);
+	} else if (!sin.sin_addr.s_addr || sendonly) {
+		ast_log(LOG_DEBUG, "Going on HOLD!\n");
+		ast_queue_control_data(p->owner, AST_CONTROL_HOLD, 
+				       S_OR(p->mohsuggest, NULL),
+				       !ast_strlen_zero(p->mohsuggest) ? strlen(p->mohsuggest) + 1 : 0);
+		if (sendonly)
+			ast_rtp_stop(p->rtp);
+		/* RTCP needs to go ahead, even if we're on hold!!! */
+		/* Activate a re-invite */
+		ast_queue_frame(p->owner, &ast_null_frame);
 	}
 
 	/* Manager Hold and Unhold events must be generated, if necessary */



More information about the asterisk-commits mailing list