[asterisk-commits] dvossel: branch dvossel/hd_confbridge r309337 - in /team/dvossel/hd_confbridg...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Mar 2 17:14:23 CST 2011
Author: dvossel
Date: Wed Mar 2 17:14:20 2011
New Revision: 309337
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=309337
Log:
confbridge reload CLI function
Modified:
team/dvossel/hd_confbridge/apps/app_confbridge.c
team/dvossel/hd_confbridge/apps/confbridge/conf_config_parser.c
Modified: team/dvossel/hd_confbridge/apps/app_confbridge.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/hd_confbridge/apps/app_confbridge.c?view=diff&rev=309337&r1=309336&r2=309337
==============================================================================
--- team/dvossel/hd_confbridge/apps/app_confbridge.c (original)
+++ team/dvossel/hd_confbridge/apps/app_confbridge.c Wed Mar 2 17:14:20 2011
@@ -353,7 +353,7 @@
/* Setup conference bridge parameters */
ast_copy_string(conference_bridge->name, name, sizeof(conference_bridge->name));
- memcpy(&conference_bridge->b_profile, &conference_bridge_user->u_profile, sizeof(conference_bridge->b_profile));
+ memcpy(&conference_bridge->b_profile, &conference_bridge_user->b_profile, sizeof(conference_bridge->b_profile));
/* Create an actual bridge that will do the audio mixing */
if (!(conference_bridge->bridge = ast_bridge_new(AST_BRIDGE_CAPABILITY_1TO1MIX, AST_BRIDGE_FLAG_SMART))) {
@@ -573,11 +573,13 @@
b_profile_name = args.b_profile_name;
}
conf_find_bridge_profile(b_profile_name, &conference_bridge_user.b_profile);
+
/* user profile name */
if (args.argc > 2 && !ast_strlen_zero(args.u_profile_name)) {
u_profile_name = args.u_profile_name;
}
conf_find_user_profile(u_profile_name, &conference_bridge_user.u_profile);
+
/* menu name */
if (args.argc > 3 && !ast_strlen_zero(args.menu_name)) {
menu_name = args.menu_name;
@@ -770,12 +772,14 @@
ast_cli(a->fd, "No conference bridge named '%s' found!\n", a->argv[2]);
return CLI_SUCCESS;
}
- ast_cli(a->fd, "Channel Flags\n");
- ast_cli(a->fd, "================================ ================\n");
+ ast_cli(a->fd, "Channel User Profile Bridge Profile Menu\n");
+ ast_cli(a->fd, "============================= ================ ================ ================\n");
ao2_lock(bridge);
AST_LIST_TRAVERSE(&bridge->users_list, participant, list) {
- ast_cli(a->fd, "%-32s ", participant->chan->name);
- //todohere tell more about each channel in the bridge
+ ast_cli(a->fd, "%-29s ", participant->chan->name);
+ ast_cli(a->fd, "%-17s", participant->u_profile.name);
+ ast_cli(a->fd, "%-17s", participant->b_profile.name);
+ ast_cli(a->fd, "%-17s", participant->dtmf_menu.name);
ast_cli(a->fd, "\n");
}
ao2_unlock(bridge);
@@ -786,9 +790,25 @@
return CLI_SHOWUSAGE;
}
+static char *handle_cli_confbridge_reload(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+{
+ switch (cmd) {
+ case CLI_INIT:
+ e->command = "confbridge reload";
+ e->usage = "Usage confbridge reload\n";
+ return NULL;
+ case CLI_GENERATE:
+ return NULL;
+ }
+
+ conf_load_config(1);
+ return CLI_SUCCESS;
+}
+
static struct ast_cli_entry cli_confbridge[] = {
AST_CLI_DEFINE(handle_cli_confbridge_list, "List conference bridges and participants."),
- AST_CLI_DEFINE(handle_cli_confbridge_kick, "Kick participants out of conference bridges.")
+ AST_CLI_DEFINE(handle_cli_confbridge_kick, "Kick participants out of conference bridges."),
+ AST_CLI_DEFINE(handle_cli_confbridge_reload, "Reload confbridge.conf configuration file."),
};
/*! \brief Called when module is being unloaded */
Modified: team/dvossel/hd_confbridge/apps/confbridge/conf_config_parser.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/hd_confbridge/apps/confbridge/conf_config_parser.c?view=diff&rev=309337&r1=309336&r2=309337
==============================================================================
--- team/dvossel/hd_confbridge/apps/confbridge/conf_config_parser.c (original)
+++ team/dvossel/hd_confbridge/apps/confbridge/conf_config_parser.c Wed Mar 2 17:14:20 2011
@@ -176,15 +176,15 @@
if (!strcasecmp(var->name, "type")) {
continue;
} else if (!strcasecmp(var->name, "admin")) {
- u_profile->flags = ast_true(var->name) ?
+ u_profile->flags = ast_true(var->value) ?
u_profile->flags | USER_OPT_ADMIN :
u_profile->flags & ~USER_OPT_ADMIN;
} else if (!strcasecmp(var->name, "marked")) {
- u_profile->flags = ast_true(var->name) ?
+ u_profile->flags = ast_true(var->value) ?
u_profile->flags | USER_OPT_MARKEDUSER :
u_profile->flags & ~USER_OPT_MARKEDUSER;
} else if (!strcasecmp(var->name, "startmuted")) {
- u_profile->flags = ast_true(var->name) ?
+ u_profile->flags = ast_true(var->value) ?
u_profile->flags | USER_OPT_STARTMUTED :
u_profile->flags & ~USER_OPT_STARTMUTED;
} else if (!strcasecmp(var->name, "music_on_hold_when_empty")) {
@@ -292,24 +292,24 @@
}
ast_cli(a->fd,"--------------------------------------------\n");
- ast_cli(a->fd,"Name: %s\n",
+ ast_cli(a->fd,"Name: %s\n",
u_profile.name);
- ast_cli(a->fd,"Admin: %s\n",
+ ast_cli(a->fd,"Admin: %s\n",
u_profile.flags & USER_OPT_ADMIN ?
"true" : "false");
- ast_cli(a->fd,"Marked User: %s\n",
+ ast_cli(a->fd,"Marked User: %s\n",
u_profile.flags & USER_OPT_MARKEDUSER ?
"true" : "false");
- ast_cli(a->fd,"Start Muted: %s\n",
+ ast_cli(a->fd,"Start Muted: %s\n",
u_profile.flags & USER_OPT_STARTMUTED?
"true" : "false");
- ast_cli(a->fd,"MOH When Empty: %s\n",
+ ast_cli(a->fd,"MOH When Empty: %s\n",
u_profile.flags & USER_OPT_MUSICONHOLD ?
"enabled" : "disabled");
- ast_cli(a->fd,"Quiet: %s\n",
+ ast_cli(a->fd,"Quiet: %s\n",
u_profile.flags & USER_OPT_QUIET ?
"enabled" : "disabled");
- ast_cli(a->fd,"Announce User Count: %s\n",
+ ast_cli(a->fd,"Announce User Count: %s\n",
u_profile.flags & USER_OPT_ANNOUNCEUSERCOUNT ?
"enabled" : "disabled");
ast_cli(a->fd,"\n");
More information about the asterisk-commits
mailing list