aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2009-02-26 17:09:03 +0000
committermurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2009-02-26 17:09:03 +0000
commit533d2cf651c27821932fed809339755b6f49703c (patch)
treec4c2d1aae71f41535449196a18d235b9d14fa937
parentf268d815f558e72c74da6ca83dd5f1d3e46e81d0 (diff)
This patch prevents the feature detection timeout from being cut in half.
Because the ast_channel_bridge() call will return 0 and pass a frame pointer for both DTMF_BEGIN and DTMF_END, the feature_timer field in hte config struct is getting decremented twice, which effectively cuts the digittimeout in half. I added conditions to the if statement to only let DTMF_END frames to flow thru, which solved the problem. Also, when the frame pointer is null, let control flow thru-- this usually happens on timeouts. I added a comment to the code to explain what's going on and why. Many thanks to sodom for reporting this problem. Personnally, it always seemed like something was wrong with the featuredigittimeout, but I never could quite decide what... and was too busy to investigate. This bug forced the issue, and now we know. Sodom had other issues in 14515, but I couldn't reproduce them. If he still has problems, and wants to get them solved, he is welcome to reopen 14515. (closes issue #14515) Reported by: sodom Patches: 14515.patch uploaded by murf (license 17) Tested by: murf, sodom git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@178804 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--res/res_features.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/res/res_features.c b/res/res_features.c
index 05bbd7fe4..98983270a 100644
--- a/res/res_features.c
+++ b/res/res_features.c
@@ -1726,8 +1726,15 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast
struct ast_channel *other; /* used later */
res = ast_channel_bridge(chan, peer, config, &f, &who);
-
- if (config->feature_timer) {
+
+ /* When frame is not set, we are probably involved in a situation
+ where we've timed out.
+ When frame is set, we'll come thru this code twice; once for DTMF_BEGIN
+ and also for DTMF_END. If we flow into the following 'if' for both, then
+ our wait times are cut in half, as both will subtract from the
+ feature_timer. Not good!
+ */
+ if (config->feature_timer && (!f || f->frametype == AST_FRAME_DTMF_END)) {
/* Update time limit for next pass */
diff = ast_tvdiff_ms(ast_tvnow(), config->start_time);
if (res == AST_BRIDGE_RETRY) {