summaryrefslogtreecommitdiff
path: root/apps/app_agent_pool.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/app_agent_pool.c')
-rw-r--r--apps/app_agent_pool.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/app_agent_pool.c b/apps/app_agent_pool.c
index 2b0d1f8b8..a44c75d46 100644
--- a/apps/app_agent_pool.c
+++ b/apps/app_agent_pool.c
@@ -1465,7 +1465,9 @@ static void agent_logout(struct agent_pvt *agent)
ast_bridge_destroy(caller_bridge, AST_CAUSE_USER_BUSY);
}
+ ast_channel_lock(logged);
send_agent_logoff(logged, agent->username, time_logged_in);
+ ast_channel_unlock(logged);
ast_verb(2, "Agent '%s' logged out. Logged in for %ld seconds.\n",
agent->username, time_logged_in);
ast_channel_unref(logged);
@@ -2046,7 +2048,9 @@ static int agent_login_exec(struct ast_channel *chan, const char *data)
ast_verb(2, "Agent '%s' logged in (format %s/%s)\n", agent->username,
ast_getformatname(ast_channel_readformat(chan)),
ast_getformatname(ast_channel_writeformat(chan)));
+ ast_channel_lock(chan);
send_agent_login(chan, agent->username);
+ ast_channel_unlock(chan);
agent_run(agent, chan);
return -1;