mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-13 08:13:22 +00:00
Add "calendar show types" CLI command.
(closes issue #18246) Reported by: junky Patches: calendar_types.diff uploaded by junky (license 177) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@317483 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
2
CHANGES
2
CHANGES
@@ -93,6 +93,8 @@ Calendaring
|
|||||||
--------------------------
|
--------------------------
|
||||||
* Added setvar option to calendar.conf to allow setting channel variables on
|
* Added setvar option to calendar.conf to allow setting channel variables on
|
||||||
notification channels.
|
notification channels.
|
||||||
|
* Added "calendar show types" CLI command to list registered calendar
|
||||||
|
connectors.
|
||||||
|
|
||||||
MixMonitor
|
MixMonitor
|
||||||
--------------------------
|
--------------------------
|
||||||
|
@@ -1479,6 +1479,35 @@ static char *handle_show_calendars(struct ast_cli_entry *e, int cmd, struct ast_
|
|||||||
#undef FORMAT
|
#undef FORMAT
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*! \brief CLI command to list of all calendars types currently loaded on the backend */
|
||||||
|
static char *handle_show_calendars_types(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
|
||||||
|
{
|
||||||
|
#define FORMAT "%-10.10s %-30.30s\n"
|
||||||
|
struct ast_calendar_tech *iter;
|
||||||
|
|
||||||
|
|
||||||
|
switch(cmd) {
|
||||||
|
case CLI_INIT:
|
||||||
|
e->command = "calendar show types";
|
||||||
|
e->usage =
|
||||||
|
"Usage: calendar show types\n"
|
||||||
|
" Lists all registered calendars types.\n";
|
||||||
|
return NULL;
|
||||||
|
case CLI_GENERATE:
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
ast_cli(a->fd, FORMAT, "Type", "Description");
|
||||||
|
AST_LIST_LOCK(&techs);
|
||||||
|
AST_LIST_TRAVERSE(&techs, iter, list) {
|
||||||
|
ast_cli(a->fd, FORMAT, iter->type, iter->description);
|
||||||
|
}
|
||||||
|
AST_LIST_UNLOCK(&techs);
|
||||||
|
|
||||||
|
return CLI_SUCCESS;
|
||||||
|
#undef FORMAT
|
||||||
|
}
|
||||||
|
|
||||||
static char *epoch_to_string(char *buf, size_t buflen, time_t epoch)
|
static char *epoch_to_string(char *buf, size_t buflen, time_t epoch)
|
||||||
{
|
{
|
||||||
struct ast_tm tm;
|
struct ast_tm tm;
|
||||||
@@ -1599,6 +1628,7 @@ static struct ast_cli_entry calendar_cli[] = {
|
|||||||
AST_CLI_DEFINE(handle_show_calendar, "Display information about a calendar"),
|
AST_CLI_DEFINE(handle_show_calendar, "Display information about a calendar"),
|
||||||
AST_CLI_DEFINE(handle_show_calendars, "Show registered calendars"),
|
AST_CLI_DEFINE(handle_show_calendars, "Show registered calendars"),
|
||||||
AST_CLI_DEFINE(handle_dump_sched, "Dump calendar sched context"),
|
AST_CLI_DEFINE(handle_dump_sched, "Dump calendar sched context"),
|
||||||
|
AST_CLI_DEFINE(handle_show_calendars_types, "Show all calendar types loaded"),
|
||||||
};
|
};
|
||||||
|
|
||||||
static int calendar_event_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
|
static int calendar_event_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
|
||||||
|
Reference in New Issue
Block a user