[asterisk-commits] file: branch 1.4 r63283 - /branches/1.4/channels/chan_sip.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon May 7 14:26:59 MST 2007


Author: file
Date: Mon May  7 16:26:58 2007
New Revision: 63283

URL: http://svn.digium.com/view/asterisk?view=rev&rev=63283
Log:
Minor backport of revision 59083 in trunk. Don't queue an unhold frame up if the call was never on hold to begin with.

Modified:
    branches/1.4/channels/chan_sip.c

Modified: branches/1.4/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_sip.c?view=diff&rev=63283&r1=63282&r2=63283
==============================================================================
--- branches/1.4/channels/chan_sip.c (original)
+++ branches/1.4/channels/chan_sip.c Mon May  7 16:26:58 2007
@@ -5234,7 +5234,7 @@
 		ast_set_write_format(p->owner, p->owner->writeformat);
 	}
 	
-	if (sin.sin_addr.s_addr && (!sendonly || sendonly == -1)) {
+	if (ast_test_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD) && sin.sin_addr.s_addr && (!sendonly || sendonly == -1)) {
 		ast_queue_control(p->owner, AST_CONTROL_UNHOLD);
 		/* Activate a re-invite */
 		ast_queue_frame(p->owner, &ast_null_frame);
@@ -5250,18 +5250,16 @@
 	}
 
 	/* Manager Hold and Unhold events must be generated, if necessary */
-	if (sin.sin_addr.s_addr && (!sendonly || sendonly == -1)) {
-		if (ast_test_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD)) {
-			append_history(p, "Unhold", "%s", req->data);
-			if (global_callevents)
-				manager_event(EVENT_FLAG_CALL, "Unhold",
-					"Channel: %s\r\n"
-					"Uniqueid: %s\r\n",
-					p->owner->name, 
-					p->owner->uniqueid);
-			if (global_notifyhold)
-				sip_peer_hold(p, 0);
-		} 
+	if (ast_test_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD) && sin.sin_addr.s_addr && (!sendonly || sendonly == -1)) {
+		append_history(p, "Unhold", "%s", req->data);
+		if (global_callevents)
+			manager_event(EVENT_FLAG_CALL, "Unhold",
+				      "Channel: %s\r\n"
+				      "Uniqueid: %s\r\n",
+				      p->owner->name, 
+				      p->owner->uniqueid);
+		if (global_notifyhold)
+			sip_peer_hold(p, 0);
 		ast_clear_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD);	/* Clear both flags */
 	} else if (!sin.sin_addr.s_addr || sendonly ) {
 		/* No address for RTP, we're on hold */



More information about the asterisk-commits mailing list