Browse code

core, lib, modules: restructured source code tree

- new folder src/ to hold the source code for main project applications
- main.c is in src/
- all core files are subfolder are in src/core/
- modules are in src/modules/
- libs are in src/lib/
- application Makefiles are in src/
- application binary is built in src/ (src/kamailio)

Daniel-Constantin Mierla authored on 07/12/2016 11:03:51
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,204 +0,0 @@
1
-/* 
2
- * Generic Parameter Parser
3
- *
4
- * Copyright (C) 2001-2003 FhG Fokus
5
- *
6
- * This file is part of Kamailio, a free SIP server.
7
- *
8
- * Kamailio is free software; you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License as published by
10
- * the Free Software Foundation; either version 2 of the License, or
11
- * (at your option) any later version
12
- *
13
- * Kamailio is distributed in the hope that it will be useful,
14
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
- * GNU General Public License for more details.
17
- *
18
- * You should have received a copy of the GNU General Public License 
19
- * along with this program; if not, write to the Free Software 
20
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
21
- *
22
- */
23
-
24
-/*! \file
25
- * \brief Parser :: Generic Parameter Parser
26
- *
27
- * \ingroup parser
28
- */
29
-
30
-
31
-#ifndef PARSE_PARAM_H
32
-#define PARSE_PARAM_H
33
-
34
-#include <stdio.h>
35
-
36
-#include "../str.h"
37
-
38
-/*! \brief
39
- * Supported types of parameters
40
- */
41
-typedef enum ptype {
42
-	P_OTHER = 0, /*!< Unknown parameter */
43
-	P_Q,         /*!< Contact: q parameter */
44
-	P_EXPIRES,   /*!< Contact: expires parameter */
45
-	P_METHODS,   /*!< Contact: methods parameter */
46
-	P_RECEIVED,  /*!< Contact: received parameter */
47
-	P_TRANSPORT, /*!< URI: transport parameter */
48
-	P_LR,        /*!< URI: lr parameter */
49
-	P_R2,        /*!< URI: r2 parameter (ser specific) */
50
-	P_MADDR,     /*!< URI: maddr parameter */
51
-	P_TTL,       /*!< URI: ttl parameter */
52
-	P_DSTIP,     /*!< URI: dstip parameter */
53
-	P_DSTPORT,   /*!< URi: dstport parameter */
54
-	P_INSTANCE,  /*!< Contact: sip.instance parameter */
55
-	P_REG_ID,    /*!< Contact: reg-id parameter */
56
-	P_FTAG,      /*!< URI: ftag parameter */
57
-	P_CALL_ID,   /*!< Dialog event package: call-id */
58
-	P_FROM_TAG,  /*!< Dialog event package: from-tag */
59
-	P_TO_TAG,    /*!< Dialog event package: to-tag */
60
-	P_ISD,       /*!< Dialog event package: include-session-description */
61
-	P_SLA,       /*!< Dialog event package: sla */
62
-	P_MA,        /*!< Dialog event package: ma */
63
-	P_OB         /*!< Contact|URI: ob parameter */
64
-} ptype_t;
65
-
66
-
67
-/*! \brief
68
- * Class of parameters
69
- */
70
-typedef enum pclass {
71
-	CLASS_ANY = 0,      /*!< Any parameters, well-known hooks will be not used */
72
-	CLASS_CONTACT,      /*!< Contact parameters */
73
-	CLASS_URI,          /*!< URI parameters */
74
-	CLASS_EVENT_DIALOG  /*!< Event dialog parameters */
75
-} pclass_t;
76
-
77
-
78
-/*! \brief
79
- * Structure representing a parameter
80
- */
81
-typedef struct param {
82
-	ptype_t type;         /*!< Type of the parameter */
83
-	str name;             /*!< Parameter name */
84
-	str body;             /*!< Parameter body */
85
-	int len;              /*!< Total length of the parameter including = and quotes */
86
-	struct param* next;   /*!< Next parameter in the list */
87
-} param_t;
88
-
89
-
90
-/*! \brief
91
- * Hooks to well known parameters for contact class of parameters
92
- */
93
-struct contact_hooks {
94
-	struct param* expires;  /*!< expires parameter */
95
-	struct param* q;        /*!< q parameter */
96
-	struct param* methods;  /*!< methods parameter */
97
-	struct param* received; /*!< received parameter */
98
-	struct param* instance; /*!< sip.instance parameter */
99
-	struct param* reg_id;   /*!< reg-id parameter */
100
-	struct param* ob;       /*!< ob parameter */
101
-};
102
-
103
-
104
-/*! \brief
105
- * Hooks to well known parameter for URI class of parameters
106
- */
107
-struct uri_hooks {
108
-	struct param* transport; /*!< transport parameter */
109
-	struct param* lr;        /*!< lr parameter */
110
-	struct param* r2;        /*!< r2 parameter */
111
-	struct param* maddr;     /*!< maddr parameter */
112
-	struct param* ttl;       /*!< ttl parameter */
113
-	struct param* dstip;     /*!< Destination IP */
114
-	struct param* dstport;   /*!< Destination port */
115
-	struct param* ftag;      /*!< From tag in the original request */
116
-	struct param* ob;        /*!< ob parameter */
117
-};
118
-
119
-
120
-struct event_dialog_hooks {
121
-	struct param* call_id;
122
-	struct param* from_tag;
123
-	struct param* to_tag;
124
-	struct param* include_session_description;
125
-	struct param* sla;
126
-	struct param* ma;
127
-};
128
-
129
-/*! \brief
130
- * Union of hooks structures for all classes
131
- */
132
-typedef union param_hooks {
133
-	struct contact_hooks contact; /*!< Contact hooks */
134
-	struct uri_hooks uri;         /*!< URI hooks */
135
-	struct event_dialog_hooks event_dialog;
136
-} param_hooks_t;
137
-
138
-/*! \brief
139
- * Only parse one parameter
140
- * @return:
141
- * 	t: out parameter
142
- * 	-1: on error
143
- * 	0: success, but expect a next paramter
144
- * 	1: success and exepect no more parameters
145
- */
146
-extern int parse_param(str *_s, pclass_t _c, param_hooks_t *_h, param_t *t);
147
-
148
-
149
-/*! \brief
150
- * Parse parameters
151
- *  \param _s is string containing parameters
152
- *  \param _c is class of parameters
153
- *  \param _h is pointer to structure that will be filled with pointer to well known parameters
154
- * linked list of parsed parameters will be stored in the variable _p is pointing to
155
- * \return The function returns 0 on success and negative number
156
- * on an error
157
- */
158
-int parse_params(str* _s, pclass_t _c, param_hooks_t* _h, param_t** _p);
159
-
160
-/*! \brief
161
- * Parse parameters
162
- *  \param _s is string containing parameters
163
- *  \param _c is class of parameters
164
- *  \param _h is pointer to structure that will be filled with pointer to well known parameters
165
- * linked list of parsed parameters will be stored in the variable _p is pointing to
166
- * \param separator single character separator
167
- * \return The function returns 0 on success and negative number
168
- * on an error
169
- */
170
-int parse_params2(str* _s, pclass_t _c, param_hooks_t* _h, param_t** _p,
171
-			char separator);
172
-
173
-
174
-/*! \brief
175
- * Free linked list of parameters
176
- */
177
-void free_params(param_t* _p);
178
-
179
-
180
-/*! \brief
181
- * Free linked list of parameters from shared memory
182
- */
183
-void shm_free_params(param_t* _p);
184
-
185
-
186
-/*! \brief
187
- * Print linked list of parameters, just for debugging
188
- */
189
-void print_params(FILE* _o, param_t* _p);
190
-
191
-
192
-/*! \brief
193
- * Duplicate linked list of parameters
194
- */
195
-int duplicate_params(param_t** _n, param_t* _p);
196
-
197
-
198
-/*! \brief
199
- * Duplicate linked list of parameters
200
- */
201
-int shm_duplicate_params(param_t** _n, param_t* _p);
202
-
203
-
204
-#endif /* PARSE_PARAM_H */
Browse code

core: parser - remove inline for parse_param()

- it gets recent compiler warnings when is an extern object
- reported by Victor Seva, GH#286

Daniel-Constantin Mierla authored on 02/11/2015 15:19:44
Showing 1 changed files
... ...
@@ -143,7 +143,7 @@ typedef union param_hooks {
143 143
  * 	0: success, but expect a next paramter
144 144
  * 	1: success and exepect no more parameters
145 145
  */
146
-extern inline int parse_param(str *_s, pclass_t _c, param_hooks_t *_h, param_t *t);
146
+extern int parse_param(str *_s, pclass_t _c, param_hooks_t *_h, param_t *t);
147 147
 
148 148
 
149 149
 /*! \brief
Browse code

core parser - remove svn ID, remove history, change "ser" => "Kamailio"

Olle E. Johansson authored on 18/01/2015 19:36:18
Showing 1 changed files
... ...
@@ -3,19 +3,14 @@
3 3
  *
4 4
  * Copyright (C) 2001-2003 FhG Fokus
5 5
  *
6
- * This file is part of ser, a free SIP server.
6
+ * This file is part of Kamailio, a free SIP server.
7 7
  *
8
- * ser is free software; you can redistribute it and/or modify
8
+ * Kamailio 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
- * For a license to use the ser software under conditions
14
- * other than those described here, or to purchase support for this
15
- * software, please contact iptel.org by e-mail at the following addresses:
16
- *    info@iptel.org
17
- *
18
- * ser is distributed in the hope that it will be useful,
13
+ * Kamailio is distributed in the hope that it will be useful,
19 14
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 15
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 16
  * GNU General Public License for more details.
... ...
@@ -24,11 +19,6 @@
24 19
  * along with this program; if not, write to the Free Software 
25 20
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
26 21
  *
27
- * History:
28
- * -------
29
- * 2003-03-24 Created by janakj
30
- * 2003-04-07 shm duplication support (janakj)
31
- * 2003-04-07 URI class added (janakj)
32 22
  */
33 23
 
34 24
 /*! \file
Browse code

all: updated FSF address in GPL text

Anthony Messina authored on 04/07/2014 09:36:37 • Daniel-Constantin Mierla committed on 04/07/2014 09:37:36
Showing 1 changed files
... ...
@@ -22,7 +22,7 @@
22 22
  *
23 23
  * You should have received a copy of the GNU General Public License 
24 24
  * along with this program; if not, write to the Free Software 
25
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
25
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
26 26
  *
27 27
  * History:
28 28
  * -------
Browse code

core: updated parse_param so that the delimiter for parameters can be user-defined

Peter Dunkley authored on 25/09/2013 15:11:23
Showing 1 changed files
... ...
@@ -167,6 +167,19 @@ extern inline int parse_param(str *_s, pclass_t _c, param_hooks_t *_h, param_t *
167 167
  */
168 168
 int parse_params(str* _s, pclass_t _c, param_hooks_t* _h, param_t** _p);
169 169
 
170
+/*! \brief
171
+ * Parse parameters
172
+ *  \param _s is string containing parameters
173
+ *  \param _c is class of parameters
174
+ *  \param _h is pointer to structure that will be filled with pointer to well known parameters
175
+ * linked list of parsed parameters will be stored in the variable _p is pointing to
176
+ * \param separator single character separator
177
+ * \return The function returns 0 on success and negative number
178
+ * on an error
179
+ */
180
+int parse_params2(str* _s, pclass_t _c, param_hooks_t* _h, param_t** _p,
181
+			char separator);
182
+
170 183
 
171 184
 /*! \brief
172 185
  * Free linked list of parameters
Browse code

core: added parsing of ;ob for URIs and Contact: headers

Peter Dunkley authored on 31/12/2012 15:35:32
Showing 1 changed files
... ...
@@ -69,7 +69,8 @@ typedef enum ptype {
69 69
 	P_TO_TAG,    /*!< Dialog event package: to-tag */
70 70
 	P_ISD,       /*!< Dialog event package: include-session-description */
71 71
 	P_SLA,       /*!< Dialog event package: sla */
72
-	P_MA         /*!< Dialog event package: ma */
72
+	P_MA,        /*!< Dialog event package: ma */
73
+	P_OB         /*!< Contact|URI: ob parameter */
73 74
 } ptype_t;
74 75
 
75 76
 
... ...
@@ -106,6 +107,7 @@ struct contact_hooks {
106 107
 	struct param* received; /*!< received parameter */
107 108
 	struct param* instance; /*!< sip.instance parameter */
108 109
 	struct param* reg_id;   /*!< reg-id parameter */
110
+	struct param* ob;       /*!< ob parameter */
109 111
 };
110 112
 
111 113
 
... ...
@@ -121,6 +123,7 @@ struct uri_hooks {
121 123
 	struct param* dstip;     /*!< Destination IP */
122 124
 	struct param* dstport;   /*!< Destination port */
123 125
 	struct param* ftag;      /*!< From tag in the original request */
126
+	struct param* ob;        /*!< ob parameter */
124 127
 };
125 128
 
126 129
 
Browse code

core: Fixed inline function declaration for non-gcc linkers

usage of either 'extern inline' or 'static inline' depending on function scope is recommended

Marius Zbihlei authored on 14/09/2012 10:15:47
Showing 1 changed files
... ...
@@ -150,7 +150,7 @@ typedef union param_hooks {
150 150
  * 	0: success, but expect a next paramter
151 151
  * 	1: success and exepect no more parameters
152 152
  */
153
-inline int parse_param(str *_s, pclass_t _c, param_hooks_t *_h, param_t *t);
153
+extern inline int parse_param(str *_s, pclass_t _c, param_hooks_t *_h, param_t *t);
154 154
 
155 155
 
156 156
 /*! \brief
Browse code

parser: added hook for reg-id param of Contact header

Daniel-Constantin Mierla authored on 16/04/2012 22:16:52
Showing 1 changed files
... ...
@@ -62,6 +62,7 @@ typedef enum ptype {
62 62
 	P_DSTIP,     /*!< URI: dstip parameter */
63 63
 	P_DSTPORT,   /*!< URi: dstport parameter */
64 64
 	P_INSTANCE,  /*!< Contact: sip.instance parameter */
65
+	P_REG_ID,    /*!< Contact: reg-id parameter */
65 66
 	P_FTAG,      /*!< URI: ftag parameter */
66 67
 	P_CALL_ID,   /*!< Dialog event package: call-id */
67 68
 	P_FROM_TAG,  /*!< Dialog event package: from-tag */
... ...
@@ -104,6 +105,7 @@ struct contact_hooks {
104 105
 	struct param* methods;  /*!< methods parameter */
105 106
 	struct param* received; /*!< received parameter */
106 107
 	struct param* instance; /*!< sip.instance parameter */
108
+	struct param* reg_id;   /*!< reg-id parameter */
107 109
 };
108 110
 
109 111
 
Browse code

core: include str.h in parse_param.h to avoid compile errors

- it happened when parse_param.h is used first, alone or without any
predecessors including str.h

Daniel-Constantin Mierla authored on 27/03/2012 11:56:32
Showing 1 changed files
... ...
@@ -43,6 +43,7 @@
43 43
 
44 44
 #include <stdio.h>
45 45
 
46
+#include "../str.h"
46 47
 
47 48
 /*! \brief
48 49
  * Supported types of parameters
Browse code

doxygen documentation fixes

Henning Westerholt authored on 27/07/2011 22:22:09
Showing 1 changed files
... ...
@@ -1,6 +1,4 @@
1 1
 /* 
2
- * $Id$
3
- *
4 2
  * Generic Parameter Parser
5 3
  *
6 4
  * Copyright (C) 2001-2003 FhG Fokus
... ...
@@ -143,7 +141,7 @@ typedef union param_hooks {
143 141
 
144 142
 /*! \brief
145 143
  * Only parse one parameter
146
- * @Return:
144
+ * @return:
147 145
  * 	t: out parameter
148 146
  * 	-1: on error
149 147
  * 	0: success, but expect a next paramter
... ...
@@ -157,8 +155,7 @@ inline int parse_param(str *_s, pclass_t _c, param_hooks_t *_h, param_t *t);
157 155
  *  \param _s is string containing parameters
158 156
  *  \param _c is class of parameters
159 157
  *  \param _h is pointer to structure that will be filled with pointer to well known parameters
160
- * linked list of parsed parameters will be stored in
161
- * the variable _p is pointing to
158
+ * linked list of parsed parameters will be stored in the variable _p is pointing to
162 159
  * \return The function returns 0 on success and negative number
163 160
  * on an error
164 161
  */
Browse code

Merge remote branch 'origin/sr_3.0'

latest sr_3.0 and kamailio_3.0 backports

* origin/sr_3.0: (90 commits)
usrloc(k): rpc version for ul.dump
core: init the len of sock_str attribute
ctl: added parameters to control buffer size
htable(k): rpc commad to dump htable
pv(k): fixed $shv engine
sanity: print From hdr in warning message
nathelper(k): print bad contact uri
core: more verbose when error parsing hdr
kamailio.cfg: updated cfg with sample PSTN gw routing
nathelper(k): fix for swap scenario
presence(k): aliased MLA to SLA
core: event parsing enahced for dialog;ma
tm: documented t_relay_to() function
tm: added t_relay_to(proxy, flags)
tm: documented t_replicate() functions
tm: t_replicate() can take avps & select as params
tm: added t_replicate(uri)
db_oracle: use PARAM_TYPE_MASK when checking param type
snmpstats: fix param type checking
core: define module_loaded to use find_module_by_name
...

Conflicts:
lib/srdb1/schema/dr_gateways.xml
lib/srdb1/schema/dr_groups.xml
lib/srdb1/schema/dr_gw_lists.xml
lib/srdb1/schema/dr_rules.xml
lib/srdb1/schema/kamailio-drouting.xml
modules/ctl/README
modules/topoh/README
modules_k/uac/auth.c
modules_k/uac/uac_send.c
parser/parse_param.h
utils/kamctl/mysql/drouting-create.sql
utils/kamctl/oracle/drouting-create.sql
utils/kamctl/postgres/drouting-create.sql

Andrei Pelinescu-Onciul authored on 27/01/2010 10:31:25
Showing 0 changed files
Browse code

core: event parsing enahced for dialog;ma

- event defined by draft-anil-sipping-bla for Multiple Line Appearances,
folloing to Shared/Bridged Line Appearances (SLA, BLA)
- draft is defunct but still some implementations out there
(cherry picked from commit 1e99795d2ddebe8a6794c3b407f96d30378b872f)

Daniel-Constantin Mierla authored on 06/01/2010 17:47:36 • Andrei Pelinescu-Onciul committed on 15/01/2010 13:30:17
Showing 1 changed files
... ...
@@ -61,7 +61,8 @@ typedef enum ptype {
61 61
 	P_FROM_TAG,  /* Dialog event package: from-tag */
62 62
 	P_TO_TAG,    /* Dialog event package: to-tag */
63 63
 	P_ISD,       /* Dialog event package: include-session-description */
64
-	P_SLA        /* Dialog event package: sla */
64
+	P_SLA,       /* Dialog event package: sla */
65
+	P_MA         /* Dialog event package: ma */
65 66
 } ptype_t;
66 67
 
67 68
 
... ...
@@ -121,6 +122,7 @@ struct event_dialog_hooks {
121 122
 	struct param* to_tag;
122 123
 	struct param* include_session_description;
123 124
 	struct param* sla;
125
+	struct param* ma;
124 126
 };
125 127
 
126 128
 /*
Browse code

Doxygen changes

oej authored on 25/10/2009 18:30:31
Showing 1 changed files
... ...
@@ -33,85 +33,92 @@
33 33
  * 2003-04-07 URI class added (janakj)
34 34
  */
35 35
 
36
+/*! \file
37
+ * \brief Parser :: Generic Parameter Parser
38
+ *
39
+ * \ingroup parser
40
+ */
41
+
42
+
36 43
 #ifndef PARSE_PARAM_H
37 44
 #define PARSE_PARAM_H
38 45
 
39 46
 #include <stdio.h>
40 47
 
41 48
 
42
-/*
49
+/*! \brief
43 50
  * Supported types of parameters
44 51
  */
45 52
 typedef enum ptype {
46
-	P_OTHER = 0, /* Unknown parameter */
47
-	P_Q,         /* Contact: q parameter */
48
-	P_EXPIRES,   /* Contact: expires parameter */
49
-	P_METHODS,   /* Contact: methods parameter */
50
-	P_RECEIVED,  /* Contact: received parameter */
51
-	P_TRANSPORT, /* URI: transport parameter */
52
-	P_LR,        /* URI: lr parameter */
53
-	P_R2,        /* URI: r2 parameter (ser specific) */
54
-	P_MADDR,     /* URI: maddr parameter */
55
-	P_TTL,       /* URI: ttl parameter */
56
-	P_DSTIP,     /* URI: dstip parameter */
57
-	P_DSTPORT,   /* URi: dstport parameter */
58
-	P_INSTANCE,  /* Contact: sip.instance parameter */
59
-	P_FTAG,      /* URI: ftag parameter */
60
-	P_CALL_ID,   /* Dialog event package: call-id */
61
-	P_FROM_TAG,  /* Dialog event package: from-tag */
62
-	P_TO_TAG,    /* Dialog event package: to-tag */
63
-	P_ISD,       /* Dialog event package: include-session-description */
64
-	P_SLA        /* Dialog event package: sla */
53
+	P_OTHER = 0, /*!< Unknown parameter */
54
+	P_Q,         /*!< Contact: q parameter */
55
+	P_EXPIRES,   /*!< Contact: expires parameter */
56
+	P_METHODS,   /*!< Contact: methods parameter */
57
+	P_RECEIVED,  /*!< Contact: received parameter */
58
+	P_TRANSPORT, /*!< URI: transport parameter */
59
+	P_LR,        /*!< URI: lr parameter */
60
+	P_R2,        /*!< URI: r2 parameter (ser specific) */
61
+	P_MADDR,     /*!< URI: maddr parameter */
62
+	P_TTL,       /*!< URI: ttl parameter */
63
+	P_DSTIP,     /*!< URI: dstip parameter */
64
+	P_DSTPORT,   /*!< URi: dstport parameter */
65
+	P_INSTANCE,  /*!< Contact: sip.instance parameter */
66
+	P_FTAG,      /*!< URI: ftag parameter */
67
+	P_CALL_ID,   /*!< Dialog event package: call-id */
68
+	P_FROM_TAG,  /*!< Dialog event package: from-tag */
69
+	P_TO_TAG,    /*!< Dialog event package: to-tag */
70
+	P_ISD,       /*!< Dialog event package: include-session-description */
71
+	P_SLA        /*!< Dialog event package: sla */
65 72
 } ptype_t;
66 73
 
67 74
 
68
-/*
75
+/*! \brief
69 76
  * Class of parameters
70 77
  */
71 78
 typedef enum pclass {
72
-	CLASS_ANY = 0,      /* Any parameters, well-known hooks will be not used */
73
-	CLASS_CONTACT,      /* Contact parameters */
74
-	CLASS_URI,          /* URI parameters */
75
-	CLASS_EVENT_DIALOG  /* Event dialog parameters */
79
+	CLASS_ANY = 0,      /*!< Any parameters, well-known hooks will be not used */
80
+	CLASS_CONTACT,      /*!< Contact parameters */
81
+	CLASS_URI,          /*!< URI parameters */
82
+	CLASS_EVENT_DIALOG  /*!< Event dialog parameters */
76 83
 } pclass_t;
77 84
 
78 85
 
79
-/*
86
+/*! \brief
80 87
  * Structure representing a parameter
81 88
  */
82 89
 typedef struct param {
83
-	ptype_t type;         /* Type of the parameter */
84
-	str name;             /* Parameter name */
85
-	str body;             /* Parameter body */
86
-	int len;              /* Total length of the parameter including = and quotes */
87
-	struct param* next;   /* Next parameter in the list */
90
+	ptype_t type;         /*!< Type of the parameter */
91
+	str name;             /*!< Parameter name */
92
+	str body;             /*!< Parameter body */
93
+	int len;              /*!< Total length of the parameter including = and quotes */
94
+	struct param* next;   /*!< Next parameter in the list */
88 95
 } param_t;
89 96
 
90 97
 
91
-/*
98
+/*! \brief
92 99
  * Hooks to well known parameters for contact class of parameters
93 100
  */
94 101
 struct contact_hooks {
95
-	struct param* expires;  /* expires parameter */
96
-	struct param* q;        /* q parameter */
97
-	struct param* methods;  /* methods parameter */
98
-	struct param* received; /* received parameter */
99
-	struct param* instance; /* sip.instance parameter */
102
+	struct param* expires;  /*!< expires parameter */
103
+	struct param* q;        /*!< q parameter */
104
+	struct param* methods;  /*!< methods parameter */
105
+	struct param* received; /*!< received parameter */
106
+	struct param* instance; /*!< sip.instance parameter */
100 107
 };
101 108
 
102 109
 
103
-/*
110
+/*! \brief
104 111
  * Hooks to well known parameter for URI class of parameters
105 112
  */
106 113
 struct uri_hooks {
107
-	struct param* transport; /* transport parameter */
108
-	struct param* lr;        /* lr parameter */
109
-	struct param* r2;        /* r2 parameter */
110
-	struct param* maddr;     /* maddr parameter */
111
-	struct param* ttl;       /* ttl parameter */
112
-	struct param* dstip;     /* Destination IP */
113
-	struct param* dstport;   /* Destination port */
114
-	struct param* ftag;      /* From tag in the original request */
114
+	struct param* transport; /*!< transport parameter */
115
+	struct param* lr;        /*!< lr parameter */
116
+	struct param* r2;        /*!< r2 parameter */
117
+	struct param* maddr;     /*!< maddr parameter */
118
+	struct param* ttl;       /*!< ttl parameter */
119
+	struct param* dstip;     /*!< Destination IP */
120
+	struct param* dstport;   /*!< Destination port */
121
+	struct param* ftag;      /*!< From tag in the original request */
115 122
 };
116 123
 
117 124
 
... ...
@@ -123,16 +130,16 @@ struct event_dialog_hooks {
123 130
 	struct param* sla;
124 131
 };
125 132
 
126
-/*
133
+/*! \brief
127 134
  * Union of hooks structures for all classes
128 135
  */
129 136
 typedef union param_hooks {
130
-	struct contact_hooks contact; /* Contact hooks */
131
-	struct uri_hooks uri;         /* URI hooks */
137
+	struct contact_hooks contact; /*!< Contact hooks */
138
+	struct uri_hooks uri;         /*!< URI hooks */
132 139
 	struct event_dialog_hooks event_dialog;
133 140
 } param_hooks_t;
134 141
 
135
-/**
142
+/*! \brief
136 143
  * Only parse one parameter
137 144
  * @Return:
138 145
  * 	t: out parameter
... ...
@@ -143,44 +150,44 @@ typedef union param_hooks {
143 150
 inline int parse_param(str *_s, pclass_t _c, param_hooks_t *_h, param_t *t);
144 151
 
145 152
 
146
-/*
153
+/*! \brief
147 154
  * Parse parameters
148
- * _s is string containing parameters
149
- * _c is class of parameters
150
- * _h is pointer to structure that will be filled with pointer to well known parameters
155
+ *  \param _s is string containing parameters
156
+ *  \param _c is class of parameters
157
+ *  \param _h is pointer to structure that will be filled with pointer to well known parameters
151 158
  * linked list of parsed parameters will be stored in
152 159
  * the variable _p is pointing to
153
- * The function returns 0 on success and negative number
160
+ * \return The function returns 0 on success and negative number
154 161
  * on an error
155 162
  */
156 163
 int parse_params(str* _s, pclass_t _c, param_hooks_t* _h, param_t** _p);
157 164
 
158 165
 
159
-/*
166
+/*! \brief
160 167
  * Free linked list of parameters
161 168
  */
162 169
 void free_params(param_t* _p);
163 170
 
164 171
 
165
-/*
172
+/*! \brief
166 173
  * Free linked list of parameters from shared memory
167 174
  */
168 175
 void shm_free_params(param_t* _p);
169 176
 
170 177
 
171
-/*
178
+/*! \brief
172 179
  * Print linked list of parameters, just for debugging
173 180
  */
174 181
 void print_params(FILE* _o, param_t* _p);
175 182
 
176 183
 
177
-/*
184
+/*! \brief
178 185
  * Duplicate linked list of parameters
179 186
  */
180 187
 int duplicate_params(param_t** _n, param_t* _p);
181 188
 
182 189
 
183
-/*
190
+/*! \brief
184 191
  * Duplicate linked list of parameters
185 192
  */
186 193
 int shm_duplicate_params(param_t** _n, param_t* _p);
Browse code

Merge commit 'origin/ser_core_cvs'

* commit 'origin/ser_core_cvs':
tcp: minor optimization
sercmd: minor makefile fix
tcp internal: send timeout is now kept only in ticks
core: typo fix
tcp: typo & minor optimization
Rename Contact parameter select 'method' to 'methods'
Rename Contact parameter 'method' to 'methods'
make install: avoid re-linking lib dependent modules
build system: avoid libraries re-compiling
fixing missing $ in ser_mysql.sh script
Debian packaging - fixing path to mysql sql files in my_create.sh script
The fixup function prototypes of the config variables have been
Strip, prefix, rewriteuser, ... all the SET_* actions preserve the
core: check & fix Content-Length when sending on tcp
tcp: config option for the async write block size
tcp: config option for the read buffer size
tcp: dyn. config fix for tcp_con_lifetime
tcp: diff. connect timeout for async & states cleanup

Conflicts:
Makefile.rules
action.c
cfg.lex
cfg.y
route_struct.h

Andrei Pelinescu-Onciul authored on 20/03/2009 20:47:32
Showing 0 changed files
Browse code

Rename Contact parameter 'method' to 'methods'

According RFC3840 the correct name of the parameter is 'methods',
not 'method'.

Reported by Daniel-Constantin Mierla

Jan Janak authored on 19/03/2009 15:15:04
Showing 1 changed files
... ...
@@ -46,7 +46,7 @@ typedef enum ptype {
46 46
 	P_OTHER = 0, /* Unknown parameter */
47 47
 	P_Q,         /* Contact: q parameter */
48 48
 	P_EXPIRES,   /* Contact: expires parameter */
49
-	P_METHOD,    /* Contact: method parameter */
49
+	P_METHODS,   /* Contact: methods parameter */
50 50
 	P_RECEIVED,  /* Contact: received parameter */
51 51
 	P_TRANSPORT, /* URI: transport parameter */
52 52
 	P_LR,        /* URI: lr parameter */
... ...
@@ -88,7 +88,7 @@ typedef struct param {
88 88
 struct contact_hooks {
89 89
 	struct param* expires;  /* expires parameter */
90 90
 	struct param* q;        /* q parameter */
91
-	struct param* method;   /* method parameter */
91
+	struct param* methods;  /* methods parameter */
92 92
 	struct param* received; /* received parameter */
93 93
 	struct param* instance; /* sip.instance parameter */
94 94
 };
Browse code

Extend the parser parameter with support for dialog event parameters.

This patch extends the generic parameter parser in the sip-router core
with support for the following dialog event package parameters: call-id,
from-tag, to-tag, include-session-description, and sla.

The patch introduces a new parameter class called CLASS_EVENT_DIALOG
which can be used to instruct the parser to look for the well-known
parameters above.

It also adds a new parameter hook structure called event_dialog_hooks
which will be filled with pointers to the well known parameters if
the are found in the parsed string.

Jan Janak authored on 17/03/2009 16:17:44
Showing 1 changed files
... ...
@@ -56,7 +56,12 @@ typedef enum ptype {
56 56
 	P_DSTIP,     /* URI: dstip parameter */
57 57
 	P_DSTPORT,   /* URi: dstport parameter */
58 58
 	P_INSTANCE,  /* Contact: sip.instance parameter */
59
-	P_FTAG       /* URI: ftag parameter */
59
+	P_FTAG,      /* URI: ftag parameter */
60
+	P_CALL_ID,   /* Dialog event package: call-id */
61
+	P_FROM_TAG,  /* Dialog event package: from-tag */
62
+	P_TO_TAG,    /* Dialog event package: to-tag */
63
+	P_ISD,       /* Dialog event package: include-session-description */
64
+	P_SLA        /* Dialog event package: sla */
60 65
 } ptype_t;
61 66
 
62 67
 
... ...
@@ -64,9 +69,10 @@ typedef enum ptype {
64 69
  * Class of parameters
65 70
  */
66 71
 typedef enum pclass {
67
-	CLASS_ANY = 0,  /* Any parameters, well-known hooks will be not used */
68
-	CLASS_CONTACT,  /* Contact parameters */
69
-	CLASS_URI       /* URI parameters */
72
+	CLASS_ANY = 0,      /* Any parameters, well-known hooks will be not used */
73
+	CLASS_CONTACT,      /* Contact parameters */
74
+	CLASS_URI,          /* URI parameters */
75
+	CLASS_EVENT_DIALOG  /* Event dialog parameters */
70 76
 } pclass_t;
71 77
 
72 78
 
... ...
@@ -109,12 +115,21 @@ struct uri_hooks {
109 115
 };
110 116
 
111 117
 
118
+struct event_dialog_hooks {
119
+	struct param* call_id;
120
+	struct param* from_tag;
121
+	struct param* to_tag;
122
+	struct param* include_session_description;
123
+	struct param* sla;
124
+};
125
+
112 126
 /*
113 127
  * Union of hooks structures for all classes
114 128
  */
115 129
 typedef union param_hooks {
116 130
 	struct contact_hooks contact; /* Contact hooks */
117 131
 	struct uri_hooks uri;         /* URI hooks */
132
+	struct event_dialog_hooks event_dialog;
118 133
 } param_hooks_t;
119 134
 
120 135
 /**
Browse code

- wrong parameter length fixed, fix provided by Bogdan Pintea closes SER-135

Jan Janak authored on 22/11/2006 17:56:15
Showing 1 changed files
... ...
@@ -117,6 +117,16 @@ typedef union param_hooks {
117 117
 	struct uri_hooks uri;         /* URI hooks */
118 118
 } param_hooks_t;
119 119
 
120
+/**
121
+ * Only parse one parameter
122
+ * @Return:
123
+ * 	t: out parameter
124
+ * 	-1: on error
125
+ * 	0: success, but expect a next paramter
126
+ * 	1: success and exepect no more parameters
127
+ */
128
+inline int parse_param(str *_s, pclass_t _c, param_hooks_t *_h, param_t *t);
129
+
120 130
 
121 131
 /*
122 132
  * Parse parameters
Browse code

- ftag parameter support

Jan Janak authored on 25/12/2005 18:43:17
Showing 1 changed files
... ...
@@ -56,6 +56,7 @@ typedef enum ptype {
56 56
 	P_DSTIP,     /* URI: dstip parameter */
57 57
 	P_DSTPORT,   /* URi: dstport parameter */
58 58
 	P_INSTANCE,  /* Contact: sip.instance parameter */
59
+	P_FTAG       /* URI: ftag parameter */
59 60
 } ptype_t;
60 61
 
61 62
 
... ...
@@ -104,6 +105,7 @@ struct uri_hooks {
104 105
 	struct param* ttl;       /* ttl parameter */
105 106
 	struct param* dstip;     /* Destination IP */
106 107
 	struct param* dstport;   /* Destination port */
108
+	struct param* ftag;      /* From tag in the original request */
107 109
 };
108 110
 
109 111
 
Browse code

- sip.instance parameter support by Nils Ohlmeier

Jan Janak authored on 02/09/2005 10:36:15
Showing 1 changed files
... ...
@@ -55,6 +55,7 @@ typedef enum ptype {
55 55
 	P_TTL,       /* URI: ttl parameter */
56 56
 	P_DSTIP,     /* URI: dstip parameter */
57 57
 	P_DSTPORT,   /* URi: dstport parameter */
58
+	P_INSTANCE,  /* Contact: sip.instance parameter */
58 59
 } ptype_t;
59 60
 
60 61
 
... ...
@@ -88,6 +89,7 @@ struct contact_hooks {
88 89
 	struct param* q;        /* q parameter */
89 90
 	struct param* method;   /* method parameter */
90 91
 	struct param* received; /* received parameter */
92
+	struct param* instance; /* sip.instance parameter */
91 93
 };
92 94
 
93 95
 
Browse code

- Support for dstip and dstport in the parameter parser

Jan Janak authored on 26/02/2005 15:27:03
Showing 1 changed files
... ...
@@ -53,6 +53,8 @@ typedef enum ptype {
53 53
 	P_R2,        /* URI: r2 parameter (ser specific) */
54 54
 	P_MADDR,     /* URI: maddr parameter */
55 55
 	P_TTL,       /* URI: ttl parameter */
56
+	P_DSTIP,     /* URI: dstip parameter */
57
+	P_DSTPORT,   /* URi: dstport parameter */
56 58
 } ptype_t;
57 59
 
58 60
 
... ...
@@ -98,6 +100,8 @@ struct uri_hooks {
98 100
 	struct param* r2;        /* r2 parameter */
99 101
 	struct param* maddr;     /* maddr parameter */
100 102
 	struct param* ttl;       /* ttl parameter */
103
+	struct param* dstip;     /* Destination IP */
104
+	struct param* dstport;   /* Destination port */
101 105
 };
102 106
 
103 107
 
Browse code

Contact header field parser extended to parse "received" parameter.

Jan Janak authored on 01/09/2004 11:56:58
Showing 1 changed files
... ...
@@ -47,6 +47,7 @@ typedef enum ptype {
47 47
 	P_Q,         /* Contact: q parameter */
48 48
 	P_EXPIRES,   /* Contact: expires parameter */
49 49
 	P_METHOD,    /* Contact: method parameter */
50
+	P_RECEIVED,  /* Contact: received parameter */
50 51
 	P_TRANSPORT, /* URI: transport parameter */
51 52
 	P_LR,        /* URI: lr parameter */
52 53
 	P_R2,        /* URI: r2 parameter (ser specific) */
... ...
@@ -81,9 +82,10 @@ typedef struct param {
81 82
  * Hooks to well known parameters for contact class of parameters
82 83
  */
83 84
 struct contact_hooks {
84
-	struct param* expires; /* expires parameter */
85
-	struct param* q;       /* q parameter */
86
-	struct param* method;  /* method parameter */
85
+	struct param* expires;  /* expires parameter */
86
+	struct param* q;        /* q parameter */
87
+	struct param* method;   /* method parameter */
88
+	struct param* received; /* received parameter */
87 89
 };
88 90
 
89 91
 
Browse code

- Spelling checked

Jan Janak authored on 24/08/2004 09:01:24
Showing 1 changed files
... ...
@@ -3,7 +3,7 @@
3 3
  *
4 4
  * Generic Parameter Parser
5 5
  *
6
- * Copyright (C) 2001-2003 Fhg Fokus
6
+ * Copyright (C) 2001-2003 FhG Fokus
7 7
  *
8 8
  * This file is part of ser, a free SIP server.
9 9
  *
... ...
@@ -46,7 +46,7 @@ typedef enum ptype {
46 46
 	P_OTHER = 0, /* Unknown parameter */
47 47
 	P_Q,         /* Contact: q parameter */
48 48
 	P_EXPIRES,   /* Contact: expires parameter */
49
-	P_METHODS,   /* Contact: method parameter */
49
+	P_METHOD,    /* Contact: method parameter */
50 50
 	P_TRANSPORT, /* URI: transport parameter */
51 51
 	P_LR,        /* URI: lr parameter */
52 52
 	P_R2,        /* URI: r2 parameter (ser specific) */
... ...
@@ -72,7 +72,7 @@ typedef struct param {
72 72
 	ptype_t type;         /* Type of the parameter */
73 73
 	str name;             /* Parameter name */
74 74
 	str body;             /* Parameter body */
75
-	int len;              /* Total lenght of the parameter including = and quotes */
75
+	int len;              /* Total length of the parameter including = and quotes */
76 76
 	struct param* next;   /* Next parameter in the list */
77 77
 } param_t;
78 78
 
Browse code

"method" contact parameter should be "methods", fixed by Juha Heinanen.

Jan Janak authored on 13/08/2004 12:07:11
Showing 1 changed files
... ...
@@ -46,7 +46,7 @@ typedef enum ptype {
46 46
 	P_OTHER = 0, /* Unknown parameter */
47 47
 	P_Q,         /* Contact: q parameter */
48 48
 	P_EXPIRES,   /* Contact: expires parameter */
49
-	P_METHOD,    /* Contact: method parameter */
49
+	P_METHODS,   /* Contact: method parameter */
50 50
 	P_TRANSPORT, /* URI: transport parameter */
51 51
 	P_LR,        /* URI: lr parameter */
52 52
 	P_R2,        /* URI: r2 parameter (ser specific) */
Browse code

TTL parameter added

Jan Janak authored on 14/04/2004 19:08:55
Showing 1 changed files
... ...
@@ -50,7 +50,8 @@ typedef enum ptype {
50 50
 	P_TRANSPORT, /* URI: transport parameter */
51 51
 	P_LR,        /* URI: lr parameter */
52 52
 	P_R2,        /* URI: r2 parameter (ser specific) */
53
-	P_MADDR      /* URI: maddr parameter */
53
+	P_MADDR,     /* URI: maddr parameter */
54
+	P_TTL,       /* URI: ttl parameter */
54 55
 } ptype_t;
55 56
 
56 57
 
... ...
@@ -94,6 +95,7 @@ struct uri_hooks {
94 95
 	struct param* lr;        /* lr parameter */
95 96
 	struct param* r2;        /* r2 parameter */
96 97
 	struct param* maddr;     /* maddr parameter */
98
+	struct param* ttl;       /* ttl parameter */
97 99
 };
98 100
 
99 101
 
Browse code

- print_* function don't use stdout anymore

Jan Janak authored on 10/04/2003 12:38:18
Showing 1 changed files
... ...
@@ -36,6 +36,8 @@
36 36
 #ifndef PARSE_PARAM_H
37 37
 #define PARSE_PARAM_H
38 38
 
39
+#include <stdio.h>
40
+
39 41
 
40 42
 /*
41 43
  * Supported types of parameters
... ...
@@ -129,12 +131,10 @@ void free_params(param_t* _p);
129 131
 void shm_free_params(param_t* _p);
130 132
 
131 133
 
132
-
133
-
134 134
 /*
135 135
  * Print linked list of parameters, just for debugging
136 136
  */
137
-void print_params(param_t* _p);
137
+void print_params(FILE* _o, param_t* _p);
138 138
 
139 139
 
140 140
 /*
Browse code

rr parameters removed (they are in URI now)

Jan Janak authored on 07/04/2003 20:47:12
Showing 1 changed files
... ...
@@ -42,8 +42,6 @@
42 42
  */
43 43
 typedef enum ptype {
44 44
 	P_OTHER = 0, /* Unknown parameter */
45
-	P_LR,        /* Route & Record-Route: lr parameter */
46
-	P_R2,        /* Route & Record-Route: r2 parameter - Route & Record-Route */
47 45
 	P_Q,         /* Contact: q parameter */
48 46
 	P_EXPIRES,   /* Contact: expires parameter */
49 47
 	P_METHOD,    /* Contact: method parameter */
... ...
@@ -59,7 +57,6 @@ typedef enum ptype {
59 57
  */
60 58
 typedef enum pclass {
61 59
 	CLASS_ANY = 0,  /* Any parameters, well-known hooks will be not used */
62
-	CLASS_RR,       /* Route & Record-Route parameters */
63 60
 	CLASS_CONTACT,  /* Contact parameters */
64 61
 	CLASS_URI       /* URI parameters */
65 62
 } pclass_t;
... ...
@@ -77,15 +74,6 @@ typedef struct param {
77 74
 } param_t;
78 75
 
79 76
 
80
-/*
81
- * Hooks to well known parameters for Route & Record-Route class of parameters
82
- */
83
-struct rr_hooks {
84
-	struct param* lr; /* lr parameter */
85
-	struct param* r2; /* r2 parameters - ser specific */
86
-};
87
-
88
-
89 77
 /*
90 78
  * Hooks to well known parameters for contact class of parameters
91 79
  */
... ...
@@ -111,7 +99,6 @@ struct uri_hooks {
111 99
  * Union of hooks structures for all classes
112 100
  */
113 101
 typedef union param_hooks {
114
- 	struct rr_hooks rr;           /* Route & Record-Route hooks */
115 102
 	struct contact_hooks contact; /* Contact hooks */
116 103
 	struct uri_hooks uri;         /* URI hooks */
117 104
 } param_hooks_t;
Browse code

- support for URI parameters - recognizes transport, lr, r2, and maddr parameters

Jan Janak authored on 07/04/2003 20:27:37
Showing 1 changed files
... ...
@@ -29,6 +29,8 @@
29 29
  * History:
30 30
  * -------
31 31
  * 2003-03-24 Created by janakj
32
+ * 2003-04-07 shm duplication support (janakj)
33
+ * 2003-04-07 URI class added (janakj)
32 34
  */
33 35
 
34 36
 #ifndef PARSE_PARAM_H
... ...
@@ -44,7 +46,11 @@ typedef enum ptype {
44 46
 	P_R2,        /* Route & Record-Route: r2 parameter - Route & Record-Route */
45 47
 	P_Q,         /* Contact: q parameter */
46 48
 	P_EXPIRES,   /* Contact: expires parameter */
47
-	P_METHOD     /* Contact: method parameter */