[asterisk-commits] file: trunk r104788 - in /trunk: ./ apps/app_chanspy.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Feb 27 15:02:08 CST 2008


Author: file
Date: Wed Feb 27 15:02:08 2008
New Revision: 104788

URL: http://svn.digium.com/view/asterisk?view=rev&rev=104788
Log:
Merged revisions 104787 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r104787 | file | 2008-02-27 16:56:23 -0400 (Wed, 27 Feb 2008) | 2 lines

Don't loop around infinitely trying to spy on our own channel, and don't forget to free/detach the datastore upon hangup of the spy.

........

Modified:
    trunk/   (props changed)
    trunk/apps/app_chanspy.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/apps/app_chanspy.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_chanspy.c?view=diff&rev=104788&r1=104787&r2=104788
==============================================================================
--- trunk/apps/app_chanspy.c (original)
+++ trunk/apps/app_chanspy.c Wed Feb 27 15:02:08 2008
@@ -500,6 +500,10 @@
 	if (!strncmp(this->name, "Zap/pseudo", 10)) {
 		ast_channel_unlock(this);
 		goto redo;
+	} else if (this == chan) {
+		last = this;
+		ast_channel_unlock(this);
+		goto redo;
 	}
 
 	return setup_chanspy_ds(this, chanspy_ds);
@@ -616,11 +620,6 @@
 				break;
 			}
 
-			if (peer == chan) {
-				ast_channel_unlock(peer);
-				continue;
-			}
-
 			if (ast_test_flag(flags, OPTION_BRIDGED) && !ast_bridged_channel(peer)) {
 				ast_channel_unlock(peer);
 				continue;
@@ -714,6 +713,7 @@
 			num_spyed_upon++;	
 
 			if (res == -1) {
+				chanspy_ds_free(peer_chanspy_ds);
 				goto exit;
 			} else if (res == -2) {
 				res = 0;




More information about the asterisk-commits mailing list