Goodbye Zaptel, hello DAHDI. Removes Zaptel driver support with DAHDI. Configuration file and dialplan backwards compatability has been put in place where appropiate. Release announcement to follow.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.0@123332 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Jeff Peeler
2008-06-17 18:08:09 +00:00
parent 8c4f56f424
commit f089bbf663
75 changed files with 2205 additions and 4773 deletions

View File

@@ -86,7 +86,7 @@ int daemon(int, int); /* defined in libresolv of all places */
#include <sys/loadavg.h>
#endif
#include "asterisk/zapata.h"
#include "asterisk/dahdi.h"
#ifdef linux
#include <sys/prctl.h>
@@ -165,6 +165,7 @@ int option_maxfiles; /*!< Max number of open file handles (files, sockets) */
#if defined(HAVE_SYSINFO)
long option_minmemfree; /*!< Minimum amount of free system memory - stop accepting calls if free memory falls below this watermark */
#endif
char dahdi_chan_name[AST_CHANNEL_NAME] = "ZAP";
/*! @} */
@@ -2540,7 +2541,7 @@ static int show_cli_help(void) {
printf(" -g Dump core in case of a crash\n");
printf(" -h This help screen\n");
printf(" -i Initialize crypto keys at startup\n");
printf(" -I Enable internal timing if Zaptel timer is available\n");
printf(" -I Enable internal timing if DAHDI timer is available\n");
printf(" -L <load> Limit the maximum load average before rejecting new calls\n");
printf(" -M <value> Limit the maximum number of calls to the specified value\n");
printf(" -m Mute debugging and console output on the console\n");
@@ -3262,28 +3263,28 @@ int main(int argc, char *argv[])
printf("%s", term_quit());
exit(1);
}
#ifdef HAVE_ZAPTEL
#ifdef HAVE_DAHDI
{
int fd;
int x = 160;
fd = open("/dev/zap/timer", O_RDWR);
fd = open("/dev/dahdi/timer", O_RDWR);
if (fd >= 0) {
if (ioctl(fd, ZT_TIMERCONFIG, &x)) {
ast_log(LOG_ERROR, "You have Zaptel built and drivers loaded, but the Zaptel timer test failed to set ZT_TIMERCONFIG to %d.\n", x);
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 Zaptel built and drivers loaded, but the Zaptel timer could not be polled during the Zaptel timer test.\n");
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 zaptel_timer_error[] = {
"Asterisk has detected a problem with your Zaptel configuration and will shutdown for your protection. You have options:"
"\n\t1. You only have to compile Zaptel support into Asterisk if you need it. One option is to recompile without Zaptel support."
"\n\t2. You only have to load Zaptel drivers if you want to take advantage of Zaptel services. One option is to unload zaptel modules if you don't need them."
"\n\t3. If you need Zaptel services, you must correctly configure Zaptel."
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", zaptel_timer_error);
ast_log(LOG_ERROR, "%s\n", dahdi_timer_error);
usleep(100);
exit(1);
}