aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2008-07-23 20:42:30 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2008-07-23 20:42:30 +0000
commit8ec1a1b17cbd659efff717d65267cd0c055d19f9 (patch)
treed1921955cd0d82c5d4d7ee8e54d46a601d82725d /main
parent69b8561975b4ad4220bba79e25eb746e9893df2e (diff)
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
Diffstat (limited to 'main')
-rw-r--r--main/asterisk.c22
1 files changed, 12 insertions, 10 deletions
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
{