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,183 +0,0 @@
1
-/*
2
- * Copyright (C) 2001-2003 FhG Fokus
3
- *
4
- * This file is part of Kamailio, a free SIP server.
5
- *
6
- * Kamailio is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation; either version 2 of the License, or
9
- * (at your option) any later version
10
- *
11
- * Kamailio is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
- * GNU General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU General Public License 
17
- * along with this program; if not, write to the Free Software 
18
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
19
- *
20
- */
21
-
22
-/*!
23
-* \file
24
-* \brief Kamailio core :: Message translations
25
-* \author jiri
26
-* \ingroup core
27
-* Module: \ref core
28
-*/
29
-
30
-
31
-#ifndef  _MSG_TRANSLATOR_H
32
-#define _MSG_TRANSLATOR_H
33
-
34
-/* flags used for process_lumps flag parameter */
35
-#define FLAG_MSG_LUMPS_ONLY     0   /* copy just the lumps */
36
-#define FLAG_MSG_ALL            1   /* copy all the msg */
37
-
38
-#define MY_HF_SEP ": "
39
-#define MY_HF_SEP_LEN 2
40
-
41
-#define BRANCH_SEPARATOR '.'
42
-#define WARNING "Warning: 392 "
43
-#define WARNING_LEN (sizeof(WARNING)-1)
44
-#define WARNING_PHRASE " \"Noisy feedback tells: "
45
-#define WARNING_PHRASE_LEN (sizeof(WARNING_PHRASE)-1)
46
-
47
-/*#define MAX_CONTENT_LEN_BUF INT2STR_MAX_LEN *//* see ut.h/int2str() */
48
-
49
-#define BUILD_NO_LOCAL_VIA		(1<<0)
50
-#define BUILD_NO_VIA1_UPDATE	(1<<1)
51
-#define BUILD_NO_PATH			(1<<2)
52
-#define BUILD_IN_SHM			(1<<7)
53
-
54
-#include "parser/msg_parser.h"
55
-#include "ip_addr.h"
56
-
57
-/* point to some remarkable positions in a SIP message */
58
-struct bookmark {
59
-	str to_tag_val;
60
-};
61
-
62
-/* used by via_builder */
63
-struct hostport {
64
-	str* host;
65
-	str* port;
66
-};
67
-
68
-
69
-#define set_hostport(hp, msg) \
70
-	do{ \
71
-		if ((msg) && ((struct sip_msg*)(msg))->set_global_address.len) \
72
-			(hp)->host=&(((struct sip_msg*)(msg))->set_global_address); \
73
-		else \
74
-			(hp)->host=&default_global_address; \
75
-		if ((msg) && ((struct sip_msg*)(msg))->set_global_port.len) \
76
-			(hp)->port=&(((struct sip_msg*)(msg))->set_global_port); \
77
-		else \
78
-			(hp)->port=&default_global_port; \
79
-	}while(0)
80
-
81
-char * build_req_buf_from_sip_req(struct sip_msg* msg, 
82
-				unsigned int *returned_len, struct dest_info* send_info,
83
-				unsigned int mode);
84
-
85
-char * build_res_buf_from_sip_res(struct sip_msg* msg,
86
-				unsigned int *returned_len);
87
-
88
-char * generate_res_buf_from_sip_res(struct sip_msg* msg,
89
-				unsigned int *returned_len, unsigned int mode);
90
-
91
-char * build_res_buf_from_sip_req(unsigned int code,
92
-				str *text,
93
-				str *new_tag,
94
-				struct sip_msg* msg,
95
-				unsigned int *returned_len,
96
-				struct bookmark *bmark);
97
-/*
98
-char * build_res_buf_with_body_from_sip_req(	unsigned int code ,
99
-				char *text ,
100
-				char *new_tag ,
101
-				unsigned int new_tag_len ,
102
-				char *body ,
103
-				unsigned int body_len,
104
-				char *content_type,
105
-				unsigned int content_type_len,
106
-				struct sip_msg* msg,
107
-				unsigned int *returned_len,
108
-				struct bookmark *bmark);
109
-*/
110
-char* via_builder( unsigned int *len,
111
-	struct dest_info* send_info,
112
-	str *branch, str* extra_params, struct hostport *hp );
113
-
114
-/* creates a via header honoring the protocol of the incomming socket
115
- * msg is an optional parameter */
116
-char* create_via_hf( unsigned int *len,
117
-	struct sip_msg *msg,
118
-	struct dest_info* send_info /* where to send the reply */,
119
-	str* branch);
120
-
121
-int branch_builder( unsigned int hash_index, 
122
-	/* only either parameter useful */
123
-	unsigned int label, char * char_v,
124
-	int branch,
125
-	/* output value: string and actual length */
126
-	char *branch_str, int *len );
127
-
128
-char* id_builder(struct sip_msg* msg, unsigned int *id_len);
129
-
130
-/* check if IP address in Via != source IP address of signaling,
131
- * or the sender is asking to set the values for rport or received */
132
-int received_test( struct sip_msg *msg );
133
-
134
-/* check if IP address in Via != source IP address of signaling */
135
-int received_via_test( struct sip_msg *msg );
136
-
137
-/* builds a char* buffer from message headers without body
138
- * first line is excluded in case of skip_first_line=1
139
- */
140
-char * build_only_headers( struct sip_msg* msg, int skip_first_line,
141
-				unsigned int *returned_len,
142
-				int *error,
143
-				struct dest_info* send_info);
144
-
145
-/* builds a char* buffer from message body
146
- * error is set -1 if the memory allocation failes
147
- */
148
-char * build_body( struct sip_msg* msg,
149
-			unsigned int *returned_len,
150
-			int *error,
151
-			struct dest_info* send_info);
152
-
153
-/* builds a char* buffer from SIP message including body
154
- * The function adjusts the Content-Length HF according
155
- * to body lumps in case of adjust_clen=1.
156
- */
157
-char * build_all( struct sip_msg* msg, int adjust_clen,
158
-			unsigned int *returned_len,
159
-			int *error,
160
-			struct dest_info* send_info);
161
-
162
-/** cfg framework fixup */
163
-void fix_global_req_flags(str* gname, str* name);
164
-
165
-int build_sip_msg_from_buf(struct sip_msg *msg, char *buf, int len,
166
-		unsigned int id);
167
-
168
-/* returns a copy in private memory of the boundary in a multipart body */
169
-int get_boundary(struct sip_msg* msg, str* boundary);
170
-
171
-
172
-/* process the lumps of a sip msg
173
- * flags =  => add also the existing header to new_buf
174
- * flags =  => add only the lumps (unapplied info) to new_buf
175
- **/
176
-void process_lumps( struct sip_msg* msg,
177
-                    struct lump* lumps,
178
-                    char* new_buf,
179
-                    unsigned int* new_buf_offs,
180
-                    unsigned int* orig_offs,
181
-                    struct dest_info* send_info,
182
-                    int flag);
183
-#endif
Browse code

debugger: add a new dbg_sip_msg() config function

Added a config function which prints how the sip message would look like
if it were to be sent out at that point in config. Displays how the message
looks after apllying all the lumps; but it is just printing, not actual
lump application. Updated doku.

Stefan Mititelu authored on 10/06/2015 12:10:00
Showing 1 changed files
... ...
@@ -31,6 +31,10 @@
31 31
 #ifndef  _MSG_TRANSLATOR_H
32 32
 #define _MSG_TRANSLATOR_H
33 33
 
34
+/* flags used for process_lumps flag parameter */
35
+#define FLAG_MSG_LUMPS_ONLY     0   /* copy just the lumps */
36
+#define FLAG_MSG_ALL            1   /* copy all the msg */
37
+
34 38
 #define MY_HF_SEP ": "
35 39
 #define MY_HF_SEP_LEN 2
36 40
 
... ...
@@ -163,4 +167,17 @@ int build_sip_msg_from_buf(struct sip_msg *msg, char *buf, int len,
163 167
 
164 168
 /* returns a copy in private memory of the boundary in a multipart body */
165 169
 int get_boundary(struct sip_msg* msg, str* boundary);
170
+
171
+
172
+/* process the lumps of a sip msg
173
+ * flags =  => add also the existing header to new_buf
174
+ * flags =  => add only the lumps (unapplied info) to new_buf
175
+ **/
176
+void process_lumps( struct sip_msg* msg,
177
+                    struct lump* lumps,
178
+                    char* new_buf,
179
+                    unsigned int* new_buf_offs,
180
+                    unsigned int* orig_offs,
181
+                    struct dest_info* send_info,
182
+                    int flag);
166 183
 #endif
Browse code

Core Update of doxygen, removal of history, changing "ser" to "kamailio"

Olle E. Johansson authored on 03/01/2015 14:03:24
Showing 1 changed files
... ...
@@ -1,21 +1,14 @@
1
-/*$Id$
2
- * 
3
- *
1
+/*
4 2
  * Copyright (C) 2001-2003 FhG Fokus
5 3
  *
6
- * This file is part of ser, a free SIP server.
4
+ * This file is part of Kamailio, a free SIP server.
7 5
  *
8
- * ser is free software; you can redistribute it and/or modify
6
+ * Kamailio is free software; you can redistribute it and/or modify
9 7
  * it under the terms of the GNU General Public License as published by
10 8
  * the Free Software Foundation; either version 2 of the License, or
11 9
  * (at your option) any later version
12 10
  *
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,
11
+ * Kamailio is distributed in the hope that it will be useful,
19 12
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 13
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 14
  * GNU General Public License for more details.
... ...
@@ -24,15 +17,16 @@
24 17
  * along with this program; if not, write to the Free Software 
25 18
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
26 19
  *
27
- * History:
28
- * --------
29
- * 2003-03-06  totags in outgoing replies bookmarked to enable
30
- *             ACK/200 tag matching
31
- *
32
- * 2003-03-01 VOICE_MAIL defs removed (jiri)
33
- * 2003-10-08 receive_test function-alized (jiri)
34 20
  */
35 21
 
22
+/*!
23
+* \file
24
+* \brief Kamailio core :: Message translations
25
+* \author jiri
26
+* \ingroup core
27
+* Module: \ref core
28
+*/
29
+
36 30
 
37 31
 #ifndef  _MSG_TRANSLATOR_H
38 32
 #define _MSG_TRANSLATOR_H
Browse code

core: dedicated function to check Via address with source ip

- received_via_test() as alternative to received_test() which looks also
for rport and received parameters, confusing nat detection tests

Daniel-Constantin Mierla authored on 01/12/2014 10:47:19
Showing 1 changed files
... ...
@@ -129,9 +129,13 @@ int branch_builder( unsigned int hash_index,
129 129
 
130 130
 char* id_builder(struct sip_msg* msg, unsigned int *id_len);
131 131
 
132
-/* check if IP address in Via != source IP address of signaling */
132
+/* check if IP address in Via != source IP address of signaling,
133
+ * or the sender is asking to set the values for rport or received */
133 134
 int received_test( struct sip_msg *msg );
134 135
 
136
+/* check if IP address in Via != source IP address of signaling */
137
+int received_via_test( struct sip_msg *msg );
138
+
135 139
 /* builds a char* buffer from message headers without body
136 140
  * first line is excluded in case of skip_first_line=1
137 141
  */
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: add check_boundaries() to build_req_buf_from_sip_req().

This checks and fixes the boundaries of a multipart body if the
FL_BODY_MULTIPART flag is set.

Victor Seva authored on 21/03/2014 20:56:04
Showing 1 changed files
... ...
@@ -162,4 +162,7 @@ void fix_global_req_flags(str* gname, str* name);
162 162
 
163 163
 int build_sip_msg_from_buf(struct sip_msg *msg, char *buf, int len,
164 164
 		unsigned int id);
165
+
166
+/* returns a copy in private memory of the boundary in a multipart body */
167
+int get_boundary(struct sip_msg* msg, str* boundary);
165 168
 #endif
Browse code

core: helper function to generate sip reply content without removing top via

Daniel-Constantin Mierla authored on 04/07/2013 20:27:32
Showing 1 changed files
... ...
@@ -87,6 +87,8 @@ char * build_req_buf_from_sip_req(struct sip_msg* msg,
87 87
 char * build_res_buf_from_sip_res(struct sip_msg* msg,
88 88
 				unsigned int *returned_len);
89 89
 
90
+char * generate_res_buf_from_sip_res(struct sip_msg* msg,
91
+				unsigned int *returned_len, unsigned int mode);
90 92
 
91 93
 char * build_res_buf_from_sip_req(unsigned int code,
92 94
 				str *text,
Browse code

core: reason phrase param updated to be str*

- build_res_buf_from_sip_req() takes reply reason phrase parameter as
str*
- many calls of this function have already the reason length

Daniel-Constantin Mierla authored on 16/08/2010 16:28:03
Showing 1 changed files
... ...
@@ -80,17 +80,17 @@ struct hostport {
80 80
 			(hp)->port=&default_global_port; \
81 81
 	}while(0)
82 82
 
83
-char * build_req_buf_from_sip_req (	struct sip_msg* msg, 
83
+char * build_req_buf_from_sip_req(struct sip_msg* msg, 
84 84
 				unsigned int *returned_len, struct dest_info* send_info,
85 85
 				unsigned int mode);
86 86
 
87
-char * build_res_buf_from_sip_res(	struct sip_msg* msg,
87
+char * build_res_buf_from_sip_res(struct sip_msg* msg,
88 88
 				unsigned int *returned_len);
89 89
 
90 90
 
91
-char * build_res_buf_from_sip_req( unsigned int code ,
92
-				char *text ,
93
-				str *new_tag ,
91
+char * build_res_buf_from_sip_req(unsigned int code,
92
+				str *text,
93
+				str *new_tag,
94 94
 				struct sip_msg* msg,
95 95
 				unsigned int *returned_len,
96 96
 				struct bookmark *bmark);
Browse code

core: path support when forwarding

Path support compatible with kamailio (although there might be
differences in the added Route header position).

Andrei Pelinescu-Onciul authored on 08/09/2009 17:21:49
Showing 1 changed files
... ...
@@ -50,7 +50,8 @@
50 50
 
51 51
 #define BUILD_NO_LOCAL_VIA		(1<<0)
52 52
 #define BUILD_NO_VIA1_UPDATE	(1<<1)
53
-#define BUILD_IN_SHM			(1<<2)
53
+#define BUILD_NO_PATH			(1<<2)
54
+#define BUILD_IN_SHM			(1<<7)
54 55
 
55 56
 #include "parser/msg_parser.h"
56 57
 #include "ip_addr.h"
Browse code

core: build_req_buf_from_sip_req() has a new parameter

- mode - a set of flags that define how the sip request is printed to buffer
- BUILD_NO_LOCAL_VIA (1<<0) - skip adding local via
- BUILD_NO_VIA1_UPDATE (1<<1) - skip updating top most via
- BUILD_IN_SHM (1<<2) - output buffer allocated in memory
- new function inc_msg_no() - increment and return msg_no
- new function build_sip_msg_from_buf(...) to parse and partially fill
sip_msg structure from a buffer

Daniel-Constantin Mierla authored on 08/07/2009 11:10:37
Showing 1 changed files
... ...
@@ -48,6 +48,10 @@
48 48
 
49 49
 /*#define MAX_CONTENT_LEN_BUF INT2STR_MAX_LEN *//* see ut.h/int2str() */
50 50
 
51
+#define BUILD_NO_LOCAL_VIA		(1<<0)
52
+#define BUILD_NO_VIA1_UPDATE	(1<<1)
53
+#define BUILD_IN_SHM			(1<<2)
54
+
51 55
 #include "parser/msg_parser.h"
52 56
 #include "ip_addr.h"
53 57
 
... ...
@@ -76,7 +80,8 @@ struct hostport {
76 80
 	}while(0)
77 81
 
78 82
 char * build_req_buf_from_sip_req (	struct sip_msg* msg, 
79
-				unsigned int *returned_len, struct dest_info* send_info);
83
+				unsigned int *returned_len, struct dest_info* send_info,
84
+				unsigned int mode);
80 85
 
81 86
 char * build_res_buf_from_sip_res(	struct sip_msg* msg,
82 87
 				unsigned int *returned_len);
... ...
@@ -152,4 +157,6 @@ char * build_all( struct sip_msg* msg, int adjust_clen,
152 157
 /** cfg framework fixup */
153 158
 void fix_global_req_flags(str* gname, str* name);
154 159
 
160
+int build_sip_msg_from_buf(struct sip_msg *msg, char *buf, int len,
161
+		unsigned int id);
155 162
 #endif
Browse code

The fixup function prototypes of the config variables have been extended with the group name. All the fixup functions have been updated.

Miklos Tirpak authored on 13/03/2009 13:59:28
Showing 1 changed files
... ...
@@ -150,6 +150,6 @@ char * build_all( struct sip_msg* msg, int adjust_clen,
150 150
 			struct dest_info* send_info);
151 151
 
152 152
 /** cfg framework fixup */
153
-void fix_global_req_flags( str* name);
153
+void fix_global_req_flags(str* gname, str* name);
154 154
 
155 155
 #endif
Browse code

core: forward: tcp fallback for big udp packets

- support for tcp, tls or sctp fallback for udp forwarded requests
that end up bigger then udp_mtu (configurable, disabled by
default). For such messages only the Via is changed (for example
the original built for udp Record-Route is kept untouched so
that subsequent messages in the dialog will use udp if smaller
then udp_mtu).
- udp_mtu and udp_mtu_try_proto (fallback proto) can be changed at
runtime via the cfg framework
(e.g. sercmd cfg.set_now_int core udp_mtu 1300;
cfg.set_now_int core udp_mtu_try_proto 2 )
- force_rport can now be set globally using the config framework
(e.g. sercmd cfg.set_now_int core force_rport 1 )


Author: Andrei Pelinescu-Onciul <andrei@iptel.org>

Andrei Pelinescu-Onciul authored on 18/12/2008 16:06:03
Showing 1 changed files
... ...
@@ -149,5 +149,7 @@ char * build_all( struct sip_msg* msg, int adjust_clen,
149 149
 			int *error,
150 150
 			struct dest_info* send_info);
151 151
 
152
+/** cfg framework fixup */
153
+void fix_global_req_flags( str* name);
152 154
 
153 155
 #endif
Browse code

- Requests after a DNS failover are constructed from the outgoing message buffer of the failed branch instead of from the incomming request. - reparse_on_dns_failover module parameter is introduced. Closes SER-300

Miklos Tirpak authored on 10/03/2008 14:09:01
Showing 1 changed files
... ...
@@ -105,6 +105,12 @@ char* via_builder( unsigned int *len,
105 105
 	struct dest_info* send_info,
106 106
 	str *branch, str* extra_params, struct hostport *hp );
107 107
 
108
+/* creates a via header honoring the protocol of the incomming socket
109
+ * msg is an optional parameter */
110
+char* create_via_hf( unsigned int *len,
111
+	struct sip_msg *msg,
112
+	struct dest_info* send_info /* where to send the reply */,
113
+	str* branch);
108 114
 
109 115
 int branch_builder( unsigned int hash_index, 
110 116
 	/* only either parameter useful */
Browse code

- fix: ser generated ACKs and CANCELs via is built in the same way as the$ INVITE via (when forwarding on tcp, the ACK/CANCEL Via did miss the i=$ param which is added to the INVITE via) Note that by default 2.1 reparses the sent INVITE so this fix is needed only in a non-default config.

Andrei Pelinescu-Onciul authored on 01/10/2007 12:42:54
Showing 1 changed files
... ...
@@ -113,6 +113,8 @@ int branch_builder( unsigned int hash_index,
113 113
 	/* output value: string and actual length */
114 114
 	char *branch_str, int *len );
115 115
 
116
+char* id_builder(struct sip_msg* msg, unsigned int *id_len);
117
+
116 118
 /* check if IP address in Via != source IP address of signaling */
117 119
 int received_test( struct sip_msg *msg );
118 120
 
Browse code

- dns cache support (ser will cache both positive and negative responses if turned on, see doc/dns.txt for more details & config options) - dns failover support: when a name resolves to more then 1 ip (either multiple A or AAAA records or multiple SRVs) and sending to the first ip fails, ser will retry with the others. By default is off. See doc/dns.txt for more details/config options a.s.o. - destination blacklist: when sending to some destination (defined by ip:port and protocol) fails, ser will temporarily add this destination in a blacklist giving future sends the opportunity of immediately failing. Destination are also added to the blacklist on tm invite timeouts (when no response is received in the fr_timer interval). By default is off, see doc/dst_blacklist.txt form more details/config options. - small makefile fixes (in mode=debug) - resolver get_record api changes (updated enum)

WARNING: there are a lot of changes in tm

Andrei Pelinescu-Onciul authored on 15/09/2006 10:37:44
Showing 1 changed files
... ...
@@ -46,7 +46,7 @@
46 46
 #define WARNING_PHRASE " \"Noisy feedback tells: "
47 47
 #define WARNING_PHRASE_LEN (sizeof(WARNING_PHRASE)-1)
48 48
 
49
-//#define MAX_CONTENT_LEN_BUF INT2STR_MAX_LEN /* see ut.h/int2str() */
49
+/*#define MAX_CONTENT_LEN_BUF INT2STR_MAX_LEN *//* see ut.h/int2str() */
50 50
 
51 51
 #include "parser/msg_parser.h"
52 52
 #include "ip_addr.h"
Browse code

- applied patch from Miklos Tirpak <miklos@iptel.org> (closes SER-110)

Andrei Pelinescu-Onciul authored on 07/06/2006 21:34:23
Showing 1 changed files
... ...
@@ -116,4 +116,30 @@ int branch_builder( unsigned int hash_index,
116 116
 /* check if IP address in Via != source IP address of signaling */
117 117
 int received_test( struct sip_msg *msg );
118 118
 
119
+/* builds a char* buffer from message headers without body
120
+ * first line is excluded in case of skip_first_line=1
121
+ */
122
+char * build_only_headers( struct sip_msg* msg, int skip_first_line,
123
+				unsigned int *returned_len,
124
+				int *error,
125
+				struct dest_info* send_info);
126
+
127
+/* builds a char* buffer from message body
128
+ * error is set -1 if the memory allocation failes
129
+ */
130
+char * build_body( struct sip_msg* msg,
131
+			unsigned int *returned_len,
132
+			int *error,
133
+			struct dest_info* send_info);
134
+
135
+/* builds a char* buffer from SIP message including body
136
+ * The function adjusts the Content-Length HF according
137
+ * to body lumps in case of adjust_clen=1.
138
+ */
139
+char * build_all( struct sip_msg* msg, int adjust_clen,
140
+			unsigned int *returned_len,
141
+			int *error,
142
+			struct dest_info* send_info);
143
+
144
+
119 145
 #endif
Browse code

- more struct dest_info conversions (via_builder, tm: build_uac_req, assemble_via a.s.o) - basic support for comp=method (where mehtod=sigcomp|sergz) parsing (via, various uris) and adding (via, rr lumps). The code is compiled only if USE_COMP is defined. NOTE: for now the code is useless (no compression code yet and no compression hooks), so by default it's not compiled.

WARNING: lots of changes and very lightly tested

Andrei Pelinescu-Onciul authored on 21/04/2006 14:28:36
Showing 1 changed files
... ...
@@ -76,8 +76,7 @@ struct hostport {
76 76
 	}while(0)
77 77
 
78 78
 char * build_req_buf_from_sip_req (	struct sip_msg* msg, 
79
-				unsigned int *returned_len, struct socket_info* send_sock,
80
-				int proto);
79
+				unsigned int *returned_len, struct dest_info* send_info);
81 80
 
82 81
 char * build_res_buf_from_sip_res(	struct sip_msg* msg,
83 82
 				unsigned int *returned_len);
... ...
@@ -103,8 +102,8 @@ char * build_res_buf_with_body_from_sip_req(	unsigned int code ,
103 102
 				struct bookmark *bmark);
104 103
 */
105 104
 char* via_builder( unsigned int *len,
106
-	struct socket_info* send_sock,
107
-	str *branch, str* extra_params, int proto, struct hostport *hp );
105
+	struct dest_info* send_info,
106
+	str *branch, str* extra_params, struct hostport *hp );
108 107
 
109 108
 
110 109
 int branch_builder( unsigned int hash_index, 
Browse code

- Spelling checked - READMEs updated

Jan Janak authored on 24/08/2004 08:45:09
Showing 1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 /*$Id$
2 2
  * 
3 3
  *
4
- * Copyright (C) 2001-2003 Fhg Fokus
4
+ * Copyright (C) 2001-2003 FhG Fokus
5 5
  *
6 6
  * This file is part of ser, a free SIP server.
7 7
  *
Browse code

received test functionalized for sanity and exporting to nathelper uac_nat_test

Jiri Kuthan authored on 08/10/2003 20:02:14
Showing 1 changed files
... ...
@@ -30,6 +30,7 @@
30 30
  *             ACK/200 tag matching
31 31
  *
32 32
  * 2003-03-01 VOICE_MAIL defs removed (jiri)
33
+ * 2003-10-08 receive_test function-alized (jiri)
33 34
  */
34 35
 
35 36
 
... ...
@@ -113,5 +114,7 @@ int branch_builder( unsigned int hash_index,
113 114
 	/* output value: string and actual length */
114 115
 	char *branch_str, int *len );
115 116
 
117
+/* check if IP address in Via != source IP address of signaling */
118
+int received_test( struct sip_msg *msg );
116 119
 
117 120
 #endif
Browse code

- added suuport for setting the source address and port in the sip requests (adevertised_address= ip|string, advertised_port= no, set_advertised_address(ip|string), set_advertised_port(no) )

Andrei Pelinescu-Onciul authored on 03/10/2003 07:19:41
Showing 1 changed files
... ...
@@ -55,6 +55,25 @@ struct bookmark {
55 55
 	str to_tag_val;
56 56
 };
57 57
 
58
+/* used by via_builder */
59
+struct hostport {
60
+	str* host;
61
+	str* port;
62
+};
63
+
64
+
65
+#define set_hostport(hp, msg) \
66
+	do{ \
67
+		if ((msg) && ((struct sip_msg*)(msg))->set_global_address.len) \
68
+			(hp)->host=&(((struct sip_msg*)(msg))->set_global_address); \
69
+		else \
70
+			(hp)->host=&default_global_address; \
71
+		if ((msg) && ((struct sip_msg*)(msg))->set_global_port.len) \
72
+			(hp)->port=&(((struct sip_msg*)(msg))->set_global_port); \
73
+		else \
74
+			(hp)->port=&default_global_port; \
75
+	}while(0)
76
+
58 77
 char * build_req_buf_from_sip_req (	struct sip_msg* msg, 
59 78
 				unsigned int *returned_len, struct socket_info* send_sock,
60 79
 				int proto);
... ...
@@ -84,7 +103,7 @@ char * build_res_buf_with_body_from_sip_req(	unsigned int code ,
84 103
 */
85 104
 char* via_builder( unsigned int *len,
86 105
 	struct socket_info* send_sock,
87
-	str *branch, str* extra_params, int proto );
106
+	str *branch, str* extra_params, int proto, struct hostport *hp );
88 107
 
89 108
 
90 109
 int branch_builder( unsigned int hash_index, 
Browse code

- lump_rpl extened - type added LUMP_RPL_HDR for adding hdrs and LUMP_RPL_BODY for adding body (only one allowed!!) - function build_res_buf_with_body_from_sip_req() (11 params) replaced with old build_res_buf_from_sip_req() (6 params) - new version knows how to interpret typed lump_rpl.

Bogdan-Andrei Iancu authored on 11/09/2003 19:54:43
Showing 1 changed files
... ...
@@ -45,7 +45,7 @@
45 45
 #define WARNING_PHRASE " \"Noisy feedback tells: "
46 46
 #define WARNING_PHRASE_LEN (sizeof(WARNING_PHRASE)-1)
47 47
 
48
-#define MAX_CONTENT_LEN_BUF INT2STR_MAX_LEN /* see ut.h/int2str() */
48
+//#define MAX_CONTENT_LEN_BUF INT2STR_MAX_LEN /* see ut.h/int2str() */
49 49
 
50 50
 #include "parser/msg_parser.h"
51 51
 #include "ip_addr.h"
... ...
@@ -62,13 +62,14 @@ char * build_req_buf_from_sip_req (	struct sip_msg* msg,
62 62
 char * build_res_buf_from_sip_res(	struct sip_msg* msg,
63 63
 				unsigned int *returned_len);
64 64
 
65
-char * build_res_buf_from_sip_req(	unsigned int code ,
65
+
66
+char * build_res_buf_from_sip_req( unsigned int code ,
66 67
 				char *text ,
67
-				char *new_tag ,
68
-				unsigned int new_tag_len ,
68
+				str *new_tag ,
69 69
 				struct sip_msg* msg,
70 70
 				unsigned int *returned_len,
71 71
 				struct bookmark *bmark);
72
+/*
72 73
 char * build_res_buf_with_body_from_sip_req(	unsigned int code ,
73 74
 				char *text ,
74 75
 				char *new_tag ,
... ...
@@ -80,7 +81,7 @@ char * build_res_buf_with_body_from_sip_req(	unsigned int code ,
80 81
 				struct sip_msg* msg,
81 82
 				unsigned int *returned_len,
82 83
 				struct bookmark *bmark);
83
-
84
+*/
84 85
 char* via_builder( unsigned int *len,
85 86
 	struct socket_info* send_sock,
86 87
 	str *branch, str* extra_params, int proto );
Browse code

missing history entries completed

Jiri Kuthan authored on 29/03/2003 01:38:11
Showing 1 changed files
... ...
@@ -26,6 +26,9 @@
26 26
  *
27 27
  * History:
28 28
  * --------
29
+ * 2003-03-06  totags in outgoing replies bookmarked to enable
30
+ *             ACK/200 tag matching
31
+ *
29 32
  * 2003-03-01 VOICE_MAIL defs removed (jiri)
30 33
  */
31 34
 
Browse code

fixed Content-Lenght bug in build_res_buf_with_body_from_sip_req.

Raphael Coeffic authored on 26/03/2003 20:26:09
Showing 1 changed files
... ...
@@ -42,6 +42,8 @@
42 42
 #define WARNING_PHRASE " \"Noisy feedback tells: "
43 43
 #define WARNING_PHRASE_LEN (sizeof(WARNING_PHRASE)-1)
44 44
 
45
+#define MAX_CONTENT_LEN_BUF INT2STR_MAX_LEN /* see ut.h/int2str() */
46
+
45 47
 #include "parser/msg_parser.h"
46 48
 #include "ip_addr.h"
47 49
 
Browse code

sorry -- I'm taking off in few minutes and wanted to commit not to road-block dependent work -- I will post on that and provide history of changes when I'm back

Jiri Kuthan authored on 06/03/2003 17:43:17
Showing 1 changed files
... ...
@@ -45,6 +45,11 @@
45 45
 #include "parser/msg_parser.h"
46 46
 #include "ip_addr.h"
47 47
 
48
+/* point to some remarkable positions in a SIP message */
49
+struct bookmark {
50
+	str to_tag_val;
51
+};
52
+
48 53
 char * build_req_buf_from_sip_req (	struct sip_msg* msg, 
49 54
 				unsigned int *returned_len, struct socket_info* send_sock,
50 55
 				int proto);
... ...
@@ -57,7 +62,8 @@ char * build_res_buf_from_sip_req(	unsigned int code ,
57 62
 				char *new_tag ,
58 63
 				unsigned int new_tag_len ,
59 64
 				struct sip_msg* msg,
60
-				unsigned int *returned_len);
65
+				unsigned int *returned_len,
66
+				struct bookmark *bmark);
61 67
 char * build_res_buf_with_body_from_sip_req(	unsigned int code ,
62 68
 				char *text ,
63 69
 				char *new_tag ,
... ...
@@ -67,7 +73,8 @@ char * build_res_buf_with_body_from_sip_req(	unsigned int code ,
67 73
 				char *content_type,
68 74
 				unsigned int content_type_len,
69 75
 				struct sip_msg* msg,
70
-				unsigned int *returned_len);
76
+				unsigned int *returned_len,
77
+				struct bookmark *bmark);
71 78
 
72 79
 char* via_builder( unsigned int *len,
73 80
 	struct socket_info* send_sock,
Browse code

VOICE_MAIL defs removed

Jiri Kuthan authored on 28/02/2003 23:46:26
Showing 1 changed files
... ...
@@ -23,6 +23,10 @@
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 25
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
26
+ *
27
+ * History:
28
+ * --------
29
+ * 2003-03-01 VOICE_MAIL defs removed (jiri)
26 30
  */
27 31
 
28 32
 
... ...
@@ -54,7 +58,6 @@ char * build_res_buf_from_sip_req(	unsigned int code ,
54 58
 				unsigned int new_tag_len ,
55 59
 				struct sip_msg* msg,
56 60
 				unsigned int *returned_len);
57
-#ifdef VOICE_MAIL
58 61
 char * build_res_buf_with_body_from_sip_req(	unsigned int code ,
59 62
 				char *text ,
60 63
 				char *new_tag ,
... ...
@@ -65,7 +68,6 @@ char * build_res_buf_with_body_from_sip_req(	unsigned int code ,
65 68
 				unsigned int content_type_len,
66 69
 				struct sip_msg* msg,
67 70
 				unsigned int *returned_len);
68
-#endif
69 71
 
70 72
 char* via_builder( unsigned int *len,
71 73
 	struct socket_info* send_sock,
Browse code

voicemail specific code added (see #define VOICE_MAIL and module vm)

Raphael Coeffic authored on 31/01/2003 13:54:59
Showing 1 changed files
... ...
@@ -54,6 +54,18 @@ char * build_res_buf_from_sip_req(	unsigned int code ,
54 54
 				unsigned int new_tag_len ,
55 55
 				struct sip_msg* msg,
56 56
 				unsigned int *returned_len);
57
+#ifdef VOICE_MAIL
58
+char * build_res_buf_with_body_from_sip_req(	unsigned int code ,
59
+				char *text ,
60
+				char *new_tag ,
61
+				unsigned int new_tag_len ,
62
+				char *body ,
63
+				unsigned int body_len,
64
+				char *content_type,
65
+				unsigned int content_type_len,
66
+				struct sip_msg* msg,
67
+				unsigned int *returned_len);
68
+#endif
57 69
 
58 70
 char* via_builder( unsigned int *len,
59 71
 	struct socket_info* send_sock,
Browse code

- replies will be sent to rport if present - finished adding new via param (i=tcp_connection_id_in_rev_hex) [ not it's not only parsed but also used ]

Andrei Pelinescu-Onciul authored on 24/01/2003 17:56:42
Showing 1 changed files
... ...
@@ -57,12 +57,8 @@ char * build_res_buf_from_sip_req(	unsigned int code ,
57 57
 
58 58
 char* via_builder( unsigned int *len,
59 59
 	struct socket_info* send_sock,
60
-	char *branch, int branch_len, int proto );
60
+	str *branch, str* extra_params, int proto );
61 61
 
62
-#ifdef _OBSOLETED
63
-char* via_builder( struct sip_msg *msg ,
64
-				unsigned int *len, struct socket_info* send_sock);
65
-#endif
66 62
 
67 63
 int branch_builder( unsigned int hash_index, 
68 64
 	/* only either parameter useful */
Browse code

bug_fix: checking of return value of snprintf aligned to C99

Jiri Kuthan authored on 20/01/2003 01:18:50
Showing 1 changed files
... ...
@@ -33,6 +33,10 @@
33 33
 #define MY_HF_SEP_LEN 2
34 34
 
35 35
 #define BRANCH_SEPARATOR '.'
36
+#define WARNING "Warning: 392 "
37
+#define WARNING_LEN (sizeof(WARNING)-1)
38
+#define WARNING_PHRASE " \"Noisy feedback tells: "
39
+#define WARNING_PHRASE_LEN (sizeof(WARNING_PHRASE)-1)
36 40
 
37 41
 #include "parser/msg_parser.h"
38 42
 #include "ip_addr.h"
Browse code

- changed sip_msg (new rcv member containing all the ips, ports, protocol) - added a "proto" parameter to forward_request, via_builder, get_send_sock etc. - added 2 new script commands: forward_udp & forward_tcp - lots of tcp bloat - changed parse_via to recognize TCP - more functions added to ip_addr.h (cmp for ips & sockaddrs etc.)

Andrei Pelinescu-Onciul authored on 12/12/2002 21:46:37
Showing 1 changed files
... ...
@@ -38,7 +38,8 @@
38 38
 #include "ip_addr.h"
39 39
 
40 40
 char * build_req_buf_from_sip_req (	struct sip_msg* msg, 
41
-				unsigned int *returned_len, struct socket_info* send_sock);
41
+				unsigned int *returned_len, struct socket_info* send_sock,
42
+				int proto);
42 43
 
43 44
 char * build_res_buf_from_sip_res(	struct sip_msg* msg,
44 45
 				unsigned int *returned_len);
... ...
@@ -52,7 +53,7 @@ char * build_res_buf_from_sip_req(	unsigned int code ,
52 53
 
53 54
 char* via_builder( unsigned int *len,
54 55
 	struct socket_info* send_sock,
55
-	char *branch, int branch_len );
56
+	char *branch, int branch_len, int proto );
56 57
 
57 58
 #ifdef _OBSOLETED
58 59
 char* via_builder( struct sip_msg *msg ,
Browse code

GPLization banner introduced to *.[hc] files

Jiri Kuthan authored on 19/09/2002 12:23:52
Showing 1 changed files
... ...
@@ -1,7 +1,31 @@
1 1
 /*$Id$
2 2
  * 
3
+ *
4
+ * Copyright (C) 2001-2003 Fhg Fokus
5
+ *
6
+ * This file is part of ser, a free SIP server.
7
+ *
8
+ * ser 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
+ * 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,
19
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
+ * GNU General Public License for more details.
22
+ *
23
+ * You should have received a copy of the GNU General Public License 
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
3 26
  */
4 27
 
28
+
5 29
 #ifndef  _MSG_TRANSLATOR_H
6 30
 #define _MSG_TRANSLATOR_H
7 31
 
Browse code

bignag change -- lot of things primarily added in relationship with refurbushing TM; see [sr] archive (2002-08-14) -- "ser update" and "TM update" for a long list of details

Jiri Kuthan authored on 15/08/2002 08:13:29
Showing 1 changed files
... ...
@@ -8,6 +8,8 @@
8 8
 #define MY_HF_SEP ": "
9 9
 #define MY_HF_SEP_LEN 2
10 10
 
11
+#define BRANCH_SEPARATOR '.'
12
+
11 13
 #include "parser/msg_parser.h"
12 14
 #include "ip_addr.h"
13 15
 
... ...
@@ -23,8 +25,22 @@ char * build_res_buf_from_sip_req(	unsigned int code ,
23 25
 				unsigned int new_tag_len ,
24 26
 				struct sip_msg* msg,
25 27
 				unsigned int *returned_len);
26
-char* via_builder( 			struct sip_msg *msg ,
28
+
29
+char* via_builder( unsigned int *len,
30
+	struct socket_info* send_sock,
31
+	char *branch, int branch_len );
32
+
33
+#ifdef _OBSOLETED
34
+char* via_builder( struct sip_msg *msg ,
27 35
 				unsigned int *len, struct socket_info* send_sock);
36
+#endif
37
+
38
+int branch_builder( unsigned int hash_index, 
39
+	/* only either parameter useful */
40
+	unsigned int label, char * char_v,
41
+	int branch,
42
+	/* output value: string and actual length */
43
+	char *branch_str, int *len );
28 44
 
29 45
 
30 46
 #endif
Browse code

- made ipv4<->ipv6 possible - added different port numbers (eg. ser -l foo -p 1234 -l bar -p 4321 ) - small signal fixes (sigterm to evrybody on exit, exit if 1 child dies a.s.o)

Andrei Pelinescu-Onciul authored on 26/05/2002 21:38:02
Showing 1 changed files
... ...
@@ -9,9 +9,10 @@
9 9
 #define MY_HF_SEP_LEN 2
10 10
 
11 11
 #include "parser/msg_parser.h"
12
+#include "ip_addr.h"
12 13
 
13 14
 char * build_req_buf_from_sip_req (	struct sip_msg* msg, 
14
-				unsigned int *returned_len);
15
+				unsigned int *returned_len, struct socket_info* send_sock);
15 16
 
16 17
 char * build_res_buf_from_sip_res(	struct sip_msg* msg,
17 18
 				unsigned int *returned_len);
... ...
@@ -23,7 +24,7 @@ char * build_res_buf_from_sip_req(	unsigned int code ,
23 24
 				struct sip_msg* msg,
24 25
 				unsigned int *returned_len);
25 26
 char* via_builder( 			struct sip_msg *msg ,
26
-				unsigned int *len );
27
+				unsigned int *len, struct socket_info* send_sock);
27 28
 
28 29
 
29 30
 #endif
Browse code

TM callbacks, acc, flags

Jiri Kuthan authored on 13/05/2002 01:15:40
Showing 1 changed files
... ...
@@ -8,7 +8,7 @@
8 8
 #define MY_HF_SEP ": "
9 9
 #define MY_HF_SEP_LEN 2
10 10
 
11
-#include "msg_parser.h"
11
+#include "parser/msg_parser.h"
12 12
 
13 13
 char * build_req_buf_from_sip_req (	struct sip_msg* msg, 
14 14
 				unsigned int *returned_len);
Browse code

Stateless module added!

Bogdan-Andrei Iancu authored on 12/02/2002 16:48:34
Showing 1 changed files
... ...
@@ -16,8 +16,10 @@ char * build_req_buf_from_sip_req (	struct sip_msg* msg,
16 16
 char * build_res_buf_from_sip_res(	struct sip_msg* msg,
17 17
 				unsigned int *returned_len);
18 18
 
19
-char * build_res_buf_from_sip_req(	unsigned int code , 
19
+char * build_res_buf_from_sip_req(	unsigned int code ,
20 20
 				char *text ,
21
+				char *new_tag ,
22
+				unsigned int new_tag_len ,
21 23
 				struct sip_msg* msg,
22 24
 				unsigned int *returned_len);
23 25
 char* via_builder( 			struct sip_msg *msg ,
Browse code

timers fixed

Bogdan-Andrei Iancu authored on 10/12/2001 15:42:45
Showing 1 changed files
... ...
@@ -11,20 +11,17 @@
11 11
 #include "msg_parser.h"
12 12
 
13 13
 char * build_req_buf_from_sip_req (	struct sip_msg* msg, 
14
-									unsigned int *returned_len);
14
+				unsigned int *returned_len);
15 15
 
16 16
 char * build_res_buf_from_sip_res(	struct sip_msg* msg,
17
-									unsigned int *returned_len);
17
+				unsigned int *returned_len);
18 18
 
19 19
 char * build_res_buf_from_sip_req(	unsigned int code , 
20
-									char *text ,
21
-									struct sip_msg* msg,
22
-									unsigned int *returned_len);
23
-char* via_builder( struct sip_msg *msg ,
24
-									unsigned int *len );
25
-
26
-
27
-char* via_builder( struct sip_msg *msg , unsigned int *len );
20
+				char *text ,
21
+				struct sip_msg* msg,
22
+				unsigned int *returned_len);
23
+char* via_builder( 			struct sip_msg *msg ,
24
+				unsigned int *len );
28 25
 
29 26
 
30 27
 #endif
Browse code

version with numerous TM fixes; first to withstand heavy load

Jiri Kuthan authored on 07/12/2001 02:12:23
Showing 1 changed files
... ...
@@ -24,6 +24,7 @@ char* via_builder( struct sip_msg *msg ,
24 24
 									unsigned int *len );
25 25
 
26 26
 
27
+char* via_builder( struct sip_msg *msg , unsigned int *len );
27 28
 
28 29
 
29 30
 #endif
Browse code

*** empty log message ***

Bogdan-Andrei Iancu authored on 07/12/2001 00:09:42
Showing 1 changed files
... ...
@@ -20,6 +20,8 @@ char * build_res_buf_from_sip_req(	unsigned int code ,
20 20
 									char *text ,
21 21
 									struct sip_msg* msg,
22 22
 									unsigned int *returned_len);
23
+char* via_builder( struct sip_msg *msg ,
24
+									unsigned int *len );
23 25
 
24 26
 
25 27
 
Browse code

T-management hugely refurbished, fat bugs fixed; alas, the timer routing in T-mgmt core dumps now

Jiri Kuthan authored on 03/12/2001 13:07:13
Showing 1 changed files
... ...
@@ -5,6 +5,9 @@
5 5
 #ifndef  _MSG_TRANSLATOR_H
6 6
 #define _MSG_TRANSLATOR_H
7 7
 
8
+#define MY_HF_SEP ": "
9
+#define MY_HF_SEP_LEN 2
10
+
8 11
 #include "msg_parser.h"
9 12
 
10 13
 char * build_req_buf_from_sip_req (	struct sip_msg* msg, 
Browse code

- cosmetic changes

Andrei Pelinescu-Onciul authored on 29/11/2001 19:51:32
Showing 1 changed files
... ...
@@ -1,13 +1,22 @@
1
+/*$Id$
2
+ * 
3
+ */
4
+
1 5
 #ifndef  _MSG_TRANSLATOR_H
2 6
 #define _MSG_TRANSLATOR_H
3