[asterisk-commits] dvossel: branch dvossel/hd_confbridge r309253 - /team/dvossel/hd_confbridge/a...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Mar 2 13:19:53 CST 2011
Author: dvossel
Date: Wed Mar 2 13:19:49 2011
New Revision: 309253
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=309253
Log:
Initial user profile options
Modified:
team/dvossel/hd_confbridge/apps/confbridge/conf_config_parser.c
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=309253&r1=309252&r2=309253
==============================================================================
--- team/dvossel/hd_confbridge/apps/confbridge/conf_config_parser.c (original)
+++ team/dvossel/hd_confbridge/apps/confbridge/conf_config_parser.c Wed Mar 2 13:19:49 2011
@@ -182,10 +182,23 @@
ao2_lock(u_profile);
/* set defaults */
- //todohere put default settings
+ u_profile->flags = 0;
+ u_profile->volume = 0;
for (var = ast_variable_browse(cfg, cat); var; var = var->next) {
if (!strcasecmp(var->name, "type")) {
continue;
+ } else if (!strcasecmp(var->name, "admin")) {
+ u_profile->flags = ast_true(var->name) ?
+ 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 | 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 | USER_OPT_STARTMUTED :
+ u_profile->flags & ~USER_OPT_STARTMUTED;
} else {
ast_log(LOG_WARNING, "Unknown option '%s' at line %d of %s is not supported.\n",
var->name, var->lineno, CONF_CONFIG);
@@ -278,7 +291,18 @@
return CLI_SUCCESS;
}
- ast_cli(a->fd,"Name: %s\n", u_profile->name);
+ ast_cli(a->fd,"--------------------------------------------\n");
+ ast_cli(a->fd,"Name: %s\n",
+ u_profile->name);
+ ast_cli(a->fd,"Admin: %s\n",
+ u_profile->flags & USER_OPT_ADMIN ?
+ "true" : "false");
+ ast_cli(a->fd,"Marked User: %s\n",
+ u_profile->flags & USER_OPT_MARKEDUSER ?
+ "true" : "false");
+ ast_cli(a->fd,"Start Muted: %s\n",
+ u_profile->flags & USER_OPT_STARTMUTED?
+ "true" : "false");
ast_cli(a->fd,"\n");
ao2_ref((struct user_profile *) u_profile, -1);
More information about the asterisk-commits
mailing list