aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-07-26 16:29:56 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-07-26 16:29:56 +0000
commit877efbde9443463e5d78e45466e4b33397a3bb80 (patch)
treee3deab1ad694a103d0608d32d99ce9bc1d7b3516
parent8b68883587fd0b1a63b7378009fcca431c6fc641 (diff)
add a global option to disable priority jumping in applications (when they get updated), settable in extensions.conf
change app_dial to use 'j' to _ENABLE_ priority jumping if it has been globally disabled git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6224 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-xapps/app_dial.c15
-rwxr-xr-xasterisk.c1
-rwxr-xr-xconfigs/extensions.conf.sample8
-rwxr-xr-xinclude/asterisk/options.h1
-rwxr-xr-xpbx/pbx_config.c12
5 files changed, 23 insertions, 14 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index b07f9990e..f56f08907 100755
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -120,7 +120,7 @@ static char *descrip =
" * LIMIT_WARNING_FILE File to play as warning if 'y' is defined.\n"
" 'timeleft' is a special sound macro to auto-say the time \n"
" left and is the default.\n"
-" 'j' -- Do not jump to n+101 if all of the channels were busy.\n\n"
+" 'j' -- Jump to n+101 if all of the channels were busy.\n\n"
" In addition to transferring the call, a call may be parked and then picked\n"
"up by another user.\n"
" The optional URL will be sent to the called party if the channel supports it.\n"
@@ -271,7 +271,7 @@ static void senddialevent(struct ast_channel *src, struct ast_channel *dst)
dst->uniqueid);
}
-static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localuser *outgoing, int *to, struct ast_flags *peerflags, int *sentringing, char *status, size_t statussize, int busystart, int nochanstart, int congestionstart, int nojump, int *result)
+static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localuser *outgoing, int *to, struct ast_flags *peerflags, int *sentringing, char *status, size_t statussize, int busystart, int nochanstart, int congestionstart, int priority_jump, int *result)
{
struct localuser *o;
int found;
@@ -326,9 +326,8 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu
strcpy(status, "CONGESTION");
else if (numnochan)
strcpy(status, "CHANUNAVAIL");
- /* See if there is a special busy message */
- if (!nojump && ast_exists_extension(in, in->context, in->exten, in->priority + 101, in->cid.cid_num))
- in->priority+=100;
+ if (option_priority_jumping || priority_jump)
+ ast_goto_if_exists(in, in->context, in->exten, in->priority + 101);
} else {
if (option_verbose > 2)
ast_verbose( VERBOSE_PREFIX_2 "No one is available to answer at this time (%d:%d/%d/%d)\n", numlines, numbusy, numcongestion, numnochan);
@@ -670,7 +669,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
time_t start_time, answer_time, end_time;
struct ast_app *app = NULL;
char *dblgoto = NULL;
- int nojump = 0;
+ int priority_jump = 0;
if (!data) {
ast_log(LOG_WARNING, "Dial requires an argument (technology1/number1&technology2/number2...|optional timeout|options)\n");
@@ -925,7 +924,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
} else if (strchr(transfer, 'C')) {
resetcdr = 1;
} else if (strchr(transfer, 'j')) {
- nojump = 1;
+ priority_jump = 1;
}
if (strchr(transfer, 'n')) {
no_save_intros = 1;
@@ -1238,7 +1237,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
strcpy(status, "CHANUNAVAIL");
time(&start_time);
- peer = wait_for_answer(chan, outgoing, &to, peerflags, &sentringing, status, sizeof(status), numbusy, numnochan, numcongestion, nojump, &result);
+ peer = wait_for_answer(chan, outgoing, &to, peerflags, &sentringing, status, sizeof(status), numbusy, numnochan, numcongestion, priority_jump, &result);
if (!peer) {
if (result) {
diff --git a/asterisk.c b/asterisk.c
index 478446e2c..aaad989ff 100755
--- a/asterisk.c
+++ b/asterisk.c
@@ -100,6 +100,7 @@ int option_reconnect = 0;
int option_transcode_slin = 1;
int option_maxcalls = 0;
int option_dontwarn = 0;
+int option_priority_jumping = 1;
int fully_booted = 0;
char record_cache_dir[AST_CACHE_DIR_LEN] = AST_TMP_DIR;
char debug_filename[AST_FILENAME_MAX] = "";
diff --git a/configs/extensions.conf.sample b/configs/extensions.conf.sample
index af7bee672..d106b5be0 100755
--- a/configs/extensions.conf.sample
+++ b/configs/extensions.conf.sample
@@ -44,6 +44,14 @@ autofallthrough=yes
;
clearglobalvars=no
;
+; If priorityjumping is set to 'yes', then applications that support
+; 'jumping' to a different priority based on the result of their operations
+; will do so (this is backwards compatible behavior with pre-1.2 releases
+; of Asterisk). Individual applications can also be requested to do this
+; by passing a 'j' option in their arguments.
+;
+priorityjumping=no
+;
; You can include other config files, use the #include command (without the ';')
; Note that this is different from the "include" command that includes contexts within
; other contexts. The #include command works in all asterisk configuration files.
diff --git a/include/asterisk/options.h b/include/asterisk/options.h
index 083b0c474..6e2863667 100755
--- a/include/asterisk/options.h
+++ b/include/asterisk/options.h
@@ -35,6 +35,7 @@ extern int option_timestamp;
extern int option_transcode_slin;
extern int option_maxcalls;
extern int option_dontwarn;
+extern int option_priority_jumping;
extern char defaultlanguage[];
extern time_t ast_startuptime;
extern time_t ast_lastreloadtime;
diff --git a/pbx/pbx_config.c b/pbx/pbx_config.c
index 69b66d5c2..f15715ba5 100755
--- a/pbx/pbx_config.c
+++ b/pbx/pbx_config.c
@@ -1633,15 +1633,15 @@ static int pbx_load_module(void)
if (cfg) {
/* Use existing config to populate the PBX table */
static_config = ast_true(ast_variable_retrieve(cfg, "general",
- "static"));
+ "static"));
write_protect_config = ast_true(ast_variable_retrieve(cfg, "general",
- "writeprotect"));
-
+ "writeprotect"));
autofallthrough_config = ast_true(ast_variable_retrieve(cfg, "general",
- "autofallthrough"));
-
+ "autofallthrough"));
clearglobalvars_config = ast_true(ast_variable_retrieve(cfg, "general",
- "clearglobalvars"));
+ "clearglobalvars"));
+ option_priority_jumping = ast_true(ast_variable_retrieve(cfg, "general",
+ "priorityjumping"));
v = ast_variable_browse(cfg, "globals");
while(v) {