make some more changes to the dahdi/zap channel name support stuff to ensure allthe globals are 'const', and clean up mmichelson's changes to app_chanspy to simplify the code

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@133226 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kevin P. Fleming
2008-07-23 20:42:30 +00:00
parent 252c5728fc
commit cd12517eeb
6 changed files with 28 additions and 29 deletions

View File

@@ -173,16 +173,17 @@ 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] = "";
#ifdef HAVE_ZAPTEL
char _dahdi_chan_name[AST_CHANNEL_NAME] = "Zap";
int _dahdi_chan_name_len = 3;
enum dahdi_chan_modes dahdi_chan_mode = CHAN_ZAP_MODE;
static char _dahdi_chan_name[AST_CHANNEL_NAME] = "Zap";
static size_t _dahdi_chan_name_len = 3;
static enum dahdi_chan_modes _dahdi_chan_mode = CHAN_ZAP_MODE;
#else
char _dahdi_chan_name[AST_CHANNEL_NAME] = "DAHDI";
int _dahdi_chan_name_len = 5;
enum dahdi_chan_modes dahdi_chan_mode = CHAN_DAHDI_PLUS_ZAP_MODE;
static char _dahdi_chan_name[AST_CHANNEL_NAME] = "DAHDI";
static size_t _dahdi_chan_name_len = 5;
static enum dahdi_chan_modes _dahdi_chan_mode = CHAN_DAHDI_PLUS_ZAP_MODE;
#endif
const char *dahdi_chan_name;
int dahdi_chan_name_len;
const size_t *dahdi_chan_name_len;
const enum dahdi_chan_modes *dahdi_chan_mode;
static int ast_socket = -1; /*!< UNIX Socket for allowing remote control */
static int ast_consock = -1; /*!< UNIX Socket for controlling another asterisk */
@@ -2597,13 +2598,13 @@ static void ast_readconfig(void)
if (ast_true(v->value)) {
strcpy(_dahdi_chan_name, "DAHDI");
_dahdi_chan_name_len = 5;
dahdi_chan_mode = CHAN_DAHDI_PLUS_ZAP_MODE;
_dahdi_chan_mode = CHAN_DAHDI_PLUS_ZAP_MODE;
}
#else
if (ast_false(v->value)) {
strcpy(_dahdi_chan_name, "Zap");
_dahdi_chan_name_len = 3;
dahdi_chan_mode = CHAN_ZAP_MODE;
_dahdi_chan_mode = CHAN_ZAP_MODE;
}
#endif
}
@@ -2988,7 +2989,8 @@ int main(int argc, char *argv[])
}
dahdi_chan_name = _dahdi_chan_name;
dahdi_chan_name_len = _dahdi_chan_name_len;
dahdi_chan_name_len = &_dahdi_chan_name_len;
dahdi_chan_mode = &_dahdi_chan_mode;
#ifdef HAVE_ZAPTEL
{