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,100 +0,0 @@
1
-/* 
2
- * Copyright (C) 2005 iptelorg GmbH
3
- *
4
- * This file is part of ser, a free SIP server.
5
- *
6
- * ser 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
- * For a license to use the ser software under conditions
12
- * other than those described here, or to purchase support for this
13
- * software, please contact iptel.org by e-mail at the following addresses:
14
- *    info@iptel.org
15
- *
16
- * ser is distributed in the hope that it will be useful,
17
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
- * GNU General Public License for more details.
20
- *
21
- * You should have received a copy of the GNU General Public License
22
- * along with this program; if not, write to the Free Software
23
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
24
- */
25
-
26
-#include <presence/lpidf.h>
27
-#include <cds/dstring.h>
28
-#include <cds/memory.h>
29
-#include <cds/logger.h>
30
-#include <cds/list.h>
31
-#include <presence/xml_utils.h>
32
-#include <string.h>
33
-
34
-/* ------------------------------ LPIDF document creation ------------------------------ */
35
-
36
-static void doc_add_tuple(dstring_t *buf, presentity_info_t *p, presence_tuple_info_t *t)
37
-{
38
-	char tmp[64];
39
-	
40
-	if (t->status.basic == presence_tuple_closed) return; /* do not append closed tuples */
41
-	
42
-	dstr_append_zt(buf, "Contact: ");
43
-	dstr_append_str(buf, &t->contact);
44
-	dstr_append_zt(buf, ";q=");
45
-	sprintf(tmp, "%1.2f", t->priority);
46
-	dstr_append_zt(buf, tmp);
47
-	dstr_append_zt(buf, "\r\n");
48
-}
49
-
50
-static void doc_add_presentity(dstring_t *buf, presentity_info_t *p)
51
-{
52
-	presence_tuple_info_t *t;
53
-	/* presence_note_t *n; */
54
-
55
-	dstr_append_zt(buf, "To: ");
56
-	dstr_append_str(buf, &p->uri);
57
-	dstr_append_zt(buf, "\r\n");
58
-	
59
-	t = p->first_tuple;
60
-	while (t) {
61
-		doc_add_tuple(buf, p, t);
62
-		t = t->next;
63
-	}
64
-}
65
-
66
-int create_lpidf_document(presentity_info_t *p, str_t *dst, str_t *dst_content_type)
67
-{
68
-	dstring_t buf;
69
-	int err;
70
-	
71
-	if (!dst) return -1;
72
-	
73
-	str_clear(dst);
74
-	if (dst_content_type) str_clear(dst_content_type);
75
-
76
-	if (!p) return -1;
77
-	
78
-	if (dst_content_type) {
79
-		if (str_dup_zt(dst_content_type, "text/lpidf") < 0) {
80
-			return -1;
81
-		}
82
-	}
83
-
84
-/*	if (!p->first_tuple) return 0;*/	/* no tuples => nothing to say */ 
85
-	
86
-	dstr_init(&buf, 2048);
87
-	
88
-	doc_add_presentity(&buf, p);
89
-	
90
-	err = dstr_get_str(&buf, dst);
91
-	dstr_destroy(&buf);
92
-	
93
-	if (err != 0) {
94
-		str_free_content(dst);
95
-		if (dst_content_type) str_free_content(dst_content_type);
96
-	}
97
-	
98
-	return err;
99
-}
100
-
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
... ...
@@ -20,7 +20,7 @@
20 20
  *
21 21
  * You should have received a copy of the GNU General Public License
22 22
  * along with this program; if not, write to the Free Software
23
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
24 24
  */
25 25
 
26 26
 #include <presence/lpidf.h>
Browse code

first step in support of PIDF extensions (database support not finished yet, not tested)

