aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-07-16 19:37:08 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-07-16 19:37:08 +0000
commita52eadf50649102ee66d8d832227b216331826ba (patch)
tree57b559b372e1a94c200d811365aa3df6a2e36bc6 /apps
parent88b12e6d6de3799e71345276405df9ee454d06b6 (diff)
Apparently, "thread safety" is important, whatever
that means. :P (Thanks Russell!) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@131357 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_queue.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index 6c13ae500..113826296 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -3110,7 +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);
+ struct ast_datastore *transfer_ds;
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),
@@ -3149,12 +3149,13 @@ 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)) : "");
}
+ ast_channel_lock(qe->chan);
+ transfer_ds = ast_channel_datastore_find(qe->chan, &queue_transfer_info, NULL);
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);
}
+ ast_channel_unlock(qe->chan);
}
if (bridge != AST_PBX_NO_HANGUP_PEER)