Browse code

sca: clang format code

Victor Seva authored on 16/06/2020 07:31:55
Showing 1 changed files
... ...
@@ -24,9 +24,10 @@
24 24
 #include "sca_subscribe.h"
25 25
 
26 26
 // pass to sca_notify_subscriber to include all appearances in Call-Info hdr
27
-#define SCA_CALL_INFO_APPEARANCE_INDEX_ANY	0
27
+#define SCA_CALL_INFO_APPEARANCE_INDEX_ANY 0
28 28
 
29
-enum {
29
+enum
30
+{
30 31
 	SCA_CALL_INFO_SHARED_NONE = 0,
31 32
 	SCA_CALL_INFO_SHARED_CALLER = (1 << 0),
32 33
 	SCA_CALL_INFO_SHARED_CALLEE = (1 << 1),
... ...
@@ -34,7 +35,8 @@ enum {
34 35
 #define SCA_CALL_INFO_SHARED_BOTH \
35 36
 	(SCA_CALL_INFO_SHARED_CALLER | SCA_CALL_INFO_SHARED_CALLEE)
36 37
 
37
-struct _sca_call_info {
38
+struct _sca_call_info
39
+{
38 40
 	str sca_uri;
39 41
 	int index;
40 42
 	int state;
... ...
@@ -44,28 +46,30 @@ struct _sca_call_info {
44 46
 };
45 47
 typedef struct _sca_call_info sca_call_info;
46 48
 
47
-#define SCA_CALL_INFO_EMPTY(ci1) \
48
-	((void*)(ci1) == NULL || \
49
-		((ci1)->index == SCA_CALL_INFO_APPEARANCE_INDEX_ANY && \
50
-		(ci1)->state == SCA_APPEARANCE_STATE_UNKNOWN))
49
+#define SCA_CALL_INFO_EMPTY(ci1)                                   \
50
+	((void *)(ci1) == NULL                                         \
51
+			|| ((ci1)->index == SCA_CALL_INFO_APPEARANCE_INDEX_ANY \
52
+					&& (ci1)->state == SCA_APPEARANCE_STATE_UNKNOWN))
51 53
 
52
-#define SCA_CALL_INFO_IS_SHARED_CALLER(ci1) \
53
-	(!SCA_CALL_INFO_EMPTY((ci1)) && \
54
-	(((sca_call_info *)(ci1))->ua_shared & SCA_CALL_INFO_SHARED_CALLER))
54
+#define SCA_CALL_INFO_IS_SHARED_CALLER(ci1)         \
55
+	(!SCA_CALL_INFO_EMPTY((ci1))                    \
56
+			&& (((sca_call_info *)(ci1))->ua_shared \
57
+					& SCA_CALL_INFO_SHARED_CALLER))
55 58
 
56
-#define SCA_CALL_INFO_IS_SHARED_CALLEE(ci1) \
57
-	(!SCA_CALL_INFO_EMPTY((ci1)) && \
58
-	(((sca_call_info *)(ci1))->ua_shared & SCA_CALL_INFO_SHARED_CALLEE))
59
+#define SCA_CALL_INFO_IS_SHARED_CALLEE(ci1)         \
60
+	(!SCA_CALL_INFO_EMPTY((ci1))                    \
61
+			&& (((sca_call_info *)(ci1))->ua_shared \
62
+					& SCA_CALL_INFO_SHARED_CALLEE))
59 63
 
60 64
 extern const str SCA_CALL_INFO_HEADER_STR;
61 65
 
62
-int sca_call_info_update(sip_msg_t *, int, str*, str*);
66
+int sca_call_info_update(sip_msg_t *, int, str *, str *);
63 67
 void sca_call_info_sl_reply_cb(void *);
64 68
 void sca_call_info_ack_cb(struct cell *, int, struct tmcb_params *);
65 69
 
66 70
 int sca_call_info_build_header(sca_mod *, sca_subscription *, char *, int);
67
-int sca_call_info_append_header_for_appearance_index(sca_subscription *, int,
68
-		char *, int);
71
+int sca_call_info_append_header_for_appearance_index(
72
+		sca_subscription *, int, char *, int);
69 73
 
70 74
 int sca_call_info_body_parse(str *, sca_call_info *);
71 75
 int sca_call_info_free(sca_call_info *);
Browse code

sca: get cfg int parameter in wrapper functions

Daniel-Constantin Mierla authored on 07/12/2017 13:44:00
Showing 1 changed files
... ...
@@ -59,7 +59,7 @@ typedef struct _sca_call_info sca_call_info;
59 59
 
60 60
 extern const str SCA_CALL_INFO_HEADER_STR;
61 61
 
62
-int sca_call_info_update(sip_msg_t *, char *, str*, str*);
62
+int sca_call_info_update(sip_msg_t *, int, str*, str*);
63 63
 void sca_call_info_sl_reply_cb(void *);
64 64
 void sca_call_info_ack_cb(struct cell *, int, struct tmcb_params *);
65 65
 
Browse code

sca: use HDR_CALLINFO_T

Victor Seva authored on 24/02/2017 10:18:29
Showing 1 changed files
... ...
@@ -67,7 +67,6 @@ int sca_call_info_build_header(sca_mod *, sca_subscription *, char *, int);
67 67
 int sca_call_info_append_header_for_appearance_index(sca_subscription *, int,
68 68
 		char *, int);
69 69
 
70
-hdr_field_t *sca_call_info_header_find(hdr_field_t *);
71 70
 int sca_call_info_body_parse(str *, sca_call_info *);
72 71
 int sca_call_info_free(sca_call_info *);
73 72
 
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
new file mode 100644
... ...
@@ -0,0 +1,74 @@
1
+/*
2
+ * Copyright (C) 2012 Andrew Mortensen
3
+ *
4
+ * This file is part of the sca module for Kamailio, a free SIP server.
5
+ *
6
+ * The sca module 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
+ * The sca module 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
+#ifndef SCA_CALL_INFO_H
21
+#define SCA_CALL_INFO_H
22
+
23
+#include "sca.h"
24
+#include "sca_subscribe.h"
25
+
26
+// pass to sca_notify_subscriber to include all appearances in Call-Info hdr
27
+#define SCA_CALL_INFO_APPEARANCE_INDEX_ANY	0
28
+
29
+enum {
30
+	SCA_CALL_INFO_SHARED_NONE = 0,
31
+	SCA_CALL_INFO_SHARED_CALLER = (1 << 0),
32
+	SCA_CALL_INFO_SHARED_CALLEE = (1 << 1),
33
+};
34
+#define SCA_CALL_INFO_SHARED_BOTH \
35
+	(SCA_CALL_INFO_SHARED_CALLER | SCA_CALL_INFO_SHARED_CALLEE)
36
+
37
+struct _sca_call_info {
38
+	str sca_uri;
39
+	int index;
40
+	int state;
41
+	str uri;
42
+	// mask tracking which endpoints in a call are shared
43
+	int ua_shared;
44
+};
45
+typedef struct _sca_call_info sca_call_info;
46
+
47
+#define SCA_CALL_INFO_EMPTY(ci1) \
48
+	((void*)(ci1) == NULL || \
49
+		((ci1)->index == SCA_CALL_INFO_APPEARANCE_INDEX_ANY && \
50
+		(ci1)->state == SCA_APPEARANCE_STATE_UNKNOWN))
51
+
52
+#define SCA_CALL_INFO_IS_SHARED_CALLER(ci1) \
53
+	(!SCA_CALL_INFO_EMPTY((ci1)) && \
54
+	(((sca_call_info *)(ci1))->ua_shared & SCA_CALL_INFO_SHARED_CALLER))
55
+
56
+#define SCA_CALL_INFO_IS_SHARED_CALLEE(ci1) \
57
+	(!SCA_CALL_INFO_EMPTY((ci1)) && \
58
+	(((sca_call_info *)(ci1))->ua_shared & SCA_CALL_INFO_SHARED_CALLEE))
59
+
60
+extern const str SCA_CALL_INFO_HEADER_STR;
61
+
62
+int sca_call_info_update(sip_msg_t *, char *, str*, str*);
63
+void sca_call_info_sl_reply_cb(void *);
64
+void sca_call_info_ack_cb(struct cell *, int, struct tmcb_params *);
65
+
66
+int sca_call_info_build_header(sca_mod *, sca_subscription *, char *, int);
67
+int sca_call_info_append_header_for_appearance_index(sca_subscription *, int,
68
+		char *, int);
69
+
70
+hdr_field_t *sca_call_info_header_find(hdr_field_t *);
71
+int sca_call_info_body_parse(str *, sca_call_info *);
72
+int sca_call_info_free(sca_call_info *);
73
+
74
+#endif // SCA_CALL_INFO_H