diff options
-rwxr-xr-x | channels/chan_agent.c | 6 | ||||
-rwxr-xr-x | doc/queuelog.txt | 7 |
2 files changed, 13 insertions, 0 deletions
diff --git a/channels/chan_agent.c b/channels/chan_agent.c index fd21df6ab..04a4e68c1 100755 --- a/channels/chan_agent.c +++ b/channels/chan_agent.c @@ -1117,8 +1117,10 @@ static int __login_exec(struct ast_channel *chan, void *data, int callbackmode) struct agent_pvt *p; struct localuser *u; struct timeval tv; + time_t start; char user[AST_MAX_AGENT]; char pass[AST_MAX_AGENT]; + char agent[AST_MAX_AGENT] = ""; char xpass[AST_MAX_AGENT] = ""; char *errmsg; char info[512]; @@ -1291,6 +1293,9 @@ static int __login_exec(struct ast_channel *chan, void *data, int callbackmode) "Agent: %s\r\n" "Channel: %s\r\n", p->agent, chan->name); + time(&start); + snprintf(agent, sizeof(agent), "Agent/%s", p->agent); + ast_queue_log("NONE", chan->uniqueid, agent, "AGENTLOGIN", "%s", chan->name); if (option_verbose > 2) ast_verbose(VERBOSE_PREFIX_3 "Agent '%s' logged in (format %s/%s)\n", p->agent, ast_getformatname(chan->readformat), ast_getformatname(chan->writeformat)); @@ -1360,6 +1365,7 @@ static int __login_exec(struct ast_channel *chan, void *data, int callbackmode) ast_mutex_unlock(&p->lock); if (option_verbose > 2) ast_verbose(VERBOSE_PREFIX_3 "Agent '%s' logged out\n", p->agent); + ast_queue_log("NONE", chan->uniqueid, agent, "AGENTLOGOFF", "%s|%ld", chan->name, (long)(time(NULL) - start)); manager_event(EVENT_FLAG_AGENT, "Agentlogoff", "Agent: %s\r\n", p->agent); diff --git a/doc/queuelog.txt b/doc/queuelog.txt index fc93d2490..85da484c3 100755 --- a/doc/queuelog.txt +++ b/doc/queuelog.txt @@ -19,6 +19,13 @@ queue at the time of disconnect. AGENTDUMP The agent dumped the caller while listening to the queue announcement. +AGENTLOGIN(channel) +The agent logged in. The channel is recorded. + +AGENTLOGOFF(channel|logintime) +The agent logged off. The channel is recorded, along with the total time +the agent was logged in. + COMPLETEAGENT(holdtime|calltime|origposition) The caller was connected to an agent, and the call was terminated normally by the *agent*. The caller's hold time and the length of the call are both |