aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_alarmreceiver.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-06-09 14:39:34 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-06-09 14:39:34 +0000
commit54c8bb2a71a8115d4076d94f54ce0d5dba02603e (patch)
tree63859a8a4348b4a0ac78e2f5e78deac39117daf5 /apps/app_alarmreceiver.c
parentec67bfa81ece4d0111d53887f8d69d45cd771d49 (diff)
move timeval-diff function into utils.h from app_alarmreceiver.c
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5882 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_alarmreceiver.c')
-rwxr-xr-xapps/app_alarmreceiver.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/apps/app_alarmreceiver.c b/apps/app_alarmreceiver.c
index 324d656ce..bdf264ea5 100755
--- a/apps/app_alarmreceiver.c
+++ b/apps/app_alarmreceiver.c
@@ -219,20 +219,6 @@ static int send_tone_burst(struct ast_channel *chan, float freq, int duration, i
}
/*
-* Return the difference in milliseconds between two timeval structs
-*/
-
-static int ms_diff(struct timeval *tv1, struct timeval *tv2){
-
- int ms;
-
- ms = (tv1->tv_sec - tv2->tv_sec) * 1000;
- ms += (tv1->tv_usec - tv2->tv_usec) / 1000;
-
- return(ms);
-}
-
-/*
* Receive a string of DTMF digits where the length of the digit string is known in advance. Do not give preferential
* treatment to any digit value, and allow separate time out values to be specified for the first digit and all subsequent
* digits.
@@ -256,7 +242,7 @@ static int receive_dtmf_digits(struct ast_channel *chan, char *digit_string, int
gettimeofday(&now,NULL);
/* if outa time, leave */
- if (ms_diff(&now,&lastdigittime) >
+ if (ast_tvdiff_ms(&lastdigittime, &now) >
((i > 0) ? sdto : fdto)){
if(option_verbose >= 4)
ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: DTMF Digit Timeout on %s\n", chan->name);