diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-08-01 23:09:28 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-08-01 23:09:28 +0000 |
commit | 1a10d2d3b4f24514fdcc6e75c6ac744dcac51fa7 (patch) | |
tree | 4c2173c4fa266238fccf0cd11a96c5bd9574b52e /channel.c | |
parent | 277c4886502663bcfb7248615262d1fdcea97eb9 (diff) |
Merged revisions 38686 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r38686 | kpfleming | 2006-08-01 18:07:06 -0500 (Tue, 01 Aug 2006) | 2 lines
ensure that the 'feature digit timeout' value is taken into account when deciding how long the bridge should run (this fixes a problem report where a digit press that did not invoke a feature is never passed across the bridge)
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38687 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channel.c')
-rw-r--r-- | channel.c | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -3564,7 +3564,6 @@ enum ast_bridge_result ast_channel_bridge(struct ast_channel *c0, struct ast_cha struct timeval nexteventts = { 0, }; char caller_warning = 0; char callee_warning = 0; - int to; if (c0->_bridge) { ast_log(LOG_WARNING, "%s is already in a bridge with %s\n", @@ -3617,20 +3616,28 @@ enum ast_bridge_result ast_channel_bridge(struct ast_channel *c0, struct ast_cha o0nativeformats = c0->nativeformats; o1nativeformats = c1->nativeformats; - if (config->timelimit) { + if (config->feature_timer) { + nexteventts = ast_tvadd(config->start_time, ast_samp2tv(config->feature_timer, 1000)); + } else if (config->timelimit) { nexteventts = ast_tvadd(config->start_time, ast_samp2tv(config->timelimit, 1000)); if (caller_warning || callee_warning) nexteventts = ast_tvsub(nexteventts, ast_samp2tv(config->play_warning, 1000)); } for (/* ever */;;) { + struct timeval now; + int to; + to = -1; - if (config->timelimit) { - struct timeval now; + + if (!ast_tvzero(nexteventts)) { now = ast_tvnow(); to = ast_tvdiff_ms(nexteventts, now); if (to < 0) to = 0; + } + + if (config->timelimit) { time_left_ms = config->timelimit - ast_tvdiff_ms(now, config->start_time); if (time_left_ms < to) to = time_left_ms; |