mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 04:30:28 +00:00
Make ZapScan exit when '*' is pressed. Has the side effect of making
the app exit when the channel is hungup which wasn't happening before git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2383 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -43,8 +43,8 @@ static char *app = "ZapScan";
|
|||||||
static char *synopsis = "Scan Zap channels to monitor calls";
|
static char *synopsis = "Scan Zap channels to monitor calls";
|
||||||
|
|
||||||
static char *descrip =
|
static char *descrip =
|
||||||
" ZapScan allows a call center manager to monitor\n"
|
" ZapScan allows a call center manager to monitor Zap channels in\n"
|
||||||
"phone conversations in a convenient way.";
|
"a convenient way. Use '#' to select the next channel and use '*' to exit\n";
|
||||||
|
|
||||||
|
|
||||||
STANDARD_LOCAL_USER;
|
STANDARD_LOCAL_USER;
|
||||||
@@ -191,6 +191,9 @@ zapretry:
|
|||||||
if ((f->frametype == AST_FRAME_DTMF) && (f->subclass == '#')) {
|
if ((f->frametype == AST_FRAME_DTMF) && (f->subclass == '#')) {
|
||||||
ret = 0;
|
ret = 0;
|
||||||
break;
|
break;
|
||||||
|
} else if ((f->frametype == AST_FRAME_DTMF) && (f->subclass == '*')) {
|
||||||
|
ret = -1;
|
||||||
|
break;
|
||||||
} else if (fd != chan->fds[0]) {
|
} else if (fd != chan->fds[0]) {
|
||||||
if (f->frametype == AST_FRAME_VOICE) {
|
if (f->frametype == AST_FRAME_VOICE) {
|
||||||
if (f->subclass == AST_FORMAT_ULAW) {
|
if (f->subclass == AST_FORMAT_ULAW) {
|
||||||
@@ -245,6 +248,7 @@ static int conf_exec(struct ast_channel *chan, void *data)
|
|||||||
int confno = 0;
|
int confno = 0;
|
||||||
char confstr[80], *tmp;
|
char confstr[80], *tmp;
|
||||||
struct ast_channel *tempchan = NULL, *lastchan = NULL;
|
struct ast_channel *tempchan = NULL, *lastchan = NULL;
|
||||||
|
struct ast_frame *f;
|
||||||
|
|
||||||
LOCAL_USER_ADD(u);
|
LOCAL_USER_ADD(u);
|
||||||
|
|
||||||
@@ -252,6 +256,14 @@ static int conf_exec(struct ast_channel *chan, void *data)
|
|||||||
ast_answer(chan);
|
ast_answer(chan);
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
f = ast_read(chan);
|
||||||
|
if (!f || ast_check_hangup(chan))
|
||||||
|
break;
|
||||||
|
if ((f->frametype == AST_FRAME_DTMF) && (f->subclass == '*')) {
|
||||||
|
ast_frfree(f);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
ast_frfree(f);
|
||||||
tempchan = ast_channel_walk(tempchan);
|
tempchan = ast_channel_walk(tempchan);
|
||||||
if ( !tempchan && !lastchan )
|
if ( !tempchan && !lastchan )
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user