- prototypes for module (cmd_function) with 3, 4, 5, 6 and
variable number of parameters added. The 3-6 versions just extend the
old version with more char* parameters and are kamailio compatible.
The variable number of parameters function is something new and
experimental. It takes the sip_msg, the number of extra parameters
and an array of action_u_t values (the internal routing engine
parameters representation).
- added a magic value for the parameters numbers, to be used by
variable parameter functions (VAR_PARAM_NO)
- moved/added the NO_SCRIPT macro (parameters number magic value for
functions that should not be called from the script) from tm.
... | ... |
@@ -44,6 +44,8 @@ |
44 | 44 |
* 2008-11-17 sip-router version: includes some of the openser/kamailio |
45 | 45 |
* changes: f(void) instead of f(), free_fixup_function() |
46 | 46 |
* dual module interface support: ser & kamailio (andrei) |
47 |
+ * 2008-11-18 prototypes for various fixed parameters numbers module |
|
48 |
+ * functions (3, 4, 5 & 6) and variable parameters (andrei) |
|
47 | 49 |
*/ |
48 | 50 |
|
49 | 51 |
/*! |
... | ... |
@@ -89,6 +91,15 @@ |
89 | 91 |
|
90 | 92 |
typedef struct module_exports* (*module_register)(void); |
91 | 93 |
typedef int (*cmd_function)(struct sip_msg*, char*, char*); |
94 |
+typedef int (*cmd_function3)(struct sip_msg*, char*, char*, char*); |
|
95 |
+typedef int (*cmd_function4)(struct sip_msg*, char*, char*, char*, char*); |
|
96 |
+typedef int (*cmd_function5)(struct sip_msg*, char*, char*, char*, |
|
97 |
+ char*, char*); |
|
98 |
+typedef int (*cmd_function6)(struct sip_msg*, char*, char*, char*, |
|
99 |
+ char*, char*, char*); |
|
100 |
+/* variable number of param module function, takes as param the sip_msg, |
|
101 |
+ extra paremeters number and a pointer to an array of parameters */ |
|
102 |
+typedef int (*cmd_function_var)(struct sip_msg*, int no, action_u_t* vals ); |
|
92 | 103 |
typedef int (*fixup_function)(void** param, int param_no); |
93 | 104 |
typedef int (*free_fixup_function)(void** param, int param_no); |
94 | 105 |
typedef int (*response_function)(struct sip_msg*); |
... | ... |
@@ -114,6 +125,13 @@ typedef unsigned int modparam_t; |
114 | 125 |
|
115 | 126 |
typedef int (*param_func_t)( modparam_t type, void* val); |
116 | 127 |
|
128 |
+/* magic parameter number values */ |
|
129 |
+ |
|
130 |
+#define NO_SCRIPT -1 /* export not usable from scripts */ |
|
131 |
+#define VAR_PARAM_NO -128 /* function has variable number of parameters |
|
132 |
+ (see cmd_function_var for the prototype) */ |
|
133 |
+ |
|
134 |
+/* functions flags */ |
|
117 | 135 |
#define REQUEST_ROUTE 1 /* Function can be used in request route blocks */ |
118 | 136 |
#define FAILURE_ROUTE 2 /* Function can be used in reply route blocks */ |
119 | 137 |
#define ONREPLY_ROUTE 4 /* Function can be used in on_reply */ |