[asterisk-commits] mmichelson: branch 1.6.0 r118382 - in /branches/1.6.0: ./ apps/app_chanspy.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue May 27 11:49:16 CDT 2008


Author: mmichelson
Date: Tue May 27 11:48:50 2008
New Revision: 118382

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

................
r118371 | mmichelson | 2008-05-27 11:43:36 -0500 (Tue, 27 May 2008) | 22 lines

Merged revisions 118365 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r118365 | mmichelson | 2008-05-27 11:38:38 -0500 (Tue, 27 May 2008) | 14 lines

Add a unique id to the datastore allocated in app_chanspy since
it is possible that multiple spies may be listening to the same
channel.

(closes issue #12376)
Reported by: DougUDI
Patches:
      12376_chanspy_uid.diff uploaded by putnopvut (license 60)
Tested by: destiny6628

(closes issue #12243)
Reported by: atis


........

................

Modified:
    branches/1.6.0/   (props changed)
    branches/1.6.0/apps/app_chanspy.c

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

Modified: branches/1.6.0/apps/app_chanspy.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/apps/app_chanspy.c?view=diff&rev=118382&r1=118381&r2=118382
==============================================================================
--- branches/1.6.0/apps/app_chanspy.c (original)
+++ branches/1.6.0/apps/app_chanspy.c Tue May 27 11:48:50 2008
@@ -452,11 +452,13 @@
 	if (chanspy_ds->chan) {
 		struct ast_datastore *datastore;
 		struct ast_channel *chan;
+		char uid[20];
 
 		chan = chanspy_ds->chan;
 
 		ast_channel_lock(chan);
-		if ((datastore = ast_channel_datastore_find(chan, &chanspy_ds_info, NULL))) {
+		snprintf(uid, sizeof(uid), "%p", chanspy_ds);
+		if ((datastore = ast_channel_datastore_find(chan, &chanspy_ds_info, uid))) {
 			ast_channel_datastore_remove(chan, datastore);
 			/* chanspy_ds->chan is NULL after this call */
 			chanspy_ds_destroy(datastore->data);
@@ -474,10 +476,13 @@
 static struct chanspy_ds *setup_chanspy_ds(struct ast_channel *chan, struct chanspy_ds *chanspy_ds)
 {
 	struct ast_datastore *datastore = NULL;
+	char uid[20];
 
 	ast_mutex_lock(&chanspy_ds->lock);
 
-	if (!(datastore = ast_channel_datastore_alloc(&chanspy_ds_info, NULL))) {
+	snprintf(uid, sizeof(uid), "%p", chanspy_ds);
+
+	if (!(datastore = ast_channel_datastore_alloc(&chanspy_ds_info, uid))) {
 		ast_mutex_unlock(&chanspy_ds->lock);
 		chanspy_ds = chanspy_ds_free(chanspy_ds);
 		ast_channel_unlock(chan);




More information about the asterisk-commits mailing list