mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 20:04:50 +00:00
Preserve DTMF length in main/features.c
Review: https://reviewboard.asterisk.org/r/1463/ A small part of much larger work with DTMF duration in Asterisk, funded by IPvision AS in Denmark. Thanks to irroot for the review! git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@338623 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -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));
|
||||
|
Reference in New Issue
Block a user