aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_alarmreceiver.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-07-15 23:00:47 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-07-15 23:00:47 +0000
commitff15e0fa53156b9994da3f726bfe91232de6195a (patch)
tree896015cada90b49858e1bf6503d9583704a56179 /apps/app_alarmreceiver.c
parentc05cf07847cb384ba66aa29d5eda580eda413ffb (diff)
add a library of timeval manipulation functions, and change a large number of usses to use the new functions (bug #4504)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6146 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_alarmreceiver.c')
-rwxr-xr-xapps/app_alarmreceiver.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/apps/app_alarmreceiver.c b/apps/app_alarmreceiver.c
index da6db49d2..9fead22da 100755
--- a/apps/app_alarmreceiver.c
+++ b/apps/app_alarmreceiver.c
@@ -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 */