[asterisk-commits] russell: branch group/timing r122368 - /team/group/timing/res/res_timing_dahdi.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jun 12 15:32:25 CDT 2008


Author: russell
Date: Thu Jun 12 15:32:25 2008
New Revision: 122368

URL: http://svn.digium.com/view/asterisk?view=rev&rev=122368
Log:
- fix enable_continuous
- implement get_event

Modified:
    team/group/timing/res/res_timing_dahdi.c

Modified: team/group/timing/res/res_timing_dahdi.c
URL: http://svn.digium.com/view/asterisk/team/group/timing/res/res_timing_dahdi.c?view=diff&rev=122368&r1=122367&r2=122368
==============================================================================
--- team/group/timing/res/res_timing_dahdi.c (original)
+++ team/group/timing/res/res_timing_dahdi.c Thu Jun 12 15:32:25 2008
@@ -102,7 +102,7 @@
 {
 	int flags = 1;
 
-	return ioctl(handle, DAHDI_TIMERPONG, &flags) ? -1 : 0;
+	return ioctl(handle, DAHDI_TIMERPING, &flags) ? -1 : 0;
 }
 
 static int dahdi_timer_disable_continuous(int handle)
@@ -114,7 +114,22 @@
 
 static enum ast_timing_event dahdi_timer_get_event(int handle)
 {
-	return 0;
+	int res;
+	int event;
+
+	res = ioctl(handle, DAHDI_GETEVENT, &event);
+
+	if (res) {
+		event = DAHDI_EVENT_TIMER_EXPIRED;
+	}
+
+	switch (event) {
+	case DAHDI_EVENT_TIMER_PING:
+		return AST_TIMING_EVENT_CONTINUOUS;
+	case DAHDI_EVENT_TIMER_EXPIRED:
+	default:
+		return AST_TIMING_EVENT_EXPIRED;	
+	}
 }
 
 static int dahdi_test_timer(void)




More information about the asterisk-commits mailing list