X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=lcr.git;a=blobdiff_plain;f=route.h;h=1606410998fb00112b3b15c86aabebccfa06d0e5;hp=22c68e281b625ab9e859c2d524979c2b3b463a47;hb=8b70a9a5c2071c587ab4016dcbbb8e4bbf6da181;hpb=db6990e487255e8b206ef67d8d99fa74849a9a11 diff --git a/route.h b/route.h index 22c68e2..1606410 100644 --- a/route.h +++ b/route.h @@ -32,6 +32,7 @@ enum { /* how to parse text file during startup */ COND_TYPE_IP, COND_TYPE_CAPABILITY, COND_TYPE_BMODE, + COND_TYPE_HLC, COND_TYPE_IFATTR, }; @@ -41,6 +42,7 @@ enum { /* what to check during runtime */ MATCH_PORT, MATCH_INTERFACE, MATCH_CALLERID, + MATCH_CALLERID2, MATCH_EXTENSION, MATCH_DIALING, MATCH_ENBLOCK, @@ -83,11 +85,18 @@ enum { /* how to parse text file during startup */ PARAM_TYPE_YESNO, PARAM_TYPE_CAPABILITY, PARAM_TYPE_BMODE, + PARAM_TYPE_HLC, PARAM_TYPE_DIVERSION, PARAM_TYPE_DESTIN, PARAM_TYPE_PORTS, PARAM_TYPE_TYPE, PARAM_TYPE_CALLERIDTYPE, + PARAM_TYPE_ON, +}; + +enum { /* defines when a statement should be executed */ + INFO_ON_INIT, + INFO_ON_HANGUP, }; /* parameter ID bits */ @@ -136,7 +145,10 @@ enum { /* how to parse text file during startup */ #define PARAM_NOPASSWORD (1LL<<42) #define PARAM_STRIP (1LL<<43) #define PARAM_APPLICATION (1LL<<44) - +#define PARAM_CONTEXT (1LL<<45) +#define PARAM_EXTEN (1LL<<46) +#define PARAM_ON (1LL<<47) +#define PARAM_KEYPAD (1LL<<48) /* action index * NOTE: The given index is the actual entry number of action_defs[], so add/remove both lists!!! @@ -164,15 +176,16 @@ enum { /* how to parse text file during startup */ #define ACTION_GOTO 20 #define ACTION_MENU 21 #define ACTION_DISCONNECT 22 -#define ACTION_DEFLECT 23 -#define ACTION_SETFORWARD 24 -#define ACTION_EXECUTE 25 -#define ACTION_FILE 26 -#define ACTION_PICK 27 -#define ACTION_PASSWORD 28 -#define ACTION_PASSWORD_WRITE 29 -#define ACTION_NOTHING 30 -#define ACTION_EFI 31 +#define ACTION_RELEASE 23 +#define ACTION_DEFLECT 24 +#define ACTION_SETFORWARD 25 +#define ACTION_EXECUTE 26 +#define ACTION_FILE 27 +#define ACTION_PICK 28 +#define ACTION_PASSWORD 29 +#define ACTION_PASSWORD_WRITE 30 +#define ACTION_NOTHING 31 +#define ACTION_EFI 32 struct route_cond { /* an item */ struct route_cond *next; /* next entry */ @@ -223,29 +236,29 @@ struct route_ruleset { /* the ruleset is a list of rules */ }; struct cond_defs { /* defintion of all conditions */ - char *name; /* item's name */ + const char *name; /* item's name */ int match; /* what to check */ int type; /* type of value (COND_TYPE) */ - char *doc; /* syntax */ - char *help; /* short help */ + const char *doc; /* syntax */ + const char *help; /* short help */ }; struct param_defs { /* definition of all options */ unsigned long long id; /* ID of parameter (just for checking) */ - char *name; /* name of parameter */ + const char *name; /* name of parameter */ int type; /* type of value (PARAM_TYPE_*) */ - char *doc; /* syntax */ - char *help; /* quick help */ + const char *doc; /* syntax */ + const char *help; /* quick help */ }; struct action_defs { /* definition of all actions */ int id; /* ID of parameter (just for checking) */ - char *name; + const char *name; void (EndpointAppPBX::*init_func)(void); void (EndpointAppPBX::*dialing_func)(void); void (EndpointAppPBX::*hangup_func)(void); unsigned long long params; - char *help; + const char *help; }; @@ -271,5 +284,5 @@ void ruleset_free(struct route_ruleset *ruleset_start); void ruleset_debug(struct route_ruleset *ruleset_start); extern char ruleset_error[256]; struct route_ruleset *ruleset_parse(void); -struct route_ruleset *getrulesetbyname(char *name); +struct route_ruleset *getrulesetbyname(const char *name);