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 AST_DECLARE_STRING_FIELDS(
00080 AST_STRING_FIELD(synopsis);
00081 AST_STRING_FIELD(description);
00082 AST_STRING_FIELD(syntax);
00083 AST_STRING_FIELD(arguments);
00084 AST_STRING_FIELD(seealso);
00085 );
00086 enum ast_xmldoc_src docsrc;
00087 AST_RWLIST_ENTRY(ast_app) list;
00088 void *module;
00089 char name[0];
00090 };
00091
00092
00093
00094
00095
00096
00097 struct ast_exten {
00098 char *exten;
00099 int matchcid;
00100 const char *cidmatch;
00101 int priority;
00102 const char *label;
00103 struct ast_context *parent;
00104 const char *app;
00105 struct ast_app *cached_app;
00106 void *data;
00107 void (*datad)(void *);
00108 struct ast_exten *peer;
00109 const char *registrar;
00110 struct ast_exten *next;
00111 char stuff[0];
00112 };
00113
00114 typedef int (*ast_state_cb_type)(char *context, char* id, enum ast_extension_states state, void *data);
00115 struct ast_timing {
00116 int hastime;
00117 unsigned int monthmask;
00118 unsigned int daymask;
00119 unsigned int dowmask;
00120 unsigned int minmask[24];
00121 };
00122
00123 struct ast_include {
00124 const char *name;
00125 const char *rname;
00126 const char *registrar;
00127 int hastime;
00128 struct ast_timing timing;
00129 struct ast_include *next;
00130 char stuff[0];
00131 };
00132
00133
00134 struct ast_sw {
00135 char *name;
00136 const char *registrar;
00137 char *data;
00138 int eval;
00139 AST_LIST_ENTRY(ast_sw) list;
00140 char *tmpdata;
00141 char stuff[0];
00142 };
00143
00144 *! \brief Ignore patterns in dial plan */
00145 struct ast_ignorepat {
00146 const char *registrar;
00147 struct ast_ignorepat *next;
00148 const char pattern[0];
00149 };
00150
00151
00152 struct ast_context {
00153 ast_rwlock_t lock;
00154 struct ast_exten *root;
00155 struct ast_context *next;
00156 struct ast_include *includes;
00157 struct ast_ignorepat *ignorepats;
00158 const char *registrar;
00159 AST_LIST_HEAD_NOLOCK(, ast_sw) alts;
00160 ast_mutex_t macrolock;
00161 char name[0];
00162 };
00163
00164 #endif
00165
00166 struct ast_config *localized_config_load(const char *filename);
00167 struct ast_config *localized_config_load_with_comments(const char *filename);
00168 struct ast_category *localized_category_get(const struct ast_config *config, const char *category_name);
00169 int localized_config_text_file_save(const char *configfile, const struct ast_config *cfg, const char *generator);
00170 struct ast_context *localized_walk_contexts(struct ast_context *con);
00171 struct ast_exten *localized_walk_context_extensions(struct ast_context *con,
00172 struct ast_exten *exten);
00173 struct ast_exten *localized_walk_extension_priorities(struct ast_exten *exten,
00174 struct ast_exten *priority);
00175 struct ast_include *localized_walk_context_includes(struct ast_context *con,
00176 struct ast_include *inc);
00177 struct ast_sw *localized_walk_context_switches(struct ast_context *con,
00178 struct ast_sw *sw);
00179
00180 void localized_context_destroy(struct ast_context *con, const char *registrar);
00181 int localized_pbx_load_module(void);
00182
00183
00184
00185
00186
00187 struct ast_context *localized_context_find_or_create(struct ast_context **extcontexts, void *tab, const char *name, const char *registrar);
00188 int localized_pbx_builtin_setvar(struct ast_channel *chan, void *data);
00189 int localized_context_add_ignorepat2(struct ast_context *con, const char *value, const char *registrar);
00190 int localized_context_add_switch2(struct ast_context *con, const char *value,
00191 const char *data, int eval, const char *registrar);
00192 int localized_context_add_include2(struct ast_context *con, const char *value,
00193 const char *registrar);
00194 int localized_add_extension2(struct ast_context *con,
00195 int replace, const char *extension, int priority, const char *label, const char *callerid,
00196 const char *application, void *data, void (*datad)(void *),
00197 const char *registrar);
00198
00199
00200
00201
00202 void localized_merge_contexts_and_delete(struct ast_context **extcontexts, void *tab, const char *registrar);
00203 int localized_context_verify_includes(struct ast_context *con);
00204 void localized_use_conf_dir(void);
00205 void localized_use_local_dir(void);
00206
00207
00208 #ifndef _ASTERISK_PBX_H
00209
00210
00211
00212
00213
00214
00215 enum ext_match_t {
00216 E_MATCHMORE = 0x00,
00217 E_CANMATCH = 0x01,
00218 E_MATCH = 0x02,
00219 E_MATCH_MASK = 0x03,
00220 E_SPAWN = 0x12,
00221 E_FINDLABEL = 0x22
00222 };
00223 #define AST_PBX_MAX_STACK 128
00224
00225
00226 struct pbx_find_info {
00227 #if 0
00228 const char *context;
00229 const char *exten;
00230 int priority;
00231 #endif
00232
00233 char *incstack[AST_PBX_MAX_STACK];
00234 int stacklen;
00235 int status;
00236 struct ast_switch *swo;
00237 const char *data;
00238 const char *foundcontext;
00239 };
00240
00241 #define STATUS_NO_CONTEXT 1
00242 #define STATUS_NO_EXTENSION 2
00243 #define STATUS_NO_PRIORITY 3
00244 #define STATUS_NO_LABEL 4
00245 #define STATUS_SUCCESS 5
00246
00247 #endif
00248
00249 struct ast_exten *localized_find_extension(struct ast_context *bypass,
00250 struct pbx_find_info *q,
00251 const char *context,
00252 const char *exten,
00253 int priority,
00254 const char *label,
00255 const char *callerid,
00256 enum ext_match_t action);
00257
00258
00259 #if defined(__cplusplus) || defined(c_plusplus)
00260 }
00261 #endif
00262
00263 #endif