mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 12:16:00 +00:00
add a library of timeval manipulation functions, and change a large number of usses to use the new functions (bug #4504)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6146 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -235,14 +235,12 @@ static int receive_dtmf_digits(struct ast_channel *chan, char *digit_string, int
|
||||
int i = 0;
|
||||
int r;
|
||||
struct ast_frame *f;
|
||||
struct timeval now, lastdigittime;
|
||||
struct timeval lastdigittime;
|
||||
|
||||
gettimeofday(&lastdigittime,NULL);
|
||||
lastdigittime = ast_tvnow();
|
||||
for(;;){
|
||||
gettimeofday(&now,NULL);
|
||||
|
||||
/* if outa time, leave */
|
||||
if (ast_tvdiff_ms(&now, &lastdigittime) >
|
||||
if (ast_tvdiff_ms(ast_tvnow(), lastdigittime) >
|
||||
((i > 0) ? sdto : fdto)){
|
||||
if(option_verbose >= 4)
|
||||
ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: DTMF Digit Timeout on %s\n", chan->name);
|
||||
@@ -287,7 +285,7 @@ static int receive_dtmf_digits(struct ast_channel *chan, char *digit_string, int
|
||||
if(i >= length)
|
||||
break;
|
||||
|
||||
gettimeofday(&lastdigittime,NULL);
|
||||
lastdigittime = ast_tvnow();
|
||||
}
|
||||
|
||||
digit_string[i] = '\0'; /* Nul terminate the end of the digit string */
|
||||
|
Reference in New Issue
Block a user