mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-30 10:33:13 +00:00
Add keyword "same", which allows you to create multiple steps in a dialplan,
without needing to respecify an extension pattern multiple times. (closes issue #13632) Reported by: blitzrage Patches: 20081006__bug13632.diff.txt uploaded by Corydon76 (license 14) Tested by: blitzrage, Corydon76 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@148325 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
5
CHANGES
5
CHANGES
@@ -28,6 +28,11 @@ Miscellaneous
|
|||||||
* res_jabber: autoprune has been disabled by default, to avoid misconfiguration
|
* res_jabber: autoprune has been disabled by default, to avoid misconfiguration
|
||||||
that would end up being interpreted as a bug once Asterisk started removing
|
that would end up being interpreted as a bug once Asterisk started removing
|
||||||
the contacts from a user list.
|
the contacts from a user list.
|
||||||
|
* extensions.conf now allows you to use keyword "same" to define an extension
|
||||||
|
without actually specifying an extension. It uses exactly the same pattern
|
||||||
|
as previously used on the last "exten" line. For example:
|
||||||
|
exten => 123,1,NoOp(something)
|
||||||
|
same => n,SomethingElse()
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
--- Functionality changes from Asterisk 1.6.0 to Asterisk 1.6.1 -------------
|
--- Functionality changes from Asterisk 1.6.0 to Asterisk 1.6.1 -------------
|
||||||
|
@@ -1410,6 +1410,7 @@ static int pbx_load_config(const char *config_file)
|
|||||||
const char *aft;
|
const char *aft;
|
||||||
const char *newpm, *ovsw;
|
const char *newpm, *ovsw;
|
||||||
struct ast_flags config_flags = { 0 };
|
struct ast_flags config_flags = { 0 };
|
||||||
|
char lastextension[256] = "";
|
||||||
cfg = ast_config_load(config_file, config_flags);
|
cfg = ast_config_load(config_file, config_flags);
|
||||||
if (!cfg)
|
if (!cfg)
|
||||||
return 0;
|
return 0;
|
||||||
@@ -1451,18 +1452,26 @@ static int pbx_load_config(const char *config_file)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
for (v = ast_variable_browse(cfg, cxt); v; v = v->next) {
|
for (v = ast_variable_browse(cfg, cxt); v; v = v->next) {
|
||||||
if (!strcasecmp(v->name, "exten")) {
|
char *tc = NULL;
|
||||||
char *tc = ast_strdup(v->value);
|
|
||||||
if (tc) {
|
|
||||||
int ipri = -2;
|
|
||||||
char realext[256] = "";
|
char realext[256] = "";
|
||||||
|
char *stringp, *ext;
|
||||||
|
if (!strncasecmp(v->name, "same", 4)) {
|
||||||
|
if ((stringp = tc = ast_strdup(v->value))) {
|
||||||
|
ast_copy_string(realext, lastextension, sizeof(realext));
|
||||||
|
goto copy_last_extension;
|
||||||
|
}
|
||||||
|
} else if (!strcasecmp(v->name, "exten")) {
|
||||||
|
if ((tc = ast_strdup(v->value))) {
|
||||||
|
int ipri = -2;
|
||||||
char *plus, *firstp;
|
char *plus, *firstp;
|
||||||
char *pri, *appl, *data, *cidmatch;
|
char *pri, *appl, *data, *cidmatch;
|
||||||
char *stringp = tc;
|
stringp = tc;
|
||||||
char *ext = strsep(&stringp, ",");
|
if (!(ext = strsep(&stringp, ","))) {
|
||||||
if (!ext)
|
|
||||||
ext = "";
|
ext = "";
|
||||||
|
}
|
||||||
pbx_substitute_variables_helper(NULL, ext, realext, sizeof(realext) - 1);
|
pbx_substitute_variables_helper(NULL, ext, realext, sizeof(realext) - 1);
|
||||||
|
ast_copy_string(lastextension, realext, sizeof(lastextension));
|
||||||
|
copy_last_extension:
|
||||||
cidmatch = strchr(realext, '/');
|
cidmatch = strchr(realext, '/');
|
||||||
if (cidmatch) {
|
if (cidmatch) {
|
||||||
*cidmatch++ = '\0';
|
*cidmatch++ = '\0';
|
||||||
|
Reference in New Issue
Block a user