mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-08 02:48:29 +00:00
Merged revisions 133171 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r133171 | mmichelson | 2008-07-23 14:48:03 -0500 (Wed, 23 Jul 2008) | 20 lines Merged revisions 133169 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r133169 | mmichelson | 2008-07-23 14:39:47 -0500 (Wed, 23 Jul 2008) | 12 lines 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: https://origsvn.digium.com/svn/asterisk/branches/1.6.0@133172 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -51,9 +51,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
|||||||
|
|
||||||
#define AST_NAME_STRLEN 256
|
#define AST_NAME_STRLEN 256
|
||||||
|
|
||||||
/* "DAHDI/pseudo" is twelve characters */
|
|
||||||
#define PSEUDO_CHAN_LEN 12
|
|
||||||
|
|
||||||
static const char *tdesc = "Listen to a channel, and optionally whisper into it";
|
static const char *tdesc = "Listen to a channel, and optionally whisper into it";
|
||||||
static const char *app_chan = "ChanSpy";
|
static const char *app_chan = "ChanSpy";
|
||||||
static const char *desc_chan =
|
static const char *desc_chan =
|
||||||
@@ -170,7 +167,14 @@ AST_APP_OPTIONS(spy_opts, {
|
|||||||
AST_APP_OPTION('X', OPTION_EXIT),
|
AST_APP_OPTION('X', OPTION_EXIT),
|
||||||
});
|
});
|
||||||
|
|
||||||
int next_unique_id_to_use = 0;
|
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 {
|
struct chanspy_translation_helper {
|
||||||
/* spy data */
|
/* spy data */
|
||||||
@@ -951,6 +955,7 @@ static int load_module(void)
|
|||||||
{
|
{
|
||||||
int res = 0;
|
int res = 0;
|
||||||
|
|
||||||
|
determine_pseudo_chan_len();
|
||||||
res |= ast_register_application(app_chan, chanspy_exec, tdesc, desc_chan);
|
res |= ast_register_application(app_chan, chanspy_exec, tdesc, desc_chan);
|
||||||
res |= ast_register_application(app_ext, extenspy_exec, tdesc, desc_ext);
|
res |= ast_register_application(app_ext, extenspy_exec, tdesc, desc_ext);
|
||||||
|
|
||||||
|
|||||||
@@ -142,6 +142,7 @@ extern pid_t ast_mainpid;
|
|||||||
|
|
||||||
extern char record_cache_dir[AST_CACHE_DIR_LEN];
|
extern char record_cache_dir[AST_CACHE_DIR_LEN];
|
||||||
extern char dahdi_chan_name[AST_CHANNEL_NAME];
|
extern char dahdi_chan_name[AST_CHANNEL_NAME];
|
||||||
|
extern int dahdi_chan_name_len;
|
||||||
|
|
||||||
extern int ast_language_is_prefix;
|
extern int ast_language_is_prefix;
|
||||||
|
|
||||||
|
|||||||
@@ -169,6 +169,7 @@ int option_maxfiles; /*!< Max number of open file handles (files, sockets) */
|
|||||||
long option_minmemfree; /*!< Minimum amount of free system memory - stop accepting calls if free memory falls below this watermark */
|
long option_minmemfree; /*!< Minimum amount of free system memory - stop accepting calls if free memory falls below this watermark */
|
||||||
#endif
|
#endif
|
||||||
char dahdi_chan_name[AST_CHANNEL_NAME] = "ZAP";
|
char dahdi_chan_name[AST_CHANNEL_NAME] = "ZAP";
|
||||||
|
int dahdi_chan_name_len = 3;
|
||||||
|
|
||||||
/*! @} */
|
/*! @} */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user