mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-18 15:49:56 +00:00
Directory fixes (bug #1887)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3329 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -128,7 +128,7 @@ static char *convert(char *lastname)
|
|||||||
*/
|
*/
|
||||||
static int play_mailbox_owner(struct ast_channel *chan, char *context, char *dialcontext, char *ext, char *name) {
|
static int play_mailbox_owner(struct ast_channel *chan, char *context, char *dialcontext, char *ext, char *name) {
|
||||||
int res = 0;
|
int res = 0;
|
||||||
int loop = -1;
|
int loop = 3;
|
||||||
char fn[256];
|
char fn[256];
|
||||||
char fn2[256];
|
char fn2[256];
|
||||||
|
|
||||||
@@ -172,6 +172,7 @@ static int play_mailbox_owner(struct ast_channel *chan, char *context, char *dia
|
|||||||
if (res > -1) {
|
if (res > -1) {
|
||||||
switch (res) {
|
switch (res) {
|
||||||
case '1':
|
case '1':
|
||||||
|
/* Name selected */
|
||||||
loop = 0;
|
loop = 0;
|
||||||
if (ast_exists_extension(chan,dialcontext,ext,1,chan->callerid)) {
|
if (ast_exists_extension(chan,dialcontext,ext,1,chan->callerid)) {
|
||||||
strncpy(chan->exten, ext, sizeof(chan->exten)-1);
|
strncpy(chan->exten, ext, sizeof(chan->exten)-1);
|
||||||
@@ -187,14 +188,21 @@ static int play_mailbox_owner(struct ast_channel *chan, char *context, char *dia
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case '*':
|
case '*':
|
||||||
|
/* Skip to next match in list */
|
||||||
loop = 0;
|
loop = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
/* Not '1', or '*', so decrement number of tries */
|
||||||
res = 0;
|
res = 0;
|
||||||
|
loop--;
|
||||||
break;
|
break;
|
||||||
} /* end switch */
|
} /* end switch */
|
||||||
} /* end if */
|
} /* end if */
|
||||||
|
else {
|
||||||
|
/* User hungup, so jump out now */
|
||||||
|
loop = 0;
|
||||||
|
}
|
||||||
} /* end while */
|
} /* end while */
|
||||||
|
|
||||||
return(res);
|
return(res);
|
||||||
@@ -261,7 +269,9 @@ static int do_directory(struct ast_channel *chan, struct ast_config *cfg, char *
|
|||||||
res = play_mailbox_owner(chan, context, dialcontext, v->name, name);
|
res = play_mailbox_owner(chan, context, dialcontext, v->name, name);
|
||||||
switch (res) {
|
switch (res) {
|
||||||
case -1:
|
case -1:
|
||||||
/* user pressed '1' but extension does not exist */
|
/* user pressed '1' but extension does not exist, or
|
||||||
|
* user hungup
|
||||||
|
*/
|
||||||
lastuserchoice = 0;
|
lastuserchoice = 0;
|
||||||
break;
|
break;
|
||||||
case '1':
|
case '1':
|
||||||
|
|||||||
Reference in New Issue
Block a user