]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
possible fix for WANPIPE-5
authorAnthony Minessale <anthony.minessale@gmail.com>
Tue, 1 Sep 2009 19:11:23 +0000 (19:11 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Tue, 1 Sep 2009 19:11:23 +0000 (19:11 +0000)
git-svn-id: http://svn.openzap.org/svn/openzap/trunk@816 a93c3328-9c30-0410-af19-c9cd2b2d52af

libs/freetdm/src/include/zap_types.h
libs/freetdm/src/zap_io.c

index 713e67e3e8b54fef0eff49f8fc0138661a612d92..b403f043877ead5044b2986bd70c772f35c788ab 100644 (file)
@@ -371,7 +371,8 @@ typedef enum {
        ZAP_CHANNEL_3WAY = (1 << 20),
        ZAP_CHANNEL_PROGRESS = (1 << 21),
        ZAP_CHANNEL_MEDIA = (1 << 22),
-       ZAP_CHANNEL_ANSWERED = (1 << 23)
+       ZAP_CHANNEL_ANSWERED = (1 << 23),
+       ZAP_CHANNEL_MUTE = (1 << 24)
 } zap_channel_flag_t;
 
 typedef enum {
index a20ea0ccf9bbae2ebae8879c5c28ef2409118b1d..7d2ea3b094744ffa1133d5fdc3d8c7ad9d8f0973 100644 (file)
@@ -2011,7 +2011,8 @@ 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)) {
                        teletone_dtmf_detect(&zchan->dtmf_detect, sln, (int)slen);
                        teletone_dtmf_get(&zchan->dtmf_detect, digit_str, sizeof(digit_str));
@@ -2041,15 +2042,18 @@ OZ_DECLARE(zap_status_t) zap_channel_read(zap_channel_t *zchan, void *data, zap_
                                        if (zap_test_flag(zchan, ZAP_CHANNEL_SUPRESS_DTMF)) {
                                                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;
 }