COND_TYPE_IP,
COND_TYPE_CAPABILITY,
COND_TYPE_BMODE,
+ COND_TYPE_HLC,
COND_TYPE_IFATTR,
};
MATCH_PORT,
MATCH_INTERFACE,
MATCH_CALLERID,
+ MATCH_CALLERID2,
MATCH_EXTENSION,
MATCH_DIALING,
MATCH_ENBLOCK,
MATCH_UP,
MATCH_BUSY,
MATCH_IDLE,
- MATCH_ASTERISK,
- MATCH_NOTASTERISK,
+ MATCH_REMOTE,
+ MATCH_NOTREMOTE,
+ MATCH_POTS_FLASH,
+ MATCH_POTS_CW,
+ MATCH_POTS_CALLS,
+ MATCH_POTS_LAST,
};
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 */
#define PARAM_CALLERIDTYPE (1LL<<37)
#define PARAM_CALLTO (1LL<<38)
#define PARAM_ROOM (1LL<<39)
-#define PARAM_TIMEOUT (1LL<<40)
-#define PARAM_NOPASSWORD (1LL<<41)
-#define PARAM_STRIP (1LL<<42)
-
+#define PARAM_JINGLE (1LL<<40)
+#define PARAM_TIMEOUT (1LL<<41)
+#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)
+#define PARAM_POTS_CALL (1LL<<49)
/* action index
* NOTE: The given index is the actual entry number of action_defs[], so add/remove both lists!!!
#define ACTION_EXTERNAL 0
#define ACTION_INTERNAL 1
#define ACTION_OUTDIAL 2
-#define ACTION_CHAN 3
-#define ACTION_VBOX_RECORD 4
-#define ACTION_PARTYLINE 5
-#define ACTION_LOGIN 6
-#define ACTION_CALLERID 7
-#define ACTION_CALLERIDNEXT 8
-#define ACTION_FORWARD 9
-#define ACTION_REDIAL 10
-#define ACTION_REPLY 11
-#define ACTION_POWERDIAL 12
-#define ACTION_CALLBACK 13
-#define ACTION_ABBREV 14
-#define ACTION_TEST 15
-#define ACTION_PLAY 16
-#define ACTION_VBOX_PLAY 17
-#define ACTION_CALCULATOR 18
-#define ACTION_TIMER 19
-#define ACTION_GOTO 20
-#define ACTION_MENU 21
-#define ACTION_DISCONNECT 22
-#define ACTION_HELP 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
+#define ACTION_VBOX_RECORD 3
+#define ACTION_PARTYLINE 4
+#define ACTION_LOGIN 5
+#define ACTION_CALLERID 6
+#define ACTION_CALLERIDNEXT 7
+#define ACTION_FORWARD 8
+#define ACTION_REDIAL 9
+#define ACTION_REPLY 10
+#define ACTION_POWERDIAL 11
+#define ACTION_CALLBACK 12
+#define ACTION_ABBREV 13
+#define ACTION_TEST 14
+#define ACTION_PLAY 15
+#define ACTION_VBOX_PLAY 16
+#define ACTION_CALCULATOR 17
+#define ACTION_TIMER 18
+#define ACTION_GOTO 19
+#define ACTION_MENU 20
+#define ACTION_DISCONNECT 21
+#define ACTION_RELEASE 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_POTS_RETRIEVE 32
+#define ACTION_POTS_RELEASE 33
+#define ACTION_POTS_REJECT 34
+#define ACTION_POTS_ANSWER 35
+#define ACTION_POTS_3PTY 36
+#define ACTION_POTS_TRANSFER 37
struct route_cond { /* an item */
struct route_cond *next; /* next entry */
int line; /* line parsed from */
struct route_cond *cond_first; /* link to condition list */
struct route_action *action_first; /* link to action list */
+// int temp_couldmatch; /* stores, if the dialing could match. this is used to make a list of rules, that could match */
};
struct route_ruleset { /* the ruleset is a list of rules */
struct route_ruleset *next; /* next item */
char file[128]; /* filename */
int line; /* line parsed from */
- char name[64]; /* name of rule */
+ char name[64]; /* name of ruleset */
struct route_rule *rule_first; /* linke to rule list */
};
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;
};
extern struct route_ruleset *ruleset_main;
extern struct route_action action_external;
extern struct route_action action_internal;
-extern struct route_action action_chan;
+extern struct route_action action_remote;
extern struct route_action action_vbox;
extern struct route_action action_partyline;
extern struct route_action action_password;
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);