summaryrefslogtreecommitdiff
path: root/apps/app_directory.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/app_directory.c')
-rw-r--r--apps/app_directory.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/apps/app_directory.c b/apps/app_directory.c
index 642b9b23a..dd80c3467 100644
--- a/apps/app_directory.c
+++ b/apps/app_directory.c
@@ -464,7 +464,7 @@ static struct ast_config *realtime_directory(char *context)
struct ast_config *rtdata = NULL;
struct ast_category *cat;
struct ast_variable *var;
- char *mailbox;
+ char *category = NULL;
const char *fullname;
const char *hidefromdir, *searchcontexts = NULL;
struct ast_flags config_flags = { 0 };
@@ -505,13 +505,12 @@ static struct ast_config *realtime_directory(char *context)
return cfg;
}
- mailbox = NULL;
- while ( (mailbox = ast_category_browse(rtdata, mailbox)) ) {
- struct ast_variable *alias;
- const char *ctx = ast_variable_retrieve(rtdata, mailbox, "context");
+ while ((category = ast_category_browse(rtdata, category))) {
+ const char *mailbox = ast_variable_retrieve(rtdata, category, "mailbox");
+ const char *ctx = ast_variable_retrieve(rtdata, category, "context");
- fullname = ast_variable_retrieve(rtdata, mailbox, "fullname");
- hidefromdir = ast_variable_retrieve(rtdata, mailbox, "hidefromdir");
+ fullname = ast_variable_retrieve(rtdata, category, "fullname");
+ hidefromdir = ast_variable_retrieve(rtdata, category, "hidefromdir");
if (ast_true(hidefromdir)) {
/* Skip hidden */
continue;
@@ -519,8 +518,9 @@ static struct ast_config *realtime_directory(char *context)
/* password,Full Name,email,pager,options */
ast_str_set(&tmp, 0, "no-password,%s,,,", S_OR(fullname, ""));
- if (ast_variable_retrieve(rtdata, mailbox, "alias")) {
- for (alias = ast_variable_browse(rtdata, mailbox); alias; alias = alias->next) {
+ if (ast_variable_retrieve(rtdata, category, "alias")) {
+ struct ast_variable *alias;
+ for (alias = ast_variable_browse(rtdata, category); alias; alias = alias->next) {
if (!strcasecmp(alias->name, "alias")) {
ast_str_append(&tmp, 0, "|alias=%s", alias->value);
}