[svn-commits] tilghman: trunk r124049 - in /trunk: ./ configs/ pbx/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Jun 19 14:23:00 CDT 2008


Author: tilghman
Date: Thu Jun 19 14:22:59 2008
New Revision: 124049

URL: http://svn.digium.com/view/asterisk?view=rev&rev=124049
Log:
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)

Modified:
    trunk/CHANGES
    trunk/configs/users.conf.sample
    trunk/pbx/pbx_config.c

Modified: trunk/CHANGES
URL: http://svn.digium.com/view/asterisk/trunk/CHANGES?view=diff&rev=124049&r1=124048&r2=124049
==============================================================================
--- trunk/CHANGES (original)
+++ trunk/CHANGES Thu Jun 19 14:22:59 2008
@@ -785,3 +785,5 @@
   * If compiled with DEBUG_THREADS enabled and if you have glibc, then issuing
      the "core show locks" CLI command will give lock information output as well
      as a backtrace of the stack which led to the lock calls.
+  * users.conf now sports an optional alternativeexts property, which permits
+    allocation of additional extensions which will reach the specified user.

Modified: trunk/configs/users.conf.sample
URL: http://svn.digium.com/view/asterisk/trunk/configs/users.conf.sample?view=diff&rev=124049&r1=124048&r2=124049
==============================================================================
--- trunk/configs/users.conf.sample (original)
+++ trunk/configs/users.conf.sample Thu Jun 19 14:22:59 2008
@@ -77,3 +77,9 @@
 ;hasmanager = no
 ;callwaiting = no
 ;context = international
+;
+; Some administrators choose alphanumeric extensions, but still want their
+; users to be reachable by traditional numeric extensions, specified by the
+; alternateexts entry.
+;
+;alternateexts = 7057,3249

Modified: trunk/pbx/pbx_config.c
URL: http://svn.digium.com/view/asterisk/trunk/pbx/pbx_config.c?view=diff&rev=124049&r1=124048&r2=124049
==============================================================================
--- trunk/pbx/pbx_config.c (original)
+++ trunk/pbx/pbx_config.c Thu Jun 19 14:22:59 2008
@@ -1549,10 +1549,11 @@
 	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 @@
 			} 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);




More information about the svn-commits mailing list