--- app_directory.c.cvs 2005-04-05 16:13:18.748457652 -0500 +++ app_directory.c.mh720 2005-04-05 16:12:55.086587383 -0500 @@ -220,9 +220,11 @@ struct ast_category *cat = NULL; char fullname[50] = ""; char mailbox[50] = ""; + char *hidefromdir = ""; char tmp[100] = ""; int havename = 0; int havemailbox = 0; + int haveopts = 0; /* Load flat file config. */ cfg = ast_config_load(DIRECTORY_CONFIG); @@ -257,21 +259,29 @@ /* We now have a category: from the Flatfile or freshly created. */ while (rtvar) { + if (!strcasecmp(rtvar->name, "fullname")) { strncpy(fullname, rtvar->value, sizeof(fullname)-1); havename = 1; } else if (!strcasecmp(rtvar->name, "mailbox")) { strncpy(mailbox, rtvar->value, sizeof(mailbox)-1); havemailbox = 1; + } else if (!strcasecmp(rtvar->name, "hidefromdir")) { + if (ast_true(rtvar->value)) + hidefromdir = "hidefromdir=yes"; + else + hidefromdir = "hidefromdir=no"; + + haveopts = 1; } - /* app_directory needs only mailbox and fullname. Fill password and email with dummy values. */ - if (havemailbox && havename) { - sprintf(tmp, "9999,%s,email@email.com", fullname); + if (havemailbox && havename && haveopts) { + sprintf(tmp, "%s,%s,%s", mailbox, fullname, hidefromdir); ast_variable_append(cat, ast_variable_new(mailbox, tmp)); havemailbox = 0; havename = 0; - } + haveopts = 0; + } rtvar = rtvar->next; } @@ -336,7 +346,7 @@ while(v) { /* Find a candidate extension */ start = strdup(v->value); - if (start) { + if (start && !strstr(start, "hidefromdir=yes")) { stringp=start; strsep(&stringp, ","); pos = strsep(&stringp, ",");