aboutsummaryrefslogtreecommitdiffstats
path: root/main/channel.c
diff options
context:
space:
mode:
authorjpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b>2009-05-01 17:40:46 +0000
committerjpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b>2009-05-01 17:40:46 +0000
commitb36ee19d92315f67aca4d4c8f726ec878722d8d9 (patch)
tree1e7120dc5b443bf93bf837f4b2f321e3b256e8fd /main/channel.c
parent59db0291707517eea353f901b25b18acf0e290b8 (diff)
Fix DTMF not being sent to other side after a partial feature match
This fixes a regression from commit 176701. The issue was that ast_generic_bridge never exited after the feature digit timeout had elapsed, which prevented the queued DTMF from being sent to the other side. This issue was reported to me directly. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@191488 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/channel.c')
-rw-r--r--main/channel.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/main/channel.c b/main/channel.c
index a10412fc7..6a2f7f77c 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -3950,6 +3950,13 @@ static enum ast_bridge_result ast_generic_bridge(struct ast_channel *c0, struct
if (jb_in_use)
ast_jb_empty_and_reset(c0, c1);
+ if (config->feature_timer > 0 && ast_tvzero(config->nexteventts)) {
+ /* nexteventts is not set when the bridge is not scheduled to
+ * break, so calculate when the bridge should possibly break
+ * if a partial feature match timed out */
+ config->nexteventts = ast_tvadd(ast_tvnow(), ast_samp2tv(config->feature_timer, 1000));
+ }
+
for (;;) {
struct ast_channel *who, *other;
@@ -3972,8 +3979,20 @@ static enum ast_bridge_result ast_generic_bridge(struct ast_channel *c0, struct
}
break;
}
- } else
+ } else {
+ /* If a feature has been started and the bridge is configured to
+ * to not break, leave the channel bridge when the feature timer
+ * time has elapsed so the DTMF will be sent to the other side.
+ */
+ if (!ast_tvzero(config->nexteventts)) {
+ int diff = ast_tvdiff_ms(config->nexteventts, ast_tvnow());
+ if (diff <= 0) {
+ res = AST_BRIDGE_RETRY;
+ break;
+ }
+ }
to = -1;
+ }
/* Calculate the appropriate max sleep interval - in general, this is the time,
left to the closest jb delivery moment */
if (jb_in_use)