Vaclav Kubart authored on 26/07/2006 10:10:45
Showing 1 changed files
... ...
@@ -37,7 +37,7 @@ static void doc_add_tuple(dstring_t *buf, presentity_info_t *p, presence_tuple_i
37 37
 {
38 38
 	char tmp[64];
39 39
 	
40
-	if (t->status == presence_tuple_closed) return; /* do not append closed tuples */
40
+	if (t->status.basic == presence_tuple_closed) return; /* do not append closed tuples */
41 41
 	
42 42
 	dstr_append_zt(buf, "Contact: ");
43 43
 	dstr_append_str(buf, &t->contact);
Browse code

PA module data structures change (based on structures from common libs now), PA code cleanup

Vaclav Kubart authored on 25/07/2006 05:46:57
Showing 1 changed files
... ...
@@ -53,7 +53,7 @@ static void doc_add_presentity(dstring_t *buf, presentity_info_t *p)
53 53
 	/* presence_note_t *n; */
54 54
 
55 55
 	dstr_append_zt(buf, "To: ");
56
-	dstr_append_str(buf, &p->presentity);
56
+	dstr_append_str(buf, &p->uri);
57 57
 	dstr_append_zt(buf, "\r\n");
58 58
 	
59 59
 	t = p->first_tuple;
Browse code

improved robustness

Vaclav Kubart authored on 06/03/2006 14:42:28
Showing 1 changed files
... ...
@@ -66,6 +66,7 @@ static void doc_add_presentity(dstring_t *buf, presentity_info_t *p)
66 66
 int create_lpidf_document(presentity_info_t *p, str_t *dst, str_t *dst_content_type)
67 67
 {
68 68
 	dstring_t buf;
69
+	int err;
69 70
 	
70 71
 	if (!dst) return -1;
71 72
 	
... ...
@@ -74,8 +75,11 @@ int create_lpidf_document(presentity_info_t *p, str_t *dst, str_t *dst_content_t
74 75
 
75 76
 	if (!p) return -1;
76 77
 	
77
-	if (dst_content_type) 
78
-		str_dup_zt(dst_content_type, "text/lpidf");
78
+	if (dst_content_type) {
79
+		if (str_dup_zt(dst_content_type, "text/lpidf") < 0) {
80
+			return -1;
81
+		}
82
+	}
79 83
 
80 84
 /*	if (!p->first_tuple) return 0;*/	/* no tuples => nothing to say */ 
81 85
 	
... ...
@@ -83,9 +87,14 @@ int create_lpidf_document(presentity_info_t *p, str_t *dst, str_t *dst_content_t
83 87
 	
84 88
 	doc_add_presentity(&buf, p);
85 89
 	
86
-	dstr_get_str(&buf, dst);
90
+	err = dstr_get_str(&buf, dst);
87 91
 	dstr_destroy(&buf);
88 92
 	
89
-	return 0;
93
+	if (err != 0) {
94
+		str_free_content(dst);
95
+		if (dst_content_type) str_free_content(dst_content_type);
96
+	}
97
+	
98
+	return err;
90 99
 }
91 100
 
Browse code

corrected bugs: under heavy load vere allocated buffers with zero length, but they were not freed

Vaclav Kubart authored on 27/02/2006 11:43:03
Showing 1 changed files
... ...
@@ -83,10 +83,7 @@ int create_lpidf_document(presentity_info_t *p, str_t *dst, str_t *dst_content_t
83 83
 	
84 84
 	doc_add_presentity(&buf, p);
85 85
 	
86
-	dst->len = dstr_get_data_length(&buf);
87
-	dst->s = cds_malloc(dst->len);
88
-	if (!dst->s) dst->len = 0;
89
-	else dstr_get_data(&buf, dst->s);
86
+	dstr_get_str(&buf, dst);
90 87
 	dstr_destroy(&buf);
91 88
 	
92 89
 	return 0;
Browse code

PA clarification: - removed unused print_xxx (presentity, ...) functions - statical buffers for presence documents and headers changed to dynamical - FIFO pa.trace command working with new FIFO interface (fifo module) - XCAP queries automaticaly process redirect (libcurl feature) - useful for usage of Apache2 with mod_speling as XCAP server - corrected bug in parsing PIDF (contact is not required now as PUBLISHed by gaim) - other cosmetical changes

Vaclav Kubart authored on 03/01/2006 15:14:17
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,94 @@
1
+/* 
2
+ * Copyright (C) 2005 iptelorg GmbH
3
+ *
4
+ * This file is part of ser, a free SIP server.
5
+ *
6
+ * ser 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
+ * For a license to use the ser software under conditions
12
+ * other than those described here, or to purchase support for this
13
+ * software, please contact iptel.org by e-mail at the following addresses:
14
+ *    info@iptel.org
15
+ *
16
+ * ser is distributed in the hope that it will be useful,
17
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
+ * GNU General Public License for more details.
20
+ *
21
+ * You should have received a copy of the GNU General Public License
22
+ * along with this program; if not, write to the Free Software
23
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
24
+ */
25
+
26
+#include <presence/lpidf.h>
27
+#include <cds/dstring.h>
28
+#include <cds/memory.h>
29
+#include <cds/logger.h>
30
+#include <cds/list.h>
31
+#include <presence/xml_utils.h>
32
+#include <string.h>
33
+
34
+/* ------------------------------ LPIDF document creation ------------------------------ */
35
+
36
+static void doc_add_tuple(dstring_t *buf, presentity_info_t *p, presence_tuple_info_t *t)
37
+{
38
+	char tmp[64];
39
+	
40
+	if (t->status == presence_tuple_closed) return; /* do not append closed tuples */
41
+	
42
+	dstr_append_zt(buf, "Contact: ");
43
+	dstr_append_str(buf, &t->contact);
44
+	dstr_append_zt(buf, ";q=");
45
+	sprintf(tmp, "%1.2f", t->priority);
46
+	dstr_append_zt(buf, tmp);
47
+	dstr_append_zt(buf, "\r\n");
48
+}
49
+
50
+static void doc_add_presentity(dstring_t *buf, presentity_info_t *p)
51
+{
52
+	presence_tuple_info_t *t;
53
+	/* presence_note_t *n; */
54
+
55
+	dstr_append_zt(buf, "To: ");
56
+	dstr_append_str(buf, &p->presentity);
57
+	dstr_append_zt(buf, "\r\n");
58
+	
59
+	t = p->first_tuple;
60
+	while (t) {
61
+		doc_add_tuple(buf, p, t);
62
+		t = t->next;
63
+	}
64
+}
65
+
66
+int create_lpidf_document(presentity_info_t *p, str_t *dst, str_t *dst_content_type)
67
+{
68
+	dstring_t buf;
69
+	
70
+	if (!dst) return -1;
71
+	
72
+	str_clear(dst);
73
+	if (dst_content_type) str_clear(dst_content_type);
74
+
75
+	if (!p) return -1;
76
+	
77
+	if (dst_content_type) 
78
+		str_dup_zt(dst_content_type, "text/lpidf");
79
+
80
+/*	if (!p->first_tuple) return 0;*/	/* no tuples => nothing to say */ 
81
+	
82
+	dstr_init(&buf, 2048);
83
+	
84
+	doc_add_presentity(&buf, p);
85
+	
86
+	dst->len = dstr_get_data_length(&buf);
87
+	dst->s = cds_malloc(dst->len);
88
+	if (!dst->s) dst->len = 0;
89
+	else dstr_get_data(&buf, dst->s);
90
+	dstr_destroy(&buf);
91
+	
92
+	return 0;
93
+}
94
+