* See http://www.asterisk.org for more information about
* the Asterisk project. Please do not directly contact
* any of the maintainers of this project for assistance;
* the project provides a web site, mailing lists and IRC
* channels for your use.
*
* This program is free software, distributed under the terms of
* the GNU General Public License Version 2. See the LICENSE file
* at the top of the source tree.
*/
/*! \file
*
* \brief Function that drops specified frames from channels
*
* \author Naveen Albert <asterisk@phreaknet.org>
*
* \ingroup functions
*/
/*** MODULEINFO
<support_level>extended</support_level>
***/
#include"asterisk.h"
#include"asterisk/module.h"
#include"asterisk/channel.h"
#include"asterisk/pbx.h"
#include"asterisk/framehook.h"
/*** DOCUMENTATION
<function name="FRAME_DROP" language="en_US">
<synopsis>
Drops specific frame types in the TX or RX direction on a channel.
</synopsis>
<syntax>
<parameter name="direction" required="true">
<para>List of frame types to be dropped for the specified direction. Direction can be <literal>TX</literal> or <literal>RX</literal>. The <literal>TX</literal> direction will prevent Asterisk from sending frames to a channel, and the <literal>RX</literal> direction will prevent Asterisk from receiving frames from a channel.</para>
<para>Subsequent calls to this function will replace previous settings, allowing certain frames to be dropped only temporarily, for instance.</para>
<para>Below are the different types of frames that can be dropped. Other actions may need to be taken in conjunction with use of this function:
for instance, if you drop ANSWER control frames, you should explicitly use <literal>Progress()</literal> for your call or undesired behavior
may occur.</para>
<enumlist>
<enum name = "DTMF_BEGIN" />
<enum name = "DTMF_END" />
<enum name = "VOICE" />
<enum name = "VIDEO" />
<enum name = "CONTROL" />
<enum name = "NULL" />
<enum name = "IAX" />
<enum name = "TEXT" />
<enum name = "TEXT_DATA" />
<enum name = "IMAGE" />
<enum name = "HTML" />
<enum name = "CNG" />
<enum name = "MODEM" />
</enumlist>
<para>The following CONTROL frames can also be dropped:</para>
<enumlist>
<enum name = "RING" />
<enum name = "RINGING" />
<enum name = "ANSWER" />
<enum name = "BUSY" />
<enum name = "TAKEOFFHOOK" />
<enum name = "OFFHOOK" />
<enum name = "CONGESTION" />
<enum name = "FLASH" />
<enum name = "WINK" />
<enum name = "PROGRESS" />
<enum name = "PROCEEDING" />
<enum name = "HOLD" />
<enum name = "UNHOLD" />
<enum name = "VIDUPDATE" />
<enum name = "CONNECTED_LINE" />
<enum name = "REDIRECTING" />
</enumlist>
</parameter>
</syntax>
<description>
<para>Examples:</para>
<para>exten => 1,1,Set(FRAME_DROP(TX)=DTMF_BEGIN,DTMF_END); drop only DTMF frames towards this channel.</para>
<para>exten => 1,1,Set(FRAME_DROP(TX)=ANSWER); drop only ANSWER CONTROL frames towards this channel.</para>
<para>exten => 1,1,Set(FRAME_DROP(RX)=DTMF_BEGIN,DTMF_END); drop only DTMF frames received on this channel.</para>