Index: apps/app_meetme.c =================================================================== --- apps/app_meetme.c (revision 154965) +++ apps/app_meetme.c (working copy) @@ -3843,6 +3843,75 @@ return meetmemute(s, m, 0); } +static char mandescr_meetmelistrooms[] = +"Description: Lists all MeetMe conference rooms.\n" +"MeetmeListRooms will follow as separate events, followed by a final event called\n" +"MeetmeListRoomsComplete.\n" +"Variables:\n" +" *ActionId: \n"; + +static int action_meetmelistrooms(struct mansession *s, const struct message *m) +{ + /* caio1982 */ + struct ast_config *cfg; + struct ast_variable *var; + struct ast_flags config_flags = { 0 }; + char *parse; + AST_DECLARE_APP_ARGS(args, + AST_APP_ARG(confno); + AST_APP_ARG(pin); + AST_APP_ARG(pinadmin); + ); + + const char *actionid = astman_get_header(m, "ActionID"); + char idText[80] = ""; + int total = 0; + + ast_log(LOG_NOTICE, "AMI action MeetmeListRooms requires parsing meetme.conf\n"); + cfg = ast_config_load(CONFIG_FILE_NAME, config_flags); + + if (cfg) { + if (!ast_strlen_zero(actionid)) { + snprintf(idText, sizeof(idText), "ActionID: %s\r\n", actionid); + } + + astman_send_listack(s, m, "Meetme rooms list will follow", "start"); + + for (var = ast_variable_browse(cfg, "rooms"); var; var = var->next) { + if (strcasecmp(var->name, "conf")) { + continue; + } + + parse = ast_strdupa(var->value); + AST_STANDARD_APP_ARGS(args, parse); + + if (args.confno) { + total++; + astman_append(s, + "Event: MeetmeListRooms\r\n" + "%s" + "Room: %s\r\n" + "PIN: %s\r\n" + "PINAdmin: %s\r\n" + "\r\n", + idText, + args.confno, + S_OR(args.pin, ""), + S_OR(args.pinadmin, "")); + } + } + } + ast_config_destroy(cfg); + + astman_append(s, + "Event: MeetmeListRoomsComplete\r\n" + "EventList: Complete\r\n" + "ListItems: %d\r\n" + "%s" + "\r\n", total, idText); + return 0; +} + static char mandescr_meetmelist[] = "Description: Lists all users in a particular MeetMe conference.\n" "MeetmeList will follow as separate events, followed by a final event called\n" @@ -6025,6 +6094,8 @@ action_meetmeunmute, "Unmute a Meetme user"); res |= ast_manager_register2("MeetmeList", EVENT_FLAG_REPORTING, action_meetmelist, "List participants in a conference", mandescr_meetmelist); + res |= ast_manager_register2("MeetmeListRooms", EVENT_FLAG_REPORTING, + action_meetmelistrooms, "List all conference rooms", mandescr_meetmelistrooms); res |= ast_register_application(app4, channel_admin_exec, synopsis4, descrip4); res |= ast_register_application(app3, admin_exec, synopsis3, descrip3); res |= ast_register_application(app2, count_exec, synopsis2, descrip2); Index: doc/manager_1_1.txt =================================================================== --- doc/manager_1_1.txt (revision 154226) +++ doc/manager_1_1.txt (working copy) @@ -202,6 +202,19 @@ Variables: ActionId: Action ID for this transaction. Will be returned. +- Action: MeetmeListRooms + Modules: app_meetme + Purpose: + To request that the manager send a list of all MeetMe rooms configured in meetme.conf, not only active ones. + Variables: + ActionId: Action ID for this transaction. Will be returned. + Example: + Event: MeetmeListRooms + Room: 12345 + PIN: 12345 + PINAdmin: 54321 + If an ActionID was specified for the MeetmeListRooms action, it will be appended before every Room line. + * NEW EVENTS ------------ Index: CHANGES =================================================================== --- CHANGES (revision 154226) +++ CHANGES (working copy) @@ -56,6 +56,11 @@ * musiconhold.conf classes of type 'files' can now use relative directory paths, which are interpreted as relative to the astvarlibdir setting in asterisk.conf. +AMI - The manager (TCP/TLS/HTTP) +-------------------------------- + * Added a new action called MeetmeListRooms which returns all conference room + numbers, PIN and admin PIN. + ------------------------------------------------------------------------------ --- Functionality changes from Asterisk 1.6.0 to Asterisk 1.6.1 ------------- ------------------------------------------------------------------------------