diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-06-19 19:22:59 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-06-19 19:22:59 +0000 |
commit | 2b0a9dd2871f223ea4bfa61b11c22186504a245f (patch) | |
tree | 1f4e38d60db7b223c27b26a33441c3cd88e0c921 /pbx | |
parent | 0353af4a86dd151c5a9addbbdda6339631df7d88 (diff) |
Allow alternative extensions to be specified for a user.
(closes issue #12830)
Reported by: jcollie
Patches:
astertisk-trunk-121496-alternate-extensions.patch uploaded by jcollie (license 412)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@124049 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx')
-rw-r--r-- | pbx/pbx_config.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/pbx/pbx_config.c b/pbx/pbx_config.c index dddd8ef5c..9d482f6b5 100644 --- a/pbx/pbx_config.c +++ b/pbx/pbx_config.c @@ -1549,10 +1549,11 @@ static void pbx_load_users(void) struct ast_config *cfg; char *cat, *chan; const char *dahdichan; - const char *hasexten; + const char *hasexten, *altexts; char tmp[256]; char iface[256]; char dahdicopy[256]; + char *ext, altcopy[256]; char *c; int len; int hasvoicemail; @@ -1643,6 +1644,17 @@ static void pbx_load_users(void) } else { 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); |