41 ast_cli(fd,
" Channel : %s\n", ast_channel_name(user->
chan));
46 static int display_parked_users_cb(
void *obj,
void *arg,
int flags)
50 display_parked_call(user, *fd);
56 ast_cli(fd,
"Parking Lot: %s\n--------------------------------------------------------------------------\n", lot->
name);
57 ast_cli(fd,
"Parking Extension : %s\n", lot->
cfg->
parkext);
64 ast_cli(fd,
"MusicOnHold Class : %s\n", lot->
cfg->
mohclass);
70 static int display_parking_lot_cb(
void *obj,
void *arg,
int flags)
74 display_parking_lot(lot, *fd);
78 static void cli_display_parking_lot(
int fd,
const char *
name)
85 ast_cli(fd,
"Could not find parking lot '%s'\n\n", name);
89 display_parking_lot(lot, fd);
91 ast_cli(fd,
"Parked Calls\n------------\n");
94 ast_cli(fd,
" (none)\n");
103 static void cli_display_parking_global(
int fd)
105 ast_cli(fd,
"Parking General Options\n"
106 "-----------------------\n");
111 static void cli_display_parking_lot_list(
int fd)
117 if (!lot_container) {
118 ast_cli(fd,
"Failed to obtain parking lot list.\n\n");
131 static int complete_parking_lot_search(
void *obj,
void *arg,
void *data,
int flags)
134 if (++search->
which > search->seeking) {
140 static char *complete_parking_lot(
const char *word,
int seeking)
149 lot = ao2_callback_data(global_lots, ast_strlen_zero(word) ? 0 :
OBJ_PARTIAL_KEY,
150 complete_parking_lot_search, (
char *) word, &search);
168 "Usage: parking show [name]\n"
169 " Shows a list of parking lots or details of a specific parking lot.";
173 return complete_parking_lot(a->word, a->n);
178 ast_cli(a->fd,
"\n");
181 cli_display_parking_global(a->fd);
182 cli_display_parking_lot_list(a->fd);
187 cli_display_parking_lot(a->fd, a->argv[2]);
191 return CLI_SHOWUSAGE;
Asterisk main include file. File version handling, generic pbx functions.
unsigned int comebackdialtime
int ao2_container_count(struct ao2_container *c)
Returns the number of elements in a container.
int ast_cli_unregister_multiple(struct ast_cli_entry *e, int len)
Unregister multiple commands.
void unload_parking_ui(void)
Unregister CLI commands.
descriptor for a cli entry.
struct ao2_container * parked_users
#define ao2_callback(c, flags, cb_fn, arg)
ao2_callback() is a generic function that applies cb_fn() to all objects in a container, as described below.
#define ast_cli_register_multiple(e, len)
Register multiple commands.
const ast_string_field comebackcontext
int load_parking_ui(void)
Register CLI commands.
#define ast_strdup(str)
A wrapper for strdup()
struct ao2_container * get_parking_lot_container(void)
Get a pointer to the parking lot container for purposes such as iteration.
Configuration File Parser.
int parking_dynamic_lots_enabled(void)
Check global configuration to see if dynamic parking is enabled.
const ast_string_field parking_con
char * parker_dial_string
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
unsigned int comebacktoorigin
The AMI - Asterisk Manager Interface - is a TCP protocol created to manage Asterisk with third-party ...
Configuration option-handling.
const ast_string_field name
structure to hold users read from users.conf
enum parking_lot_modes mode
Standard Command Line Interface.
static char * handle_show_parking_lot_cmd(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
command parking show
const ast_string_field parkext
const ast_string_field mohclass
struct parking_lot * parking_lot_find_by_name(const char *lot_name)
Find a parking lot based on its name.
Call Parking Resource Internal API.
Call Parking and Pickup API Includes code and algorithms from the Zapata library. ...
Asterisk module definitions.
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
struct ast_channel * chan
struct parking_lot_cfg * cfg