mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
This commit closes bug 7605, and half-closes 7638. The AEL code has been redistributed/repartitioned to allow code re-use both inside and outside of Asterisk. This commit introduces the utils/conf2ael program, and an external config-file reader, for both normal config files, and for extensions.conf (context, exten, prio); It provides an API for programs outside of asterisk to use to play with the dialplan and config files.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@79595 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -904,6 +904,52 @@ int ast_func_read(struct ast_channel *chan, const char *function, char *workspac
|
||||
*/
|
||||
int ast_func_write(struct ast_channel *chan, const char *function, const char *value);
|
||||
|
||||
/*!
|
||||
* When looking up extensions, we can have different requests
|
||||
* identified by the 'action' argument, as follows.
|
||||
* Note that the coding is such that the low 4 bits are the
|
||||
* third argument to extension_match_core.
|
||||
*/
|
||||
|
||||
enum ext_match_t {
|
||||
E_MATCHMORE = 0x00, /* extension can match but only with more 'digits' */
|
||||
E_CANMATCH = 0x01, /* extension can match with or without more 'digits' */
|
||||
E_MATCH = 0x02, /* extension is an exact match */
|
||||
E_MATCH_MASK = 0x03, /* mask for the argument to extension_match_core() */
|
||||
E_SPAWN = 0x12, /* want to spawn an extension. Requires exact match */
|
||||
E_FINDLABEL = 0x22 /* returns the priority for a given label. Requires exact match */
|
||||
};
|
||||
|
||||
#define STATUS_NO_CONTEXT 1
|
||||
#define STATUS_NO_EXTENSION 2
|
||||
#define STATUS_NO_PRIORITY 3
|
||||
#define STATUS_NO_LABEL 4
|
||||
#define STATUS_SUCCESS 5
|
||||
#define AST_PBX_MAX_STACK 128
|
||||
|
||||
/* request and result for pbx_find_extension */
|
||||
struct pbx_find_info {
|
||||
#if 0
|
||||
const char *context;
|
||||
const char *exten;
|
||||
int priority;
|
||||
#endif
|
||||
|
||||
char *incstack[AST_PBX_MAX_STACK]; /* filled during the search */
|
||||
int stacklen; /* modified during the search */
|
||||
int status; /* set on return */
|
||||
struct ast_switch *swo; /* set on return */
|
||||
const char *data; /* set on return */
|
||||
const char *foundcontext; /* set on return */
|
||||
};
|
||||
|
||||
struct ast_exten *pbx_find_extension(struct ast_channel *chan,
|
||||
struct ast_context *bypass, struct pbx_find_info *q,
|
||||
const char *context, const char *exten, int priority,
|
||||
const char *label, const char *callerid, enum ext_match_t action);
|
||||
|
||||
|
||||
|
||||
#if defined(__cplusplus) || defined(c_plusplus)
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user