res_parking: Dynamic Parking Lots

(closes issue ASTERISK-21644)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/2615/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393197 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Jonathan Rose
2013-06-28 19:22:16 +00:00
parent 84395ff042
commit 50ff1f5fc1
5 changed files with 229 additions and 25 deletions

View File

@@ -66,6 +66,7 @@ static void display_parking_lot(struct parking_lot *lot, int fd)
ast_cli(fd, "Comeback Dial Time : %u sec\n", lot->cfg->comebackdialtime);
ast_cli(fd, "MusicOnHold Class : %s\n", lot->cfg->mohclass);
ast_cli(fd, "Enabled : %s\n", (lot->mode == PARKINGLOT_DISABLED) ? "no" : "yes");
ast_cli(fd, "Dynamic : %s\n", (lot->mode == PARKINGLOT_DYNAMIC) ? "yes" : "no");
ast_cli(fd, "\n");
}
@@ -102,6 +103,14 @@ static void cli_display_parking_lot(int fd, const char *name)
ast_cli(fd, "\n");
}
static void cli_display_parking_global(int fd)
{
ast_cli(fd, "Parking General Options\n"
"-----------------------\n");
ast_cli(fd, "Dynamic Parking : %s\n", parking_dynamic_lots_enabled() ? "yes" : "no");
ast_cli(fd, "\n");
}
static void cli_display_parking_lot_list(int fd)
{
struct ao2_container *lot_container;
@@ -172,6 +181,7 @@ static char *handle_show_parking_lot_cmd(struct ast_cli_entry *e, int cmd, struc
ast_cli(a->fd, "\n");
if (a->argc == 2) {
cli_display_parking_global(a->fd);
cli_display_parking_lot_list(a->fd);
return CLI_SUCCESS;
}