Add option for enabling and disabling echo cancellation
authorMatthew Fredrickson <creslin@digium.com>
Tue, 16 May 2006 21:43:20 +0000 (21:43 +0000)
committerMatthew Fredrickson <creslin@digium.com>
Tue, 16 May 2006 21:43:20 +0000 (21:43 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@27523 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_zap.c
include/asterisk/frame.h

index 60a6faf..f3003bb 100644 (file)
@@ -2900,6 +2900,16 @@ static int zt_setoption(struct ast_channel *chan, int option, void *data, int da
                ast_log(LOG_DEBUG, "Set Operator Services mode, value: %d on %s/%s\n",
                        oprmode->mode, chan->name,oprmode->peer->name);;
                break;
+       case AST_OPTION_ECHOCAN:
+               cp = (char *) data;
+               if (*cp) {
+                       ast_log(LOG_DEBUG, "Enabling echo cancelation on %s\n", chan->name);
+                       zt_enable_ec(p);
+               } else {
+                       ast_log(LOG_DEBUG, "Disabling echo cancelation on %s\n", chan->name);
+                       zt_disable_ec(p);
+               }
+               break;
        }
        errno = 0;
 
index 71e4ca9..102a637 100644 (file)
@@ -303,6 +303,9 @@ enum ast_control_frame_type {
 /* set channel into "Operator Services" mode */
 #define        AST_OPTION_OPRMODE              7
 
+/*! Explicitly enable or disable echo cancelation for the given channel */
+#define        AST_OPTION_ECHOCAN              8
+
 struct oprmode {
        struct ast_channel *peer;
        int mode;