提交 d0a7af4e authored 作者: Anthony Minessale's avatar Anthony Minessale

possible fix for WANPIPE-5

git-svn-id: http://svn.openzap.org/svn/openzap/trunk@816 a93c3328-9c30-0410-af19-c9cd2b2d52af
上级 8ef19daa
...@@ -371,7 +371,8 @@ typedef enum { ...@@ -371,7 +371,8 @@ typedef enum {
ZAP_CHANNEL_3WAY = (1 << 20), ZAP_CHANNEL_3WAY = (1 << 20),
ZAP_CHANNEL_PROGRESS = (1 << 21), ZAP_CHANNEL_PROGRESS = (1 << 21),
ZAP_CHANNEL_MEDIA = (1 << 22), ZAP_CHANNEL_MEDIA = (1 << 22),
ZAP_CHANNEL_ANSWERED = (1 << 23) ZAP_CHANNEL_ANSWERED = (1 << 23),
ZAP_CHANNEL_MUTE = (1 << 24)
} zap_channel_flag_t; } zap_channel_flag_t;
typedef enum { typedef enum {
......
...@@ -2012,6 +2012,7 @@ OZ_DECLARE(zap_status_t) zap_channel_read(zap_channel_t *zchan, void *data, zap_ ...@@ -2012,6 +2012,7 @@ OZ_DECLARE(zap_status_t) zap_channel_read(zap_channel_t *zchan, void *data, zap_
} }
} }
if (zap_test_flag(zchan, ZAP_CHANNEL_DTMF_DETECT) && !zap_channel_test_feature(zchan, ZAP_CHANNEL_FEATURE_DTMF_DETECT)) { if (zap_test_flag(zchan, ZAP_CHANNEL_DTMF_DETECT) && !zap_channel_test_feature(zchan, ZAP_CHANNEL_FEATURE_DTMF_DETECT)) {
teletone_dtmf_detect(&zchan->dtmf_detect, sln, (int)slen); teletone_dtmf_detect(&zchan->dtmf_detect, sln, (int)slen);
teletone_dtmf_get(&zchan->dtmf_detect, digit_str, sizeof(digit_str)); teletone_dtmf_get(&zchan->dtmf_detect, digit_str, sizeof(digit_str));
...@@ -2041,13 +2042,16 @@ OZ_DECLARE(zap_status_t) zap_channel_read(zap_channel_t *zchan, void *data, zap_ ...@@ -2041,13 +2042,16 @@ OZ_DECLARE(zap_status_t) zap_channel_read(zap_channel_t *zchan, void *data, zap_
if (zap_test_flag(zchan, ZAP_CHANNEL_SUPRESS_DTMF)) { if (zap_test_flag(zchan, ZAP_CHANNEL_SUPRESS_DTMF)) {
zchan->skip_read_frames = 20; zchan->skip_read_frames = 20;
} }
if (zchan->skip_read_frames > 0) {
memset(data, 0, *datalen);
zchan->skip_read_frames--;
} }
} }
} }
} }
if (zchan->skip_read_frames > 0 || zap_test_flag(zchan, ZAP_CHANNEL_MUTE)) {
memset(data, 0, *datalen);
if (zchan->skip_read_frames > 0) {
zchan->skip_read_frames--;
}
} }
return status; return status;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论