mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 20:20:07 +00:00
make 'Agents' manager action conform to protocol (bug #4723)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6141 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1326,14 +1326,20 @@ static int powerof(unsigned int v)
|
|||||||
/*--- action_agents: Manager routine for listing channels */
|
/*--- action_agents: Manager routine for listing channels */
|
||||||
static int action_agents(struct mansession *s, struct message *m)
|
static int action_agents(struct mansession *s, struct message *m)
|
||||||
{
|
{
|
||||||
|
char *id = astman_get_header(m,"ActionID");
|
||||||
|
char idText[256] = "";
|
||||||
struct agent_pvt *p;
|
struct agent_pvt *p;
|
||||||
char *username = NULL;
|
char *username = NULL;
|
||||||
char *loginChan = NULL;
|
char *loginChan = NULL;
|
||||||
char *talkingtoChan = NULL;
|
char *talkingtoChan = NULL;
|
||||||
char *status = NULL;
|
char *status = NULL;
|
||||||
|
|
||||||
|
if (id && !ast_strlen_zero(id))
|
||||||
|
snprintf(idText, sizeof(idText) ,"ActionID: %s\r\n", id);
|
||||||
|
astman_send_ack(s, m, "Agents will follow");
|
||||||
ast_mutex_lock(&agentlock);
|
ast_mutex_lock(&agentlock);
|
||||||
p = agents;
|
p = agents;
|
||||||
|
ast_mutex_lock(&s->lock);
|
||||||
while(p) {
|
while(p) {
|
||||||
ast_mutex_lock(&p->lock);
|
ast_mutex_lock(&p->lock);
|
||||||
|
|
||||||
@@ -1381,12 +1387,18 @@ static int action_agents(struct mansession *s, struct message *m)
|
|||||||
"LoggedInChan: %s\r\n"
|
"LoggedInChan: %s\r\n"
|
||||||
"LoggedInTime: %ld\r\n"
|
"LoggedInTime: %ld\r\n"
|
||||||
"TalkingTo: %s\r\n"
|
"TalkingTo: %s\r\n"
|
||||||
|
"%s"
|
||||||
"\r\n",
|
"\r\n",
|
||||||
p->agent,p->name,status,loginChan,p->loginstart,talkingtoChan);
|
p->agent,p->name,status,loginChan,p->loginstart,talkingtoChan,idText);
|
||||||
ast_mutex_unlock(&p->lock);
|
ast_mutex_unlock(&p->lock);
|
||||||
p = p->next;
|
p = p->next;
|
||||||
}
|
}
|
||||||
ast_mutex_unlock(&agentlock);
|
ast_mutex_unlock(&agentlock);
|
||||||
|
ast_cli(s->fd, "Event: AgentsComplete\r\n"
|
||||||
|
"%s"
|
||||||
|
"\r\n",idText);
|
||||||
|
ast_mutex_unlock(&s->lock);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user