diff options
-rw-r--r-- | main/channel.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/main/channel.c b/main/channel.c index eabbfd0f4..bf8b120ec 100644 --- a/main/channel.c +++ b/main/channel.c @@ -4896,6 +4896,13 @@ static enum ast_bridge_result ast_generic_bridge(struct ast_channel *c0, struct ast_poll_channel_add(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; @@ -4922,8 +4929,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) |