[asterisk-commits] mmichelson: trunk r131300 - in /trunk: ./ apps/app_queue.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jul 16 13:59:27 CDT 2008


Author: mmichelson
Date: Wed Jul 16 13:59:27 2008
New Revision: 131300

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

........
r131299 | mmichelson | 2008-07-16 13:57:34 -0500 (Wed, 16 Jul 2008) | 13 lines

Make absolutely certain that the transfer datastore
is removed from the calling channel once the caller
is finished in the queue. This could have weird con-
sequences when dialing local queue members when multiple
transfers occur on a single call.

Also fixed a memory leak that would occur when an
attended transfer occurred from a queue member.

(closes issue #13047)
Reported by: festr


........

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

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

Modified: trunk/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_queue.c?view=diff&rev=131300&r1=131299&r2=131300
==============================================================================
--- trunk/apps/app_queue.c (original)
+++ trunk/apps/app_queue.c Wed Jul 16 13:59:27 2008
@@ -3090,7 +3090,7 @@
 	struct member *member = qtds->member;
 	int callstart = qtds->starttime;
 	struct ast_datastore *datastore;
-	
+
 	ast_queue_log(qe->parent->name, qe->chan->uniqueid, member->membername, "TRANSFER", "%s|%s|%ld|%ld|%d",
 				new_chan->exten, new_chan->context, (long) (callstart - qe->start),
 				(long) (time(NULL) - callstart), qe->opos);
@@ -3101,6 +3101,7 @@
 	}
 
 	ast_channel_datastore_remove(new_chan, datastore);
+	ast_channel_datastore_free(datastore);
 }
 
 /*! \brief mechanism to tell if a queue caller was atxferred by a queue member.
@@ -3797,6 +3798,7 @@
 		 * when the masquerade occurred. These other "ending" queue_log messages are unnecessary
 		 */
 		if (!attended_transfer_occurred(qe->chan)) {
+			struct ast_datastore *transfer_ds = ast_channel_datastore_find(qe->chan, &queue_transfer_info, NULL);
 			if (strcasecmp(oldcontext, qe->chan->context) || strcasecmp(oldexten, qe->chan->exten)) {
 				ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "TRANSFER", "%s|%s|%ld|%ld|%d",
 					qe->chan->exten, qe->chan->context, (long) (callstart - qe->start),
@@ -3810,6 +3812,12 @@
 				ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "COMPLETEAGENT", "%ld|%ld|%d",
 					(long) (callstart - qe->start), (long) (time(NULL) - callstart), qe->opos);
 				send_agent_complete(qe, queuename, peer, member, callstart, vars, sizeof(vars), AGENT);
+			}
+			if (transfer_ds) {
+				ast_channel_lock(qe->chan);
+				ast_channel_datastore_remove(qe->chan, transfer_ds);
+				ast_channel_datastore_free(transfer_ds);
+				ast_channel_unlock(qe->chan);
 			}
 		}
 




More information about the asterisk-commits mailing list