提交 e1cb0e86 authored 作者: Marc Olivier Chouinard's avatar Marc Olivier Chouinard

Merge pull request #127 in FS/freeswitch from…

Merge pull request #127 in FS/freeswitch from ~ITALOROSSI/freeswitch:mod_callcenter-queue-list-count-by-state to master

* commit 'f63f8686':
  FS-7049 - Documentation for state optional paramenter in callcenter_config queue list and count
  fix FS-7049 - Count and list agents based on their state
...@@ -2862,11 +2862,11 @@ static int list_result_callback(void *pArg, int argc, char **argv, char **column ...@@ -2862,11 +2862,11 @@ static int list_result_callback(void *pArg, int argc, char **argv, char **column
"\tcallcenter_config queue unload [queue_name] | \n" \ "\tcallcenter_config queue unload [queue_name] | \n" \
"\tcallcenter_config queue reload [queue_name] | \n" \ "\tcallcenter_config queue reload [queue_name] | \n" \
"\tcallcenter_config queue list | \n" \ "\tcallcenter_config queue list | \n" \
"\tcallcenter_config queue list agents [queue_name] [status] | \n" \ "\tcallcenter_config queue list agents [queue_name] [status] [state] | \n" \
"\tcallcenter_config queue list members [queue_name] | \n" \ "\tcallcenter_config queue list members [queue_name] | \n" \
"\tcallcenter_config queue list tiers [queue_name] | \n" \ "\tcallcenter_config queue list tiers [queue_name] | \n" \
"\tcallcenter_config queue count | \n" \ "\tcallcenter_config queue count | \n" \
"\tcallcenter_config queue count agents [queue_name] [status] | \n" \ "\tcallcenter_config queue count agents [queue_name] [status] [state] | \n" \
"\tcallcenter_config queue count members [queue_name] | \n" \ "\tcallcenter_config queue count members [queue_name] | \n" \
"\tcallcenter_config queue count tiers [queue_name]" "\tcallcenter_config queue count tiers [queue_name]"
...@@ -3220,6 +3220,7 @@ SWITCH_STANDARD_API(cc_config_api_function) ...@@ -3220,6 +3220,7 @@ SWITCH_STANDARD_API(cc_config_api_function)
const char *sub_action = argv[0 + initial_argc]; const char *sub_action = argv[0 + initial_argc];
const char *queue_name = argv[1 + initial_argc]; const char *queue_name = argv[1 + initial_argc];
const char *status = NULL; const char *status = NULL;
const char *state = NULL;
struct list_result cbt; struct list_result cbt;
/* queue list agents */ /* queue list agents */
...@@ -3227,7 +3228,13 @@ SWITCH_STANDARD_API(cc_config_api_function) ...@@ -3227,7 +3228,13 @@ SWITCH_STANDARD_API(cc_config_api_function)
if (argc-initial_argc > 2) { if (argc-initial_argc > 2) {
status = argv[2 + initial_argc]; status = argv[2 + initial_argc];
} }
if (status) { if (argc-initial_argc > 3) {
state = argv[3 + initial_argc];
}
if (state) {
sql = switch_mprintf("SELECT agents.* FROM agents,tiers WHERE tiers.agent = agents.name AND tiers.queue = '%q' AND agents.status = '%q' AND agents.state = '%q'", queue_name, status, state);
}
else if (status) {
sql = switch_mprintf("SELECT agents.* FROM agents,tiers WHERE tiers.agent = agents.name AND tiers.queue = '%q' AND agents.status = '%q'", queue_name, status); sql = switch_mprintf("SELECT agents.* FROM agents,tiers WHERE tiers.agent = agents.name AND tiers.queue = '%q' AND agents.status = '%q'", queue_name, status);
} else { } else {
sql = switch_mprintf("SELECT agents.* FROM agents,tiers WHERE tiers.agent = agents.name AND tiers.queue = '%q'", queue_name); sql = switch_mprintf("SELECT agents.* FROM agents,tiers WHERE tiers.agent = agents.name AND tiers.queue = '%q'", queue_name);
...@@ -3266,6 +3273,7 @@ SWITCH_STANDARD_API(cc_config_api_function) ...@@ -3266,6 +3273,7 @@ SWITCH_STANDARD_API(cc_config_api_function)
const char *sub_action = argv[0 + initial_argc]; const char *sub_action = argv[0 + initial_argc];
const char *queue_name = argv[1 + initial_argc]; const char *queue_name = argv[1 + initial_argc];
const char *status = NULL; const char *status = NULL;
const char *state = NULL;
char res[256] = ""; char res[256] = "";
/* queue count agents */ /* queue count agents */
...@@ -3273,7 +3281,13 @@ SWITCH_STANDARD_API(cc_config_api_function) ...@@ -3273,7 +3281,13 @@ SWITCH_STANDARD_API(cc_config_api_function)
if (argc-initial_argc > 2) { if (argc-initial_argc > 2) {
status = argv[2 + initial_argc]; status = argv[2 + initial_argc];
} }
if (status) { if (argc-initial_argc > 3) {
state = argv[3 + initial_argc];
}
if (state) {
sql = switch_mprintf("SELECT count(*) FROM agents,tiers WHERE tiers.agent = agents.name AND tiers.queue = '%q' AND agents.status = '%q' AND agents.state = '%q'", queue_name, status, state);
}
else if (status) {
sql = switch_mprintf("SELECT count(*) FROM agents,tiers WHERE tiers.agent = agents.name AND tiers.queue = '%q' AND agents.status = '%q'", queue_name, status); sql = switch_mprintf("SELECT count(*) FROM agents,tiers WHERE tiers.agent = agents.name AND tiers.queue = '%q' AND agents.status = '%q'", queue_name, status);
} else { } else {
sql = switch_mprintf("SELECT count(*) FROM agents,tiers WHERE tiers.agent = agents.name AND tiers.queue = '%q'", queue_name); sql = switch_mprintf("SELECT count(*) FROM agents,tiers WHERE tiers.agent = agents.name AND tiers.queue = '%q'", queue_name);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论