aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_echo.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2002-05-13 22:29:39 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2002-05-13 22:29:39 +0000
commit1642b09aba30d6f0b95a11bf079f99db94fdac02 (patch)
tree64c5de0a1afb1872ee474057eb3f244015f2801c /apps/app_echo.c
parent1c5b980de51d4caaa1d463fd0f702305b87aec4e (diff)
Version 0.1.12 from FTP
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@446 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_echo.c')
-rwxr-xr-xapps/app_echo.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/app_echo.c b/apps/app_echo.c
index cacfe07d9..7690209ac 100755
--- a/apps/app_echo.c
+++ b/apps/app_echo.c
@@ -11,6 +11,7 @@
* the GNU General Public License
*/
+#include <asterisk/lock.h>
#include <asterisk/file.h>
#include <asterisk/logger.h>
#include <asterisk/channel.h>
@@ -47,7 +48,10 @@ static int echo_exec(struct ast_channel *chan, void *data)
ast_set_write_format(chan, ast_best_codec(chan->nativeformats));
ast_set_read_format(chan, ast_best_codec(chan->nativeformats));
/* Do our thing here */
- while((f = ast_read(chan))) {
+ while(ast_waitfor(chan, -1) > -1) {
+ f = ast_read(chan);
+ if (!f)
+ break;
if (f->frametype == AST_FRAME_VOICE) {
if (ast_write(chan, f))
break;