aboutsummaryrefslogtreecommitdiffstats
path: root/main/asterisk.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/asterisk.c')
-rw-r--r--main/asterisk.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/main/asterisk.c b/main/asterisk.c
index 14fbbf98e..5651bbd68 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -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>
@@ -166,6 +166,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";
/*! @} */
@@ -2560,7 +2561,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");
@@ -2781,6 +2782,10 @@ static void ast_readconfig(void)
option_minmemfree = 0;
}
#endif
+ } else if (!strcasecmp(v->name, "dahdichanname")) {
+ if (!strcasecmp(v->value, "yes")) {
+ ast_copy_string(dahdi_chan_name, "DAHDI", sizeof(dahdi_chan_name));
+ }
} else if (!strcasecmp(v->name, "entityid")) {
struct ast_eid tmp_eid;
if (!ast_str_to_eid(&tmp_eid, v->value)) {
@@ -3294,28 +3299,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);
}