summaryrefslogtreecommitdiff
path: root/res/res_calendar.c
diff options
context:
space:
mode:
authorTerry Wilson <twilson@digium.com>2009-10-14 21:16:57 +0000
committerTerry Wilson <twilson@digium.com>2009-10-14 21:16:57 +0000
commitcb74681b6d62b4040867d1da9b0a951504080580 (patch)
treed94254ca72eedea2f23ffa0ba52626517805813a /res/res_calendar.c
parente3f473f4f3ab6871f123e12ab381e84b34c6b238 (diff)
Add missing 'getnum' field
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@224074 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_calendar.c')
-rw-r--r--res/res_calendar.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/res/res_calendar.c b/res/res_calendar.c
index 9b93aa965..7d5721b10 100644
--- a/res/res_calendar.c
+++ b/res/res_calendar.c
@@ -1171,6 +1171,7 @@ static int calendar_query_result_exec(struct ast_channel *chan, const char *cmd,
struct eventlist *events;
struct evententry *entry;
int row = 1;
+ size_t listlen = 0;
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(id);
AST_APP_ARG(field);
@@ -1207,6 +1208,15 @@ static int calendar_query_result_exec(struct ast_channel *chan, const char *cmd,
}
AST_LIST_TRAVERSE(events, entry, list) {
+ listlen++;
+ }
+
+ if (!strcasecmp(args.field, "getnum")) {
+ snprintf(buf, len, "%zu", listlen);
+ return 0;
+ }
+
+ AST_LIST_TRAVERSE(events, entry, list) {
if (--row) {
continue;
}