aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2008-07-11 22:12:26 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2008-07-11 22:12:26 +0000
commit6d24d82f63425210f28b104b68324475163fd542 (patch)
tree84040a4ee9d4cb5ae7278c79140a6ff782d84388 /main
parentdd3bdbadeb89c8ddcb28dce2799f3ac9857ad370 (diff)
a whole pile of Zaptel/DAHDI compatibility work, with lots more to come... this tree is not yet ready for users to be easily upgrading or switching, but it needs to be :-)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@130298 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/asterisk.c26
-rw-r--r--main/channel.c5
-rw-r--r--main/file.c2
3 files changed, 23 insertions, 10 deletions
diff --git a/main/asterisk.c b/main/asterisk.c
index 17b3581f1..36a65c91a 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -172,7 +172,14 @@ int option_maxcalls; /*!< Max number of active calls */
char record_cache_dir[AST_CACHE_DIR_LEN] = AST_TMP_DIR;
char debug_filename[AST_FILENAME_MAX] = "";
-char dahdi_chan_name[AST_CHANNEL_NAME] = "ZAP";
+#ifdef HAVE_ZAPTEL
+char _dahdi_chan_name[AST_CHANNEL_NAME] = "Zap";
+enum dahdi_chan_modes dahdi_chan_mode = ZAP_ONLY_MODE;
+#else
+char _dahdi_chan_name[AST_CHANNEL_NAME] = "DAHDI";
+enum dahdi_chan_modes dahdi_chan_mode = DAHDI_PLUS_ZAP;
+#endif
+const char *dahdi_chan_name;
static int ast_socket = -1; /*!< UNIX Socket for allowing remote control */
static int ast_consock = -1; /*!< UNIX Socket for controlling another asterisk */
@@ -2409,7 +2416,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 %s timer is available\n", dahdi_chan_name);
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");
@@ -2583,9 +2590,17 @@ static void ast_readconfig(void)
} else if (!strcasecmp(v->name, "languageprefix")) {
ast_language_is_prefix = ast_true(v->value);
} else if (!strcasecmp(v->name, "dahdichanname")) {
- if (!strcasecmp(v->value, "yes")) {
- ast_copy_string(dahdi_chan_name, "DAHDI", sizeof(dahdi_chan_name));
+#ifdef HAVE_ZAPTEL
+ if (ast_true(v->value)) {
+ strcpy(_dahdi_chan_name, "DAHDI");
+ dahdi_chan_mode = DAHDI_PLUS_ZAP;
}
+#else
+ if (ast_false(v->value)) {
+ strcpy(_dahdi_chan_name, "Zap");
+ dahdi_chan_mode = ZAP_ONLY_MODE;
+ }
+#endif
}
}
ast_config_destroy(cfg);
@@ -2966,6 +2981,9 @@ int main(int argc, char *argv[])
printf(term_quit());
exit(1);
}
+
+ dahdi_chan_name = _dahdi_chan_name;
+
#ifdef HAVE_ZAPTEL
{
int fd;
diff --git a/main/channel.c b/main/channel.c
index bdc8491f3..9a5d70125 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -3009,11 +3009,6 @@ struct ast_channel *ast_request(const char *type, int format, void *data, int *c
return NULL;
}
- if (!strcasecmp(type, "Zap")) {
- type = "DAHDI";
- ast_log(LOG_NOTICE, "Zap interface translated to DAHDI.\n");
- }
-
AST_LIST_TRAVERSE(&backends, chan, list) {
if (strcasecmp(type, chan->tech->type))
continue;
diff --git a/main/file.c b/main/file.c
index a3f14fbe6..f99b543cb 100644
--- a/main/file.c
+++ b/main/file.c
@@ -683,7 +683,7 @@ static enum fsread_res ast_readaudio_callback(struct ast_filestream *s)
if (s->owner->timingfd > -1) {
int zap_timer_samples = whennext;
int rate;
- /* whennext is in samples, but zaptel timers operate in 8 kHz samples. */
+ /* whennext is in samples, but DAHDI timers operate in 8 kHz samples. */
if ((rate = ast_format_rate(s->fmt->format)) != 8000) {
float factor;
factor = ((float) rate) / ((float) 8000.0);