diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-07-23 20:42:30 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-07-23 20:42:30 +0000 |
commit | 8ec1a1b17cbd659efff717d65267cd0c055d19f9 (patch) | |
tree | d1921955cd0d82c5d4d7ee8e54d46a601d82725d /apps | |
parent | 69b8561975b4ad4220bba79e25eb746e9893df2e (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 'apps')
-rw-r--r-- | apps/app_chanspy.c | 13 | ||||
-rw-r--r-- | apps/app_dahdibarge.c | 4 | ||||
-rw-r--r-- | apps/app_dahdiras.c | 4 |
3 files changed, 9 insertions, 12 deletions
diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c index 4a11c3b5a..80af5b234 100644 --- a/apps/app_chanspy.c +++ b/apps/app_chanspy.c @@ -147,13 +147,6 @@ AST_APP_OPTIONS(spy_opts, { }); static int next_unique_id_to_use = 0; -static int PSEUDO_CHAN_LEN; - -static void determine_pseudo_chan_len(void) -{ - PSEUDO_CHAN_LEN = dahdi_chan_name_len + strlen("/pseudo"); -} - struct chanspy_translation_helper { /* spy data */ @@ -473,6 +466,11 @@ static struct chanspy_ds *next_channel(struct ast_channel *chan, { struct ast_channel *this; char channel_name[AST_CHANNEL_NAME]; + static size_t PSEUDO_CHAN_LEN = 0; + + if (!PSEUDO_CHAN_LEN) { + PSEUDO_CHAN_LEN = *dahdi_chan_name_len + strlen("/pseudo"); + } redo: if (spec) @@ -865,7 +863,6 @@ static int load_module(void) { int res = 0; - determine_pseudo_chan_len(); res |= ast_register_application(app_chan, chanspy_exec, tdesc, desc_chan); res |= ast_register_application(app_ext, extenspy_exec, tdesc, desc_ext); diff --git a/apps/app_dahdibarge.c b/apps/app_dahdibarge.c index 88610cc36..a26af7f1d 100644 --- a/apps/app_dahdibarge.c +++ b/apps/app_dahdibarge.c @@ -336,7 +336,7 @@ static int unload_module(void) { int res = 0; - if (dahdi_chan_mode == CHAN_DAHDI_PLUS_ZAP_MODE) { + if (*dahdi_chan_mode == CHAN_DAHDI_PLUS_ZAP_MODE) { res |= ast_unregister_application(dahdi_app); } @@ -351,7 +351,7 @@ static int load_module(void) { int res = 0; - if (dahdi_chan_mode == CHAN_DAHDI_PLUS_ZAP_MODE) { + if (*dahdi_chan_mode == CHAN_DAHDI_PLUS_ZAP_MODE) { res |= ast_register_application(dahdi_app, exec_dahdi, dahdi_synopsis, dahdi_descrip); } diff --git a/apps/app_dahdiras.c b/apps/app_dahdiras.c index 1012a5fbe..9c92cda32 100644 --- a/apps/app_dahdiras.c +++ b/apps/app_dahdiras.c @@ -260,7 +260,7 @@ static int unload_module(void) { int res = 0; - if (dahdi_chan_mode == CHAN_DAHDI_PLUS_ZAP_MODE) { + if (*dahdi_chan_mode == CHAN_DAHDI_PLUS_ZAP_MODE) { res |= ast_unregister_application(dahdi_app); } @@ -275,7 +275,7 @@ static int load_module(void) { int res = 0; - if (dahdi_chan_mode == CHAN_DAHDI_PLUS_ZAP_MODE) { + if (*dahdi_chan_mode == CHAN_DAHDI_PLUS_ZAP_MODE) { res |= ast_register_application(dahdi_app, exec, dahdi_synopsis, dahdi_descrip); } |