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

@@ -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);

View File

@@ -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);
}

View File

@@ -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);
}