diff options
author | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-07-16 18:59:59 +0000 |
---|---|---|
committer | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-07-16 18:59:59 +0000 |
commit | 1c792f56218cf44e55bc3688228a84dc2a388c96 (patch) | |
tree | a9e9600888e62be15fcd8a98d0fd8544576520ee /apps | |
parent | 8deb6a4fa17ae761faaee57a01e4c377b240ae7c (diff) |
Merged revisions 131300 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
................
r131300 | mmichelson | 2008-07-16 13:59:27 -0500 (Wed, 16 Jul 2008) | 21 lines
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
........
................
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@131301 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r-- | apps/app_queue.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c index acf259c83..45bf61daf 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -3045,7 +3045,7 @@ static void queue_transfer_fixup(void *data, struct ast_channel *old_chan, struc 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", new_chan->exten, new_chan->context, (long) (callstart - qe->start), (long) (time(NULL) - callstart)); @@ -3056,6 +3056,7 @@ static void queue_transfer_fixup(void *data, struct ast_channel *old_chan, struc } 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. @@ -3746,6 +3747,7 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce * 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", qe->chan->exten, qe->chan->context, (long) (callstart - qe->start), @@ -3760,6 +3762,12 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce (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); + } } if (bridge != AST_PBX_NO_HANGUP_PEER) |