From 8ec1a1b17cbd659efff717d65267cd0c055d19f9 Mon Sep 17 00:00:00 2001 From: kpfleming Date: Wed, 23 Jul 2008 20:42:30 +0000 Subject: 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: http://svn.digium.com/svn/asterisk/branches/1.4@133226 f38db490-d61c-443f-a65b-d21fe96a405b --- main/asterisk.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'main') diff --git a/main/asterisk.c b/main/asterisk.c index 5d7c3600d..a581508e5 100644 --- a/main/asterisk.c +++ b/main/asterisk.c @@ -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 { -- cgit v1.2.3