[Asterisk-cvs] asterisk/channels chan_agent.c,1.114,1.115
markster at lists.digium.com
markster at lists.digium.com
Thu Feb 17 23:04:02 CST 2005
Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv30161/channels
Modified Files:
chan_agent.c
Log Message:
Add event for agentlogoff from CLI (bug #3611)
Index: chan_agent.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_agent.c,v
retrieving revision 1.114
retrieving revision 1.115
diff -u -d -r1.114 -r1.115
--- chan_agent.c 14 Feb 2005 23:20:01 -0000 1.114
+++ chan_agent.c 18 Feb 2005 05:03:01 -0000 1.115
@@ -1314,7 +1314,8 @@
{
struct agent_pvt *p;
char *agent = argv[2] + 6;
-
+ long logintime;
+
if (argc < 3 || argc > 4)
return RESULT_SHOWUSAGE;
if (argc == 4 && strcasecmp(argv[3], "soft"))
@@ -1330,6 +1331,15 @@
ast_softhangup(p->chan, AST_SOFTHANGUP_EXPLICIT);
}
}
+ logintime = time(NULL) - p->loginstart;
+ p->loginstart = 0;
+
+ manager_event(EVENT_FLAG_AGENT, "Agentcallbacklogoff",
+ "Agent: %s\r\n"
+ "Loginchan: %s\r\n"
+ "Logintime: %ld\r\n",
+ p->agent, p->loginchan, logintime);
+ ast_queue_log("NONE", "NONE", agent, "AGENTCALLBACKLOGOFF", "%s|%ld|%s", p->loginchan, logintime, "CommandLogoff");
p->loginchan[0] = '\0';
ast_cli(fd, "Logging out %s\n", agent);
break;
More information about the svn-commits
mailing list