[Asterisk-cvs] asterisk/apps app_zapscan.c,1.1,1.1.2.1
citats at lists.digium.com
citats at lists.digium.com
Tue Mar 9 22:59:33 CST 2004
Update of /usr/cvsroot/asterisk/apps
In directory mongoose.digium.com:/tmp/cvs-serv15193/apps
Modified Files:
Tag: v1-0_stable
app_zapscan.c
Log Message:
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
Index: app_zapscan.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_zapscan.c,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -d -r1.1 -r1.1.2.1
--- app_zapscan.c 11 Jan 2004 07:37:47 -0000 1.1
+++ app_zapscan.c 10 Mar 2004 03:52:11 -0000 1.1.2.1
@@ -43,8 +43,8 @@
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;
@@ -191,6 +191,9 @@
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) {
@@ -245,6 +248,7 @@
int confno = 0;
char confstr[80], *tmp;
struct ast_channel *tempchan = NULL, *lastchan = NULL;
+ struct ast_frame *f;
LOCAL_USER_ADD(u);
@@ -252,6 +256,14 @@
ast_answer(chan);
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);
if ( !tempchan && !lastchan )
break;
More information about the svn-commits
mailing list