mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 04:11:08 +00:00
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: https://origsvn.digium.com/svn/asterisk/branches/1.4@131299 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -2578,7 +2578,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));
|
||||
@@ -2589,6 +2589,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.
|
||||
@@ -3109,6 +3110,7 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce
|
||||
bridge = ast_bridge_call(qe->chan,peer, &bridge_config);
|
||||
|
||||
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),
|
||||
@@ -3147,6 +3149,12 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce
|
||||
(long)(time(NULL) - callstart),
|
||||
qe->parent->eventwhencalled == QUEUE_EVENT_VARIABLES ? vars2manager(qe->chan, vars, sizeof(vars)) : "");
|
||||
}
|
||||
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)
|
||||
|
Reference in New Issue
Block a user