Merge changes from timing branch

- Convert chan_iax2 to use the timing API
 - Convert usage of timing in the core to use the timing API instead of
   using DAHDI directly
 - Make a change to the timing API to add the set_rate() function
 - change the timing core to use a rwlock
 - merge a timing implementation, res_timing_dahdi

Basic testing was successful using res_timing_dahdi


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@122523 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2008-06-13 12:45:50 +00:00
parent a68a160b75
commit b6457ecf4c
8 changed files with 319 additions and 161 deletions

View File

@@ -3299,35 +3299,7 @@ int main(int argc, char *argv[])
printf("%s", term_quit());
exit(1);
}
#ifdef HAVE_DAHDI
{
int fd;
int x = 160;
fd = open("/dev/dahdi/timer", O_RDWR);
if (fd >= 0) {
if (ioctl(fd, DAHDI_TIMERCONFIG, &x)) {
ast_log(LOG_ERROR, "You have DAHDI built and drivers loaded, but the DAHDI timer test failed to set DAHDI_TIMERCONFIG to %d.\n", x);
exit(1);
}
if ((x = ast_wait_for_input(fd, 300)) < 0) {
ast_log(LOG_ERROR, "You have DAHDI built and drivers loaded, but the DAHDI timer could not be polled during the DAHDI timer test.\n");
exit(1);
}
if (!x) {
const char dahdi_timer_error[] = {
"Asterisk has detected a problem with your DAHDI configuration and will shutdown for your protection. You have options:"
"\n\t1. You only have to compile DAHDI support into Asterisk if you need it. One option is to recompile without DAHDI support."
"\n\t2. You only have to load DAHDI drivers if you want to take advantage of DAHDI services. One option is to unload DAHDI modules if you don't need them."
"\n\t3. If you need DAHDI services, you must correctly configure DAHDI."
};
ast_log(LOG_ERROR, "%s\n", dahdi_timer_error);
usleep(100);
exit(1);
}
close(fd);
}
}
#endif
threadstorage_init();
astobj2_init();