[Asterisk-cvs] asterisk/apps app_alarmreceiver.c,1.10,1.11
kpfleming at lists.digium.com
kpfleming at lists.digium.com
Thu Jun 9 10:37:26 CDT 2005
Update of /usr/cvsroot/asterisk/apps
In directory mongoose.digium.com:/tmp/cvs-serv29142/apps
Modified Files:
app_alarmreceiver.c
Log Message:
move timeval-diff function into utils.h from app_alarmreceiver.c
Index: app_alarmreceiver.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_alarmreceiver.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- app_alarmreceiver.c 6 Jun 2005 22:39:31 -0000 1.10
+++ app_alarmreceiver.c 9 Jun 2005 14:39:34 -0000 1.11
@@ -219,20 +219,6 @@
}
/*
-* 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 @@
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);
More information about the svn-commits
mailing list