static char *synopsis = "Scan Zap channels to monitor calls";
static char *descrip =
-" ZapScan allows a call center manager to monitor\n"
-"phone conversations in a convenient way.";
+" ZapScan allows a call center manager to monitor Zap channels in\n"
+"a convenient way. Use '#' to select the next channel and use '*' to exit\n";
STANDARD_LOCAL_USER;
if ((f->frametype == AST_FRAME_DTMF) && (f->subclass == '#')) {
ret = 0;
break;
+ } else if ((f->frametype == AST_FRAME_DTMF) && (f->subclass == '*')) {
+ ret = -1;
+ break;
} else if (fd != chan->fds[0]) {
if (f->frametype == AST_FRAME_VOICE) {
if (f->subclass == AST_FORMAT_ULAW) {
int confno = 0;
char confstr[80], *tmp;
struct ast_channel *tempchan = NULL, *lastchan = NULL;
+ struct ast_frame *f;
LOCAL_USER_ADD(u);
ast_answer(chan);
for (;;) {
+ if (ast_waitfor(chan, 100) < 0)
+ break;
+ f = ast_read(chan);
+ if (!f)
+ break;
+ if ((f->frametype == AST_FRAME_DTMF) && (f->subclass == '*')) {
+ ast_frfree(f);
+ break;
+ }
+ ast_frfree(f);
tempchan = ast_channel_walk(tempchan);
if ( !tempchan && !lastchan )
break;
- if ( tempchan && (!strcmp(tempchan->type, "Zap")) && (tempchan != chan) ) {
+ if ( tempchan && tempchan->type && (!strcmp(tempchan->type, "Zap")) && (tempchan != chan) ) {
ast_verbose(VERBOSE_PREFIX_3 "Zap channel %s is in-use, monitoring...\n", tempchan->name);
strcpy(confstr, tempchan->name);
if ((tmp = strchr(confstr,'-'))) {