00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef _ASTERISK_EXTCONF_H
00025 #define _ASTERISK_EXTCONF_H
00026
00027 #if defined(__cplusplus) || defined(c_plusplus)
00028 extern "C" {
00029 #endif
00030
00031 #ifdef NOTYET
00032
00033
00034
00035
00036
00037 struct ast_comment {
00038 struct ast_comment *next;
00039 char cmt[0];
00040 };
00041
00042 struct ast_variable {
00043 char *name;
00044 char *value;
00045 int lineno;
00046 int object;
00047 int blanklines;
00048 struct ast_comment *precomments;
00049 struct ast_comment *sameline;
00050 struct ast_variable *next;
00051 char stuff[0];
00052 };
00053
00054 struct ast_category {
00055 char name[80];
00056 int ignored;
00057 int include_level;
00058 struct ast_comment *precomments;
00059 struct ast_comment *sameline;
00060 struct ast_variable *root;
00061 struct ast_variable *last;
00062 struct ast_category *next;
00063 };
00064
00065 struct ast_config {
00066 struct ast_category *root;
00067 struct ast_category *last;
00068 struct ast_category *current;
00069 struct ast_category *last_browse;
00070 int include_level;
00071 int max_include_level;
00072 };
00073
00074
00075
00076
00077 struct ast_app {
00078 int (*execute)(struct ast_channel *chan, void *data);
00079 const char *synopsis;
00080 const char *description;
00081 AST_RWLIST_ENTRY(ast_app) list;
00082 void *module;
00083 char name[0];
00084 };
00085
00086
00087
00088
00089
00090
00091 struct ast_exten {
00092 char *exten;
00093 int matchcid;
00094 const char *cidmatch;
00095 int priority;
00096 const char *label;
00097 struct ast_context *parent;
00098 const char *app;
00099 struct ast_app *cached_app;
00100 void *data;
00101 void (*datad)(void *);
00102 struct ast_exten *peer;
00103 const char *registrar;
00104 struct ast_exten *next;
00105 char stuff[0];
00106 };
00107
00108 typedef int (*ast_state_cb_type)(char *context, char* id, enum ast_extension_states state, void *data);
00109 struct ast_timing {
00110 int hastime;
00111 unsigned int monthmask;
00112 unsigned int daymask;
00113 unsigned int dowmask;
00114 unsigned int minmask[24];
00115 };
00116
00117 struct ast_include {
00118 const char *name;
00119 const char *rname;
00120 const char *registrar;
00121 int hastime;
00122 struct ast_timing timing;
00123 struct ast_include *next;
00124 char stuff[0];
00125 };
00126
00127
00128 struct ast_sw {
00129 char *name;
00130 const char *registrar;
00131 char *data;
00132 int eval;
00133 AST_LIST_ENTRY(ast_sw) list;
00134 char *tmpdata;
00135 char stuff[0];
00136 };
00137
00138 *! \brief Ignore patterns in dial plan */
00139 struct ast_ignorepat {
00140 const char *registrar;
00141 struct ast_ignorepat *next;
00142 const char pattern[0];
00143 };
00144
00145
00146 struct ast_context {
00147 ast_rwlock_t lock;
00148 struct ast_exten *root;
00149 struct ast_context *next;
00150 struct ast_include *includes;
00151 struct ast_ignorepat *ignorepats;
00152 const char *registrar;
00153 AST_LIST_HEAD_NOLOCK(, ast_sw) alts;
00154 ast_mutex_t macrolock;
00155 char name[0];
00156 };
00157
00158 #endif
00159
00160 struct ast_config *localized_config_load(const char *filename);
00161 struct ast_config *localized_config_load_with_comments(const char *filename);
00162 struct ast_category *localized_category_get(const struct ast_config *config, const char *category_name);
00163 int localized_config_text_file_save(const char *configfile, const struct ast_config *cfg, const char *generator);
00164 struct ast_context *localized_walk_contexts(struct ast_context *con);
00165 struct ast_exten *localized_walk_context_extensions(struct ast_context *con,
00166 struct ast_exten *exten);
00167 struct ast_exten *localized_walk_extension_priorities(struct ast_exten *exten,
00168 struct ast_exten *priority);
00169 struct ast_include *localized_walk_context_includes(struct ast_context *con,
00170 struct ast_include *inc);
00171 struct ast_sw *localized_walk_context_switches(struct ast_context *con,
00172 struct ast_sw *sw);
00173
00174 void localized_context_destroy(struct ast_context *con, const char *registrar);
00175 int localized_pbx_load_module(void);
00176
00177 struct ast_context *localized_context_create(struct ast_context **extcontexts, const char *name, const char *registrar);
00178 int localized_pbx_builtin_setvar(struct ast_channel *chan, void *data);
00179 int localized_context_add_ignorepat2(struct ast_context *con, const char *value, const char *registrar);
00180 int localized_context_add_switch2(struct ast_context *con, const char *value,
00181 const char *data, int eval, const char *registrar);
00182 int localized_context_add_include2(struct ast_context *con, const char *value,
00183 const char *registrar);
00184 int localized_add_extension2(struct ast_context *con,
00185 int replace, const char *extension, int priority, const char *label, const char *callerid,
00186 const char *application, void *data, void (*datad)(void *),
00187 const char *registrar);
00188 void localized_merge_contexts_and_delete(struct ast_context **extcontexts, const char *registrar);
00189 int localized_context_verify_includes(struct ast_context *con);
00190 void localized_use_conf_dir(void);
00191 void localized_use_local_dir(void);
00192
00193
00194 #ifndef _ASTERISK_PBX_H
00195
00196
00197
00198
00199
00200
00201 enum ext_match_t {
00202 E_MATCHMORE = 0x00,
00203 E_CANMATCH = 0x01,
00204 E_MATCH = 0x02,
00205 E_MATCH_MASK = 0x03,
00206 E_SPAWN = 0x12,
00207 E_FINDLABEL = 0x22
00208 };
00209 #define AST_PBX_MAX_STACK 128
00210
00211
00212 struct pbx_find_info {
00213 #if 0
00214 const char *context;
00215 const char *exten;
00216 int priority;
00217 #endif
00218
00219 char *incstack[AST_PBX_MAX_STACK];
00220 int stacklen;
00221 int status;
00222 struct ast_switch *swo;
00223 const char *data;
00224 const char *foundcontext;
00225 };
00226
00227 #define STATUS_NO_CONTEXT 1
00228 #define STATUS_NO_EXTENSION 2
00229 #define STATUS_NO_PRIORITY 3
00230 #define STATUS_NO_LABEL 4
00231 #define STATUS_SUCCESS 5
00232
00233 #endif
00234
00235 struct ast_exten *localized_find_extension(struct ast_context *bypass,
00236 struct pbx_find_info *q,
00237 const char *context,
00238 const char *exten,
00239 int priority,
00240 const char *label,
00241 const char *callerid,
00242 enum ext_match_t action);
00243
00244
00245 #if defined(__cplusplus) || defined(c_plusplus)
00246 }
00247 #endif
00248
00249 #endif