summaryrefslogtreecommitdiff
path: root/apps/app_echo.c
diff options
context:
space:
mode:
authorKinsey Moore <kmoore@digium.com>2012-03-20 20:42:34 +0000
committerKinsey Moore <kmoore@digium.com>2012-03-20 20:42:34 +0000
commit6ff8f14865a47a031a537b4686b23cf4554d0d69 (patch)
treebac1dba27c623e26a1ea2407617bd5f3ea98c71b /apps/app_echo.c
parent3a231e090f8e6746856358f49e6f21b0a3a1ab38 (diff)
Prevent Echo() from relaying control, null, and modem frames
Echo()'s description states that it echoes audio, video, and DTMF except for # while it actually echoes any frame that it receives other than DTMF #. This was causing frame storms in the test suite in some circumstances where Echo() was attached to both ends of a pair of local channels and control frames were being periodically generated. Echo()'s behavior and description have been modifed so that it only echoes media and non-# DTMF frames. ........ Merged revisions 360033 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 360034 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360036 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_echo.c')
-rw-r--r--apps/app_echo.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/apps/app_echo.c b/apps/app_echo.c
index a8a7fd84d..df5a914f1 100644
--- a/apps/app_echo.c
+++ b/apps/app_echo.c
@@ -40,12 +40,13 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
/*** DOCUMENTATION
<application name="Echo" language="en_US">
<synopsis>
- Echo audio, video, DTMF back to the calling party
+ Echo media, DTMF back to the calling party
</synopsis>
<syntax />
<description>
- <para>Echos back any audio, video or DTMF frames read from the calling
- channel back to itself. Note: If '#' detected application exits</para>
+ <para>Echos back any media or DTMF frames read from the calling
+ channel back to itself. This will not echo CONTROL, MODEM, or NULL
+ frames. Note: If '#' detected application exits.</para>
<para>This application does not automatically answer and should be
preceeded by an application such as Answer() or Progress().</para>
</description>
@@ -70,7 +71,10 @@ static int echo_exec(struct ast_channel *chan, const char *data)
}
f->delivery.tv_sec = 0;
f->delivery.tv_usec = 0;
- if (ast_write(chan, f)) {
+ if (f->frametype != AST_FRAME_CONTROL
+ && f->frametype != AST_FRAME_MODEM
+ && f->frametype != AST_FRAME_NULL
+ && ast_write(chan, f)) {
ast_frfree(f);
goto end;
}