00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef _ASTERISK_H
00019 #define _ASTERISK_H
00020
00021 #include "asterisk/autoconfig.h"
00022
00023 #if !defined(NO_MALLOC_DEBUG) && !defined(STANDALONE_AEL) && defined(MALLOC_DEBUG)
00024 #include "asterisk/astmm.h"
00025 #endif
00026
00027 #include "asterisk/compat.h"
00028
00029 #include "asterisk/paths.h"
00030
00031 #define DEFAULT_LANGUAGE "en"
00032
00033 #define DEFAULT_SAMPLE_RATE 8000
00034 #define DEFAULT_SAMPLES_PER_MS ((DEFAULT_SAMPLE_RATE)/1000)
00035 #define setpriority __PLEASE_USE_ast_set_priority_INSTEAD_OF_setpriority__
00036 #define sched_setscheduler __PLEASE_USE_ast_set_priority_INSTEAD_OF_sched_setscheduler__
00037
00038
00039 extern char ast_config_AST_CONFIG_DIR[PATH_MAX];
00040 extern char ast_config_AST_CONFIG_FILE[PATH_MAX];
00041 extern char ast_config_AST_MODULE_DIR[PATH_MAX];
00042 extern char ast_config_AST_SPOOL_DIR[PATH_MAX];
00043 extern char ast_config_AST_MONITOR_DIR[PATH_MAX];
00044 extern char ast_config_AST_VAR_DIR[PATH_MAX];
00045 extern char ast_config_AST_DATA_DIR[PATH_MAX];
00046 extern char ast_config_AST_LOG_DIR[PATH_MAX];
00047 extern char ast_config_AST_AGI_DIR[PATH_MAX];
00048 extern char ast_config_AST_DB[PATH_MAX];
00049 extern char ast_config_AST_KEY_DIR[PATH_MAX];
00050 extern char ast_config_AST_PID[PATH_MAX];
00051 extern char ast_config_AST_SOCKET[PATH_MAX];
00052 extern char ast_config_AST_RUN_DIR[PATH_MAX];
00053 extern char ast_config_AST_RUN_USER[PATH_MAX];
00054 extern char ast_config_AST_RUN_GROUP[PATH_MAX];
00055 extern char ast_config_AST_CTL_PERMISSIONS[PATH_MAX];
00056 extern char ast_config_AST_CTL_OWNER[PATH_MAX];
00057 extern char ast_config_AST_CTL_GROUP[PATH_MAX];
00058 extern char ast_config_AST_CTL[PATH_MAX];
00059 extern char ast_config_AST_SYSTEM_NAME[20];
00060
00061 int ast_set_priority(int);
00062 int load_modules(unsigned int);
00063 int load_pbx(void);
00064 int init_logger(void);
00065 void close_logger(void);
00066 int reload_logger(int);
00067 int init_framer(void);
00068 int ast_term_init(void);
00069 int astdb_init(void);
00070 void ast_channels_init(void);
00071 void ast_builtins_init(void);
00072 int dnsmgr_init(void);
00073 void dnsmgr_start_refresh(void);
00074 int dnsmgr_reload(void);
00075 void threadstorage_init(void);
00076 int astobj2_init(void);
00077 void ast_autoservice_init(void);
00078
00079
00080 struct ast_channel;
00081
00082
00083 struct ast_module;
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099 int ast_module_reload(const char *name);
00100
00101
00102
00103
00104
00105
00106
00107 int ast_register_atexit(void (*func)(void));
00108
00109
00110
00111
00112
00113 void ast_unregister_atexit(void (*func)(void));
00114
00115 #if !defined(LOW_MEMORY)
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125 void ast_register_file_version(const char *file, const char *version);
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136 void ast_unregister_file_version(const char *file);
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159 #ifdef MTX_PROFILE
00160 #define HAVE_MTX_PROFILE
00161 #define ASTERISK_FILE_VERSION(file, version) \
00162 static int mtx_prof = -1; \
00163 static void __attribute__((constructor)) __register_file_version(void) \
00164 { \
00165 mtx_prof = ast_add_profile("mtx_lock_" file, 0); \
00166 ast_register_file_version(file, version); \
00167 } \
00168 static void __attribute__((destructor)) __unregister_file_version(void) \
00169 { \
00170 ast_unregister_file_version(file); \
00171 }
00172 #else
00173 #define ASTERISK_FILE_VERSION(file, version) \
00174 static void __attribute__((constructor)) __register_file_version(void) \
00175 { \
00176 ast_register_file_version(file, version); \
00177 } \
00178 static void __attribute__((destructor)) __unregister_file_version(void) \
00179 { \
00180 ast_unregister_file_version(file); \
00181 }
00182 #endif
00183 #else
00184 #define ASTERISK_FILE_VERSION(file, x)
00185 #endif
00186
00187 #if !defined(LOW_MEMORY)
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203 int ast_add_profile(const char *, uint64_t scale);
00204 int64_t ast_profile(int, int64_t);
00205 int64_t ast_mark(int, int start1_stop0);
00206 #else
00207 #define ast_add_profile(a, b) 0
00208 #define ast_profile(a, b) do { } while (0)
00209 #define ast_mark(a, b) do { } while (0)
00210 #endif
00211
00212 #endif