1999-10-24 16:47:59 +00:00
|
|
|
/*
|
|
|
|
* Asterisk -- A telephony toolkit for Linux.
|
|
|
|
*
|
|
|
|
* General Definitions for Asterisk top level program
|
|
|
|
*
|
2005-06-06 20:27:51 +00:00
|
|
|
* Copyright (C) 1999-2005, Mark Spencer
|
1999-10-24 16:47:59 +00:00
|
|
|
*
|
2005-06-06 20:27:51 +00:00
|
|
|
* Mark Spencer <markster@digium.com>
|
1999-10-24 16:47:59 +00:00
|
|
|
*
|
|
|
|
* This program is free software, distributed under the terms of
|
|
|
|
* the GNU General Public License
|
|
|
|
*/
|
|
|
|
|
2005-10-26 13:03:17 +00:00
|
|
|
/*! \file
|
|
|
|
* \brief Asterisk main include file. File version handling, generic pbx functions.
|
|
|
|
*/
|
|
|
|
|
1999-10-24 16:47:59 +00:00
|
|
|
#ifndef _ASTERISK_H
|
|
|
|
#define _ASTERISK_H
|
|
|
|
|
2000-01-09 19:58:18 +00:00
|
|
|
#define DEFAULT_LANGUAGE "en"
|
|
|
|
|
2003-01-30 15:03:20 +00:00
|
|
|
#define AST_CONFIG_MAX_PATH 255
|
1999-10-24 16:47:59 +00:00
|
|
|
|
2005-06-06 03:04:58 +00:00
|
|
|
/* provided in asterisk.c */
|
|
|
|
extern char ast_config_AST_CONFIG_DIR[AST_CONFIG_MAX_PATH];
|
|
|
|
extern char ast_config_AST_CONFIG_FILE[AST_CONFIG_MAX_PATH];
|
|
|
|
extern char ast_config_AST_MODULE_DIR[AST_CONFIG_MAX_PATH];
|
|
|
|
extern char ast_config_AST_SPOOL_DIR[AST_CONFIG_MAX_PATH];
|
|
|
|
extern char ast_config_AST_MONITOR_DIR[AST_CONFIG_MAX_PATH];
|
|
|
|
extern char ast_config_AST_VAR_DIR[AST_CONFIG_MAX_PATH];
|
|
|
|
extern char ast_config_AST_LOG_DIR[AST_CONFIG_MAX_PATH];
|
|
|
|
extern char ast_config_AST_AGI_DIR[AST_CONFIG_MAX_PATH];
|
|
|
|
extern char ast_config_AST_DB[AST_CONFIG_MAX_PATH];
|
|
|
|
extern char ast_config_AST_KEY_DIR[AST_CONFIG_MAX_PATH];
|
|
|
|
extern char ast_config_AST_PID[AST_CONFIG_MAX_PATH];
|
|
|
|
extern char ast_config_AST_SOCKET[AST_CONFIG_MAX_PATH];
|
|
|
|
extern char ast_config_AST_RUN_DIR[AST_CONFIG_MAX_PATH];
|
2005-07-25 23:09:13 +00:00
|
|
|
extern char ast_config_AST_CTL_PERMISSIONS[AST_CONFIG_MAX_PATH];
|
|
|
|
extern char ast_config_AST_CTL_OWNER[AST_CONFIG_MAX_PATH];
|
|
|
|
extern char ast_config_AST_CTL_GROUP[AST_CONFIG_MAX_PATH];
|
|
|
|
extern char ast_config_AST_CTL[AST_CONFIG_MAX_PATH];
|
1999-10-24 16:47:59 +00:00
|
|
|
|
2005-08-23 01:30:22 +00:00
|
|
|
/* Provided by asterisk.c */
|
2005-11-08 01:29:14 +00:00
|
|
|
int ast_set_priority(int);
|
1999-10-24 16:47:59 +00:00
|
|
|
/* Provided by module.c */
|
2005-11-08 01:29:14 +00:00
|
|
|
int load_modules(const int preload_only);
|
1999-10-24 16:47:59 +00:00
|
|
|
/* Provided by pbx.c */
|
2005-11-08 01:29:14 +00:00
|
|
|
int load_pbx(void);
|
1999-10-24 16:47:59 +00:00
|
|
|
/* Provided by logger.c */
|
2005-11-08 01:29:14 +00:00
|
|
|
int init_logger(void);
|
|
|
|
void close_logger(void);
|
2001-07-26 14:28:30 +00:00
|
|
|
/* Provided by frame.c */
|
2005-11-08 01:29:14 +00:00
|
|
|
int init_framer(void);
|
2002-02-11 04:25:04 +00:00
|
|
|
/* Provided by logger.c */
|
2005-11-08 01:29:14 +00:00
|
|
|
int reload_logger(int);
|
2002-05-12 15:08:37 +00:00
|
|
|
/* Provided by term.c */
|
2005-11-08 01:29:14 +00:00
|
|
|
int term_init(void);
|
2003-01-30 15:03:20 +00:00
|
|
|
/* Provided by db.c */
|
2005-11-08 01:29:14 +00:00
|
|
|
int astdb_init(void);
|
2004-12-31 00:04:41 +00:00
|
|
|
/* Provided by channel.c */
|
2005-11-08 01:29:14 +00:00
|
|
|
void ast_channels_init(void);
|
2005-04-06 21:12:32 +00:00
|
|
|
/* Provided by dnsmgr.c */
|
2005-11-08 01:29:14 +00:00
|
|
|
int dnsmgr_init(void);
|
|
|
|
void dnsmgr_start_refresh(void);
|
|
|
|
void dnsmgr_reload(void);
|
2003-01-30 15:03:20 +00:00
|
|
|
|
2005-06-07 01:13:23 +00:00
|
|
|
/*!
|
|
|
|
* \brief Register the version of a source code file with the core.
|
|
|
|
* \param file the source file name
|
|
|
|
* \param version the version string (typically a CVS revision keyword string)
|
|
|
|
* \return nothing
|
|
|
|
*
|
|
|
|
* This function should not be called directly, but instead the
|
|
|
|
* ASTERISK_FILE_VERSION macro should be used to register a file with the core.
|
|
|
|
*/
|
2005-06-06 20:27:51 +00:00
|
|
|
void ast_register_file_version(const char *file, const char *version);
|
2005-06-07 01:13:23 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Unregister a source code file from the core.
|
|
|
|
* \param file the source file name
|
|
|
|
* \return nothing
|
|
|
|
*
|
|
|
|
* This function should not be called directly, but instead the
|
|
|
|
* ASTERISK_FILE_VERSION macro should be used to automatically unregister
|
|
|
|
* the file when the module is unloaded.
|
|
|
|
*/
|
2005-06-06 20:27:51 +00:00
|
|
|
void ast_unregister_file_version(const char *file);
|
|
|
|
|
2005-06-07 01:13:23 +00:00
|
|
|
/*!
|
|
|
|
* \brief Register/unregister a source code file with the core.
|
|
|
|
* \param file the source file name
|
|
|
|
* \param version the version string (typically a CVS revision keyword string)
|
|
|
|
*
|
|
|
|
* This macro will place a file-scope constructor and destructor into the
|
|
|
|
* source of the module using it; this will cause the version of this file
|
|
|
|
* to registered with the Asterisk core (and unregistered) at the appropriate
|
|
|
|
* times.
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
*
|
|
|
|
* \code
|
|
|
|
* ASTERISK_FILE_VERSION(__FILE__, "\$Revision\$")
|
|
|
|
* \endcode
|
2005-06-07 01:17:07 +00:00
|
|
|
*
|
|
|
|
* \note The dollar signs above have been protected with backslashes to keep
|
|
|
|
* CVS from modifying them in this file; under normal circumstances they would
|
|
|
|
* not be present and CVS would expand the Revision keyword into the file's
|
|
|
|
* revision number.
|
2005-06-07 01:13:23 +00:00
|
|
|
*/
|
2005-06-07 16:07:06 +00:00
|
|
|
#if defined(__GNUC__) && !defined(LOW_MEMORY)
|
2005-06-06 22:12:19 +00:00
|
|
|
#define ASTERISK_FILE_VERSION(file, version) \
|
2005-06-06 20:27:51 +00:00
|
|
|
static void __attribute__((constructor)) __register_file_version(void) \
|
|
|
|
{ \
|
2005-06-06 22:12:19 +00:00
|
|
|
ast_register_file_version(file, version); \
|
2005-06-06 20:27:51 +00:00
|
|
|
} \
|
|
|
|
static void __attribute__((destructor)) __unregister_file_version(void) \
|
|
|
|
{ \
|
2005-06-06 22:12:19 +00:00
|
|
|
ast_unregister_file_version(file); \
|
2005-06-06 20:27:51 +00:00
|
|
|
}
|
2005-06-07 16:07:06 +00:00
|
|
|
#elif !defined(LOW_MEMORY) /* ! __GNUC__ && ! LOW_MEMORY*/
|
|
|
|
#define ASTERISK_FILE_VERSION(file, x) static const char __file_version[] = x;
|
|
|
|
#else /* LOW_MEMORY */
|
|
|
|
#define ASTERISK_FILE_VERSION(file, x)
|
2005-06-06 20:27:51 +00:00
|
|
|
#endif /* __GNUC__ */
|
|
|
|
|
|
|
|
#endif /* _ASTERISK_H */
|