mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-30 02:26:23 +00:00
reverse arguments to ast_tvdiff_ms, so they match the 'raw' math being used between the arguments
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6083 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -242,7 +242,7 @@ static int receive_dtmf_digits(struct ast_channel *chan, char *digit_string, int
|
|||||||
gettimeofday(&now,NULL);
|
gettimeofday(&now,NULL);
|
||||||
|
|
||||||
/* if outa time, leave */
|
/* if outa time, leave */
|
||||||
if (ast_tvdiff_ms(&lastdigittime, &now) >
|
if (ast_tvdiff_ms(&now, &lastdigittime) >
|
||||||
((i > 0) ? sdto : fdto)){
|
((i > 0) ? sdto : fdto)){
|
||||||
if(option_verbose >= 4)
|
if(option_verbose >= 4)
|
||||||
ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: DTMF Digit Timeout on %s\n", chan->name);
|
ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: DTMF Digit Timeout on %s\n", chan->name);
|
||||||
|
@@ -16,16 +16,16 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Computes the difference (in milliseconds) between two \c struct \c timeval instances.
|
* \brief Computes the difference (in milliseconds) between two \c struct \c timeval instances.
|
||||||
* \param start the beginning of the time period
|
* \param end the beginning of the time period
|
||||||
* \param end the end of the time period
|
* \param start the end of the time period
|
||||||
* \return the difference in milliseconds
|
* \return the difference in milliseconds
|
||||||
*/
|
*/
|
||||||
int ast_tvdiff_ms(const struct timeval *start, const struct timeval *end);
|
int ast_tvdiff_ms(const struct timeval *end, const struct timeval *start);
|
||||||
#if !defined(LOW_MEMORY) && !defined(AST_API_MODULE)
|
#if !defined(LOW_MEMORY) && !defined(AST_API_MODULE)
|
||||||
extern inline
|
extern inline
|
||||||
#endif
|
#endif
|
||||||
#if !defined(LOW_MEMORY) || defined(AST_API_MODULE)
|
#if !defined(LOW_MEMORY) || defined(AST_API_MODULE)
|
||||||
int ast_tvdiff_ms(const struct timeval *start, const struct timeval *end)
|
int ast_tvdiff_ms(const struct timeval *end, const struct timeval *start)
|
||||||
{
|
{
|
||||||
return ((end->tv_sec - start->tv_sec) * 1000) + ((end->tv_usec - start->tv_usec) / 1000);
|
return ((end->tv_sec - start->tv_sec) * 1000) + ((end->tv_usec - start->tv_usec) / 1000);
|
||||||
}
|
}
|
||||||
|
@@ -964,7 +964,7 @@ static struct ast_channel *ast_feature_request_and_dial(struct ast_channel *call
|
|||||||
|
|
||||||
/* see if the timeout has been violated */
|
/* see if the timeout has been violated */
|
||||||
gettimeofday(&ended,NULL);
|
gettimeofday(&ended,NULL);
|
||||||
if(ast_tvdiff_ms(&started, &ended) > timeout) {
|
if(ast_tvdiff_ms(&ended, &started) > timeout) {
|
||||||
state = AST_CONTROL_UNHOLD;
|
state = AST_CONTROL_UNHOLD;
|
||||||
ast_log(LOG_NOTICE, "We exceeded our AT-timeout\n");
|
ast_log(LOG_NOTICE, "We exceeded our AT-timeout\n");
|
||||||
break; /*doh! timeout*/
|
break; /*doh! timeout*/
|
||||||
|
Reference in New Issue
Block a user