Browse code

PV get null helper added

- PV get null helper function required to stay in the API
- removed unused PV types - now AVP type is used to detect the type of
parameters, some related to R-URI are used by avpops, to be added if a
different solution is not found. Would be hard to manage the types in
core and do the implementation in module.

Daniel-Constantin Mierla authored on 20/11/2008 12:45:47
Showing 2 changed files
... ...
@@ -1,16 +1,16 @@
1 1
 /*
2
- * $Id: items.h 2111 2007-05-01 11:18:08Z juhe $
2
+ * $Id$
3 3
  *
4 4
  * Copyright (C) 2001-2003 FhG Fokus
5 5
  *
6
- * This file is part of Kamailio, a free SIP server.
6
+ * This file is part of SIP-Router, a free SIP server.
7 7
  *
8
- * Kamailio is free software; you can redistribute it and/or modify
8
+ * SIP-Router is free software; you can redistribute it and/or modify
9 9
  * it under the terms of the GNU General Public License as published by
10 10
  * the Free Software Foundation; either version 2 of the License, or
11 11
  * (at your option) any later version
12 12
  *
13
- * Kamailio is distributed in the hope that it will be useful,
13
+ * SIP-Router is distributed in the hope that it will be useful,
14 14
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 15
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 16
  * GNU General Public License for more details.
... ...
@@ -296,7 +296,20 @@ static str pv_str_marker = { PV_MARKER_STR, 1 };
296 296
 static int pv_get_marker(struct sip_msg *msg, pv_param_t *param,
297 297
 		pv_value_t *res)
298 298
 {
299
-	return pv_get_strintval(msg, param, res, &pv_str_marker, (int)pv_str_marker.s[0]);
299
+	return pv_get_strintval(msg, param, res, &pv_str_marker,
300
+			(int)pv_str_marker.s[0]);
301
+}
302
+
303
+static str pv_str_empty  = { "", 0 };
304
+int pv_get_null(struct sip_msg *msg, pv_param_t *param, pv_value_t *res)
305
+{
306
+	if(res==NULL)
307
+		return -1;
308
+	
309
+	res->rs = pv_str_empty;
310
+	res->ri = 0;
311
+	res->flags = PV_VAL_NULL;
312
+	return 0;
300 313
 }
301 314
 
302 315
 pv_export_t* pv_lookup_spec_name(str *pvname, pv_spec_p e)
... ...
@@ -3,14 +3,14 @@
3 3
  *
4 4
  * Copyright (C) 2001-2003 FhG Fokus
5 5
  *
6
- * This file is part of Kamailio, a free SIP server.
6
+ * This file is part of SIP-Router, a free SIP server.
7 7
  *
8
- * Kamailio is free software; you can redistribute it and/or modify
8
+ * SIP-Router is free software; you can redistribute it and/or modify
9 9
  * it under the terms of the GNU General Public License as published by
10 10
  * the Free Software Foundation; either version 2 of the License, or
11 11
  * (at your option) any later version
12 12
  *
13
- * Kamailio is distributed in the hope that it will be useful,
13
+ * SIP-Router is distributed in the hope that it will be useful,
14 14
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 15
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 16
  * GNU General Public License for more details.
... ...
@@ -72,34 +72,7 @@
72 72
 
73 73
 enum _pv_type { 
74 74
 	PVT_NONE=0,           PVT_EMPTY,             PVT_NULL, 
75
-	PVT_MARKER,           PVT_AVP,               PVT_HDR,
76
-	PVT_PID,              PVT_RETURN_CODE,       PVT_TIMES,
77
-	PVT_TIMEF,            PVT_MSGID,             PVT_METHOD,
78
-	PVT_STATUS,           PVT_REASON,            PVT_RURI,
79
-	PVT_RURI_USERNAME,    PVT_RURI_DOMAIN,       PVT_RURI_PORT,
80
-	PVT_FROM,             PVT_FROM_USERNAME,     PVT_FROM_DOMAIN,
81
-	PVT_FROM_TAG,         PVT_TO,                PVT_TO_USERNAME,
82
-	PVT_TO_DOMAIN,        PVT_TO_TAG,            PVT_CSEQ,
83
-	PVT_CONTACT,          PVT_CALLID,            PVT_USERAGENT,
84
-	PVT_MSG_BUF,          PVT_MSG_LEN,           PVT_FLAGS,
85
-	PVT_HEXFLAGS,         PVT_SRCIP,             PVT_SRCPORT,
86
-	PVT_RCVIP,            PVT_RCVPORT,           PVT_REFER_TO,
87
-	PVT_DSET,             PVT_DSTURI,            PVT_COLOR,
88
-	PVT_BRANCH,           PVT_BRANCHES,          PVT_CONTENT_TYPE,
89
-	PVT_CONTENT_LENGTH,   PVT_MSG_BODY,          PVT_AUTH_USERNAME,
90
-	PVT_AUTH_REALM,       PVT_RURI_PROTOCOL,     PVT_DSTURI_DOMAIN,
91
-	PVT_DSTURI_PORT,      PVT_DSTURI_PROTOCOL,   PVT_FROM_DISPLAYNAME,
92
-	PVT_TO_DISPLAYNAME,   PVT_OURI,              PVT_OURI_USERNAME,
93
-	PVT_OURI_DOMAIN,      PVT_OURI_PORT,         PVT_OURI_PROTOCOL,
94
-	PVT_FORCE_SOCK,       PVT_RPID_URI,          PVT_DIVERSION_URI,
95
-	PVT_ACC_USERNAME,     PVT_PPI,               PVT_PPI_DISPLAYNAME,
96
-	PVT_PPI_DOMAIN,       PVT_PPI_USERNAME,      PVT_PAI_URI,
97
-	PVT_BFLAGS,           PVT_HEXBFLAGS,         PVT_SFLAGS,
98
-	PVT_HEXSFLAGS,        PVT_ERR_CLASS,         PVT_ERR_LEVEL,
99
-	PVT_ERR_INFO,         PVT_ERR_RCODE,         PVT_ERR_RREASON,
100
-	PVT_SCRIPTVAR,        PVT_PROTO,             PVT_AUTH_USERNAME_WHOLE,
101
-	PVT_AUTH_DURI,        PVT_DIV_REASON,        PVT_DIV_PRIVACY,
102
-	PVT_AUTH_DOMAIN,      PVT_OTHER,
75
+	PVT_MARKER,           PVT_AVP,               PVT_OTHER,
103 76
 	PVT_EXTRA /* keep it last */
104 77
 };
105 78