[asterisk-commits] kpfleming: branch 1.6.1 r149995 - in /branches/1.6.1: ./ channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Oct 16 08:32:10 CDT 2008


Author: kpfleming
Date: Thu Oct 16 08:32:09 2008
New Revision: 149995

URL: http://svn.digium.com/view/asterisk?view=rev&rev=149995
Log:
Merged revisions 149981 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r149981 | kpfleming | 2008-10-16 15:28:56 +0200 (Thu, 16 Oct 2008) | 3 lines
  
  return this logic to where it used to be, *after* the dialog->needdestroy flag has been determined to be set; otherwise, we generate these debug messages every time we inspect every active dialog
........

Modified:
    branches/1.6.1/   (props changed)
    branches/1.6.1/channels/chan_sip.c

Propchange: branches/1.6.1/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.1/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.1/channels/chan_sip.c?view=diff&rev=149995&r1=149994&r2=149995
==============================================================================
--- branches/1.6.1/channels/chan_sip.c (original)
+++ branches/1.6.1/channels/chan_sip.c Thu Oct 16 08:32:09 2008
@@ -12791,6 +12791,7 @@
 	time_t *t = arg;
 	
 	/* log_show_lock(ao2_object_get_lockaddr(dialog)); this is an example of how to use log_show_lock() */
+
 	if (sip_pvt_trylock(dialog)) {
 		/* In very short-duration calls via sipp,
 		   this path gets executed fairly frequently (3% or so) even in low load
@@ -12801,6 +12802,7 @@
 		ao2_unlock(dialogs);
 		usleep(1);
 		ao2_lock(dialogs);
+
 		/* I had previously returned CMP_STOP here; but changed it to return
 		   a zero instead, because there is no need to stop at the first sign
 		   of trouble. The old algorithm would restart in such circumstances,
@@ -12813,18 +12815,6 @@
 		return 0;
 	}
 	
-	/* We absolutely cannot destroy the rtp struct while a bridge is active or we WILL crash */
-	if (dialog->rtp && ast_rtp_get_bridged(dialog->rtp)) {
-		ast_debug(2, "Bridge still active.  Delaying destroy of SIP dialog '%s' Method: %s\n", dialog->callid, sip_methods[dialog->method].text);
-		sip_pvt_unlock(dialog);
-		return 0;
-	}
-
-	if (dialog->vrtp && ast_rtp_get_bridged(dialog->vrtp)) {
-		ast_debug(2, "Bridge still active.  Delaying destroy of SIP dialog '%s' Method: %s\n", dialog->callid, sip_methods[dialog->method].text);
-		sip_pvt_unlock(dialog);
-		return 0;
-	}
 	/* Check RTP timeouts and kill calls if we have a timeout set and do not get RTP */
 	check_rtp_timeout(dialog, *t);
 
@@ -12832,13 +12822,28 @@
 	/* Check if we have outstanding requests not responsed to or an active call
 	   - if that's the case, wait with destruction */
 	if (dialog->needdestroy && !dialog->packets && !dialog->owner) {
+		/* We absolutely cannot destroy the rtp struct while a bridge is active or we WILL crash */
+		if (dialog->rtp && ast_rtp_get_bridged(dialog->rtp)) {
+			ast_debug(2, "Bridge still active.  Delaying destruction of SIP dialog '%s' Method: %s\n", dialog->callid, sip_methods[dialog->method].text);
+			sip_pvt_unlock(dialog);
+			return 0;
+		}
+		
+		if (dialog->vrtp && ast_rtp_get_bridged(dialog->vrtp)) {
+			ast_debug(2, "Bridge still active.  Delaying destroy of SIP dialog '%s' Method: %s\n", dialog->callid, sip_methods[dialog->method].text);
+			sip_pvt_unlock(dialog);
+			return 0;
+		}
+
 		sip_pvt_unlock(dialog);
 		/* no, the unlink should handle this: dialog_unref(dialog, "needdestroy: one more refcount decrement to allow dialog to be destroyed"); */
 		/* the CMP_MATCH will unlink this dialog from the dialog hash table */
 		dialog_unlink_all(dialog, TRUE, FALSE);
 		return 0; /* the unlink_all should unlink this from the table, so.... no need to return a match */
 	}
+
 	sip_pvt_unlock(dialog);
+
 	return 0;
 }
 




More information about the asterisk-commits mailing list