}
if (holder->justcount) {
- holder->count++;
+ if (zstr(argv[0])) {
+ holder->count = 0;
+ } else {
+ holder->count = (uint32_t) atoi(argv[0]);
+ }
return 0;
}
}
if (holder->justcount) {
- holder->count++;
+ if (zstr(argv[0])) {
+ holder->count = 0;
+ } else {
+ holder->count = (uint32_t) atoi(argv[0]);
+ }
return 0;
}
int x;
if (holder->justcount) {
- holder->count++;
+ if (zstr(argv[0])) {
+ holder->count = 0;
+ } else {
+ holder->count = (uint32_t) atoi(argv[0]);
+ }
return 0;
}
if (!strcasecmp(command, "calls")) {
sprintf(sql, "select * from basic_calls where hostname='%s' order by call_created_epoch", hostname);
if (argv[1] && !strcasecmp(argv[1], "count")) {
+ sprintf(sql, "select count(*) from basic_calls where hostname='%s'", hostname);
holder.justcount = 1;
if (argv[3] && !strcasecmp(argv[2], "as")) {
as = argv[3];
} else if (!strcasecmp(command, "registrations")) {
sprintf(sql, "select * from registrations where hostname='%s'", hostname);
if (argv[1] && !strcasecmp(argv[1], "count")) {
+ sprintf(sql, "select count(*) from registrations where hostname='%s'", hostname);
holder.justcount = 1;
if (argv[3] && !strcasecmp(argv[2], "as")) {
as = argv[3];
} else if (!strcasecmp(command, "channels")) {
sprintf(sql, "select * from channels where hostname='%s' order by created_epoch", hostname);
if (argv[1] && !strcasecmp(argv[1], "count")) {
+ sprintf(sql, "select count(*) from channels where hostname='%s'", hostname);
holder.justcount = 1;
if (argv[3] && !strcasecmp(argv[2], "as")) {
as = argv[3];