]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-4109 --resolve
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 13 Apr 2012 13:57:34 +0000 (08:57 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 13 Apr 2012 13:57:34 +0000 (08:57 -0500)
src/mod/applications/mod_spandsp/mod_spandsp_dsp.c

index 636b502ce9756f16c57c554bf27512e9ebc120d9..f5b8408b87a5a27afbb08bb49d5af0d88cf59ea4 100644 (file)
@@ -49,10 +49,11 @@ typedef struct {
        int threshold;
 } switch_inband_dtmf_t;
 
-static void spandsp_dtmf_rx_realtime_callback(void *user_data, int code, int level, int delay)
+static void spandsp_dtmf_rx_realtime_callback(void *user_data, int code, int level, int duration)
 {
        switch_inband_dtmf_t *pvt = (switch_inband_dtmf_t *)user_data;
        char digit = (char)code;
+       pvt->samples += duration;
        if (digit) {
                /* prevent duplicate DTMF */
                if (digit != pvt->last_digit || (pvt->samples - pvt->last_digit_end) > pvt->min_dup_digit_spacing) {
@@ -93,7 +94,6 @@ static switch_bool_t inband_dtmf_callback(switch_media_bug_t *bug, void *user_da
                break;
        case SWITCH_ABC_TYPE_READ_REPLACE:
                if ((frame = switch_core_media_bug_get_read_replace_frame(bug))) {
-                       pvt->samples += frame->samples;
                        dtmf_rx(pvt->dtmf_detect, frame->data, frame->samples);
                        switch_core_media_bug_set_read_replace_frame(bug, frame);
                }