Browse Source

Merge commit 'origin/andrei/fixups'

* commit 'origin/andrei/fixups':
  fixups: call them even for 0 params. functions
  str: kamailio str_init compatibility macro
  fparam_t/gparam_t unification
Andrei Pelinescu-Onciul 17 years ago
parent
commit
7e69be0441
3 changed files with 15 additions and 3 deletions
  1. 5 0
      route.c
  2. 7 3
      sr_module.h
  3. 3 0
      str.h

+ 5 - 0
route.c

@@ -512,6 +512,11 @@ static int fix_actions(struct action* a)
 				if (cmd && cmd->c.fixup) {
 					int i;
 					DBG("fixing %s()\n", cmd->c.name);
+					if (t->val[1].u.number==0) {
+						ret = cmd->c.fixup(0, 0);
+						if (ret < 0)
+							return ret;
+					}
 					/* type cast NUMBER to STRING, old modules may expect
 					 * all STRING params during fixup */
 					for (i=0; i<t->val[1].u.number; i++) {

+ 7 - 3
sr_module.h

@@ -242,7 +242,9 @@ enum {
 	FPARAM_REGEX  = (1 << 3),
 	FPARAM_AVP    = (1 << 5),
 	FPARAM_SELECT = (1 << 6),
-	FPARAM_SUBST  = (1 << 7)
+	FPARAM_SUBST  = (1 << 7),
+	FPARAM_PVS    = (1 << 8),
+	FPARAM_PVE    = (1 << 9)
 };
 
 /*
@@ -257,8 +259,10 @@ typedef struct fparam {
 		int i;                    /* Integer value */
 		regex_t* regex;           /* Compiled regular expression */
 		avp_ident_t avp;          /* AVP identifier */
-	        select_t* select;         /* select structure */ 
-	        struct subst_expr* subst; /* Regex substitution */
+		select_t* select;         /* select structure */ 
+		struct subst_expr* subst; /* Regex substitution */
+		struct pv_spec_t* pvs;    /* kamailo pseudo-vars */
+		struct pv_elem_t* pve;    /* kamailo pseudo-vars */
 	} v;
 } fparam_t;
 

+ 3 - 0
str.h

@@ -84,6 +84,9 @@ typedef struct _str str;
  */
 #define STR_STATIC_INIT(v) {(v), sizeof(v) - 1}
 
+/* kamailio compatibility macro (same thing as above) */
+#define str_init(v) STR_STATIC_INIT(v)
+
 /** Initializes ::str string with NULL pointer and zero length.
  * This is a convenience macro that can be used to initialize
  * ::str string variable to NULL string with zero length: