Skip to content
Snippets Groups Projects
Commit b5c7781d authored by Mark Spencer's avatar Mark Spencer
Browse files

Add 'n' option to dial for "nojump" (bug #4034)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5468 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 7bffc045
Branches
Tags
No related merge requests found
...@@ -106,7 +106,8 @@ static char *descrip = ...@@ -106,7 +106,8 @@ static char *descrip =
" * LIMIT_CONNECT_FILE File to play when call begins.\n" " * LIMIT_CONNECT_FILE File to play when call begins.\n"
" * LIMIT_WARNING_FILE File to play as warning if 'y' is defined.\n" " * 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" " 'timeleft' is a special sound macro to auto-say the time \n"
" left and is the default.\n\n" " left and is the default.\n"
" 'n' -- Do not 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" " In addition to transferring the call, a call may be parked and then picked\n"
"up by another user.\n" "up by another user.\n"
" The optional URL will be sent to the called party if the channel supports it.\n" " The optional URL will be sent to the called party if the channel supports it.\n"
...@@ -258,7 +259,7 @@ static void senddialevent(struct ast_channel *src, struct ast_channel *dst) ...@@ -258,7 +259,7 @@ static void senddialevent(struct ast_channel *src, struct ast_channel *dst)
dst->uniqueid); 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 *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 nojump, int *result)
{ {
struct localuser *o; struct localuser *o;
int found; int found;
...@@ -314,7 +315,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu ...@@ -314,7 +315,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu
else if (numnochan) else if (numnochan)
strncpy(status, "CHANUNAVAIL", statussize - 1); strncpy(status, "CHANUNAVAIL", statussize - 1);
/* See if there is a special busy message */ /* See if there is a special busy message */
if (ast_exists_extension(in, in->context, in->exten, in->priority + 101, in->cid.cid_num)) if (!nojump && ast_exists_extension(in, in->context, in->exten, in->priority + 101, in->cid.cid_num))
in->priority+=100; in->priority+=100;
} else { } else {
if (option_verbose > 2) if (option_verbose > 2)
...@@ -645,6 +646,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags ...@@ -645,6 +646,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
time_t start_time, answer_time, end_time; time_t start_time, answer_time, end_time;
struct ast_app *app = NULL; struct ast_app *app = NULL;
char *dblgoto = NULL; char *dblgoto = NULL;
int nojump = 0;
if (!data) { if (!data) {
ast_log(LOG_WARNING, "Dial requires an argument (technology1/number1&technology2/number2...|optional timeout|options)\n"); ast_log(LOG_WARNING, "Dial requires an argument (technology1/number1&technology2/number2...|optional timeout|options)\n");
...@@ -896,7 +898,9 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags ...@@ -896,7 +898,9 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
privacy = 1; privacy = 1;
} else if (strchr(transfer, 'C')) { } else if (strchr(transfer, 'C')) {
resetcdr = 1; resetcdr = 1;
} } else if (strchr(transfer, 'n')) {
nojump = 1;
}
} }
if (resetcdr && chan->cdr) if (resetcdr && chan->cdr)
ast_cdr_reset(chan->cdr, 0); ast_cdr_reset(chan->cdr, 0);
...@@ -1115,7 +1119,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags ...@@ -1115,7 +1119,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
strncpy(status, "CHANUNAVAIL", sizeof(status) - 1); strncpy(status, "CHANUNAVAIL", sizeof(status) - 1);
time(&start_time); time(&start_time);
peer = wait_for_answer(chan, outgoing, &to, peerflags, &sentringing, status, sizeof(status), numbusy, numnochan, numcongestion, &result); peer = wait_for_answer(chan, outgoing, &to, peerflags, &sentringing, status, sizeof(status), numbusy, numnochan, numcongestion, nojump, &result);
if (!peer) { if (!peer) {
if (result) { if (result) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment