diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-07-11 22:12:26 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-07-11 22:12:26 +0000 |
commit | 6d24d82f63425210f28b104b68324475163fd542 (patch) | |
tree | 84040a4ee9d4cb5ae7278c79140a6ff782d84388 /main/asterisk.c | |
parent | dd3bdbadeb89c8ddcb28dce2799f3ac9857ad370 (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/asterisk.c')
-rw-r--r-- | main/asterisk.c | 26 |
1 files changed, 22 insertions, 4 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; |