--- app_directory.c.cvs 2005-04-05 16:13:18.748457652 -0500 +++ app_directory.c.mh720 2005-04-05 17:59:49.151815841 -0500 @@ -220,6 +220,7 @@ struct ast_category *cat = NULL; char fullname[50] = ""; char mailbox[50] = ""; + char *hidefromdir = ""; char tmp[100] = ""; int havename = 0; int havemailbox = 0; @@ -257,21 +258,27 @@ /* 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"; } - /* 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 && !ast_strlen_zero(hidefromdir)) { + sprintf(tmp, "%s,%s%s", mailbox, fullname, hidefromdir); ast_variable_append(cat, ast_variable_new(mailbox, tmp)); havemailbox = 0; havename = 0; - } + hidefromdir = ""; + } rtvar = rtvar->next; } @@ -336,7 +343,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, ",");