diff options
author | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-07-23 19:39:47 +0000 |
---|---|---|
committer | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-07-23 19:39:47 +0000 |
commit | 69b8561975b4ad4220bba79e25eb746e9893df2e (patch) | |
tree | d8392832fa74bacc5141084bbea5321b4bade278 /main/asterisk.c | |
parent | 16cfb7953f215a1299b3933fb4d38895017cb0d2 (diff) |
As suggested by seanbright, the PSEUDO_CHAN_LEN in
app_chanspy should be set at load time, not at compile
time, since dahdi_chan_name is determined at load time.
Also changed the next_unique_id_to_use to have the
static qualifier.
Also added the dahdi_chan_name_len variable so that
strlen(dahdi_chan_name) isn't necessary. Thanks to
seanbright for the suggestion.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@133169 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/asterisk.c')
-rw-r--r-- | main/asterisk.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/main/asterisk.c b/main/asterisk.c index 4bfa45036..5d7c3600d 100644 --- a/main/asterisk.c +++ b/main/asterisk.c @@ -174,12 +174,15 @@ 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; #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; #endif const char *dahdi_chan_name; +int dahdi_chan_name_len; static int ast_socket = -1; /*!< UNIX Socket for allowing remote control */ static int ast_consock = -1; /*!< UNIX Socket for controlling another asterisk */ @@ -2593,11 +2596,13 @@ static void ast_readconfig(void) #ifdef HAVE_ZAPTEL if (ast_true(v->value)) { strcpy(_dahdi_chan_name, "DAHDI"); + _dahdi_chan_name_len = 5; 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; } #endif @@ -2983,6 +2988,7 @@ int main(int argc, char *argv[]) } dahdi_chan_name = _dahdi_chan_name; + dahdi_chan_name_len = _dahdi_chan_name_len; #ifdef HAVE_ZAPTEL { |