From: Tilghman Lesher Date: Wed, 12 Nov 2008 21:18:57 +0000 (+0000) Subject: When using call limits under 1 second, infinite call lengths are allowed, X-Git-Tag: 1.4.23-rc2~3^2~35 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=382459fac8b7a3eb7a43e3048f0f47aa61cf5187;p=thirdparty%2Fasterisk.git When using call limits under 1 second, infinite call lengths are allowed, instead. (closes issue #13851) Reported by: ruddy git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@156386 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_dial.c b/apps/app_dial.c index 0032dd845c..5192217f11 100644 --- a/apps/app_dial.c +++ b/apps/app_dial.c @@ -1744,6 +1744,9 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags if (!res) { if (calldurationlimit > 0) { peer->whentohangup = time(NULL) + calldurationlimit; + } else if (timelimit > 0) { + /* Not enough granularity to make it less, but we can't use the special value 0 */ + peer->whentohangup = time(NULL) + 1; } if (!ast_strlen_zero(dtmfcalled)) { if (option_verbose > 2) @@ -1851,7 +1854,7 @@ out: ast_log(LOG_DEBUG, "Exiting with DIALSTATUS=%s.\n", status); if ((ast_test_flag(peerflags, OPT_GO_ON)) && (!chan->_softhangup) && (res != AST_PBX_KEEPALIVE)) { - if (calldurationlimit) + if (timelimit) chan->whentohangup = 0; res = 0; }