|
|
@ -1549,10 +1549,11 @@ static void pbx_load_users(void)
|
|
|
|
struct ast_config *cfg;
|
|
|
|
struct ast_config *cfg;
|
|
|
|
char *cat, *chan;
|
|
|
|
char *cat, *chan;
|
|
|
|
const char *dahdichan;
|
|
|
|
const char *dahdichan;
|
|
|
|
const char *hasexten;
|
|
|
|
const char *hasexten, *altexts;
|
|
|
|
char tmp[256];
|
|
|
|
char tmp[256];
|
|
|
|
char iface[256];
|
|
|
|
char iface[256];
|
|
|
|
char dahdicopy[256];
|
|
|
|
char dahdicopy[256];
|
|
|
|
|
|
|
|
char *ext, altcopy[256];
|
|
|
|
char *c;
|
|
|
|
char *c;
|
|
|
|
int len;
|
|
|
|
int len;
|
|
|
|
int hasvoicemail;
|
|
|
|
int hasvoicemail;
|
|
|
@ -1643,6 +1644,17 @@ static void pbx_load_users(void)
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
ast_add_extension2(con, 0, cat, 1, NULL, NULL, "Dial", strdup("${HINT}"), ast_free_ptr, registrar);
|
|
|
|
ast_add_extension2(con, 0, cat, 1, NULL, NULL, "Dial", strdup("${HINT}"), ast_free_ptr, registrar);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
altexts = ast_variable_retrieve(cfg, cat, "alternateexts");
|
|
|
|
|
|
|
|
if (!ast_strlen_zero(altexts)) {
|
|
|
|
|
|
|
|
snprintf(tmp, sizeof(tmp), "%s,1", cat);
|
|
|
|
|
|
|
|
ast_copy_string(altcopy, altexts, sizeof(altcopy));
|
|
|
|
|
|
|
|
c = altcopy;
|
|
|
|
|
|
|
|
ext = strsep(&c, ",");
|
|
|
|
|
|
|
|
while (ext) {
|
|
|
|
|
|
|
|
ast_add_extension2(con, 0, ext, 1, NULL, NULL, "Goto", strdup(tmp), ast_free, registrar);
|
|
|
|
|
|
|
|
ext = strsep(&c, ",");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ast_config_destroy(cfg);
|
|
|
|
ast_config_destroy(cfg);
|
|
|
|