mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-05 03:40:18 +00:00
fixes ability to exit echo app
when called from a ISDN channel, null frames prevent '#' exit. Now only echo back VOICE and DTMF frames (closes issue #16880) Reported by: alecdavis Patches: based on echo_exit_1-6-1.diff.txt uploaded by alecdavis (license 585) Tested by: alecdavis git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.0@249846 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -54,18 +54,26 @@ static int echo_exec(struct ast_channel *chan, void *data)
|
|||||||
|
|
||||||
while (ast_waitfor(chan, -1) > -1) {
|
while (ast_waitfor(chan, -1) > -1) {
|
||||||
struct ast_frame *f = ast_read(chan);
|
struct ast_frame *f = ast_read(chan);
|
||||||
if (!f)
|
if (!f) {
|
||||||
break;
|
break;
|
||||||
f->delivery.tv_sec = 0;
|
|
||||||
f->delivery.tv_usec = 0;
|
|
||||||
if (ast_write(chan, f)) {
|
|
||||||
ast_frfree(f);
|
|
||||||
goto end;
|
|
||||||
}
|
}
|
||||||
if ((f->frametype == AST_FRAME_DTMF) && (f->subclass == '#')) {
|
switch (f->frametype) {
|
||||||
res = 0;
|
case AST_FRAME_VOICE:
|
||||||
ast_frfree(f);
|
case AST_FRAME_DTMF:
|
||||||
goto end;
|
f->delivery.tv_sec = 0;
|
||||||
|
f->delivery.tv_usec = 0;
|
||||||
|
if (ast_write(chan, f)) {
|
||||||
|
ast_frfree(f);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
if ((f->frametype == AST_FRAME_DTMF) && (f->subclass == '#')) {
|
||||||
|
res = 0;
|
||||||
|
ast_frfree(f);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
ast_frfree(f);
|
ast_frfree(f);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user