Preserve DTMF length in main/features.c
[asterisk/asterisk.git] / main / features.c
index ac41a35..f194274 100644 (file)
@@ -3908,11 +3908,11 @@ int ast_bridge_call(struct ast_channel *chan, struct ast_channel *peer, struct a
                                           digits to come in for features. */
                                        ast_debug(1, "Timed out for feature!\n");
                                        if (!ast_strlen_zero(peer_featurecode)) {
-                                               ast_dtmf_stream(chan, peer, peer_featurecode, 0, 0);
+                                               ast_dtmf_stream(chan, peer, peer_featurecode, 0, f->len);
                                                memset(peer_featurecode, 0, sizeof(peer_featurecode));
                                        }
                                        if (!ast_strlen_zero(chan_featurecode)) {
-                                               ast_dtmf_stream(peer, chan, chan_featurecode, 0, 0);
+                                               ast_dtmf_stream(peer, chan, chan_featurecode, 0, f->len);
                                                memset(chan_featurecode, 0, sizeof(chan_featurecode));
                                        }
                                        if (f)
@@ -4039,6 +4039,7 @@ int ast_bridge_call(struct ast_channel *chan, struct ast_channel *peer, struct a
                } else if (f->frametype == AST_FRAME_DTMF_END) {
                        char *featurecode;
                        int sense;
+                       unsigned int dtmfduration = f->len;
 
                        hadfeatures = hasfeatures;
                        /* This cannot overrun because the longest feature is one shorter than our buffer */
@@ -4072,7 +4073,7 @@ int ast_bridge_call(struct ast_channel *chan, struct ast_channel *peer, struct a
                                res = feature_interpret(chan, peer, config, featurecode, sense);
                                switch(res) {
                                case AST_FEATURE_RETURN_PASSDIGITS:
-                                       ast_dtmf_stream(other, who, featurecode, 0, 0);
+                                       ast_dtmf_stream(other, who, featurecode, 0, dtmfduration);
                                        /* Fall through */
                                case AST_FEATURE_RETURN_SUCCESS:
                                        memset(featurecode, 0, sizeof(chan_featurecode));