Browse code

usrloc: use file name specific include guard

Daniel-Constantin Mierla authored on 04/05/2020 17:38:07
Showing 1 changed files
... ...
@@ -26,8 +26,8 @@
26 26
  *  \ingroup usrloc
27 27
  */
28 28
 
29
-#ifndef UL_MOD_H
30
-#define UL_MOD_H
29
+#ifndef _USRLOC_MOD_H_
30
+#define _USRLOC_MOD_H_
31 31
 
32 32
 
33 33
 #include "../../lib/srdb1/db.h"
... ...
@@ -129,4 +129,4 @@ extern int ul_expires_type;
129 129
 
130 130
 #define UL_DB_EXPIRES_GET(r)  ((ul_expires_type==1)?(time_t)VAL_BIGINT(r):VAL_TIME(r))
131 131
 
132
-#endif /* UL_MOD_H */
132
+#endif /* _USRLOC_MOD_H_ */
Browse code

usrloc: use ul prefix for global param variables

Daniel-Constantin Mierla authored on 01/05/2020 12:47:55
Showing 1 changed files
... ...
@@ -41,28 +41,28 @@
41 41
 
42 42
 #define UL_TABLE_VERSION 9
43 43
 
44
-extern str ruid_col;
45
-extern str user_col;
46
-extern str domain_col;
47
-extern str contact_col;
48
-extern str expires_col;
49
-extern str q_col;
50
-extern str callid_col;
51
-extern str cseq_col;
52
-extern str flags_col;
53
-extern str cflags_col;
54
-extern str user_agent_col;
55
-extern str received_col;
56
-extern str path_col;
57
-extern str sock_col;
58
-extern str methods_col;
59
-extern str instance_col;
60
-extern str reg_id_col;
61
-extern str srv_id_col;
62
-extern str con_id_col;
63
-extern str keepalive_col;
64
-extern str partition_col;
65
-extern str last_mod_col;
44
+extern str ul_ruid_col;
45
+extern str ul_user_col;
46
+extern str ul_domain_col;
47
+extern str ul_contact_col;
48
+extern str ul_expires_col;
49
+extern str ul_q_col;
50
+extern str ul_callid_col;
51
+extern str ul_cseq_col;
52
+extern str ul_flags_col;
53
+extern str ul_cflags_col;
54
+extern str ul_user_agent_col;
55
+extern str ul_received_col;
56
+extern str ul_path_col;
57
+extern str ul_sock_col;
58
+extern str ul_methods_col;
59
+extern str ul_instance_col;
60
+extern str ul_reg_id_col;
61
+extern str ul_srv_id_col;
62
+extern str ul_con_id_col;
63
+extern str ul_keepalive_col;
64
+extern str ul_partition_col;
65
+extern str ul_last_mod_col;
66 66
 
67 67
 extern str ulattrs_user_col;
68 68
 extern str ulattrs_domain_col;
... ...
@@ -73,27 +73,27 @@ extern str ulattrs_avalue_col;
73 73
 extern str ulattrs_last_mod_col;
74 74
 
75 75
 
76
-extern str db_url;
77
-extern int timer_interval;
78
-extern int db_mode;
79
-extern int db_insert_update;
80
-extern int use_domain;
81
-extern int desc_time_order;
82
-extern int cseq_delay;
76
+extern str ul_db_url;
77
+extern int ul_timer_interval;
78
+extern int ul_db_mode;
79
+extern int ul_db_insert_update;
80
+extern int ul_use_domain;
81
+extern int ul_desc_time_order;
82
+extern int ul_cseq_delay;
83 83
 extern int ul_fetch_rows;
84 84
 extern int ul_hash_size;
85 85
 extern int ul_db_update_as_insert;
86 86
 extern int ul_db_check_update;
87 87
 extern int ul_keepalive_timeout;
88
-extern int handle_lost_tcp;
89
-extern int close_expired_tcp;
90
-extern int skip_remote_socket;
88
+extern int ul_handle_lost_tcp;
89
+extern int ul_close_expired_tcp;
90
+extern int ul_skip_remote_socket;
91 91
 
92 92
 
93 93
 /*! nat branch flag */
94
-extern unsigned int nat_bflag;
94
+extern unsigned int ul_nat_bflag;
95 95
 /*! flag to protect against wrong initialization */
96
-extern unsigned int init_flag;
96
+extern unsigned int ul_init_flag;
97 97
 
98 98
 extern str ul_xavp_contact_name;
99 99
 
Browse code

usrloc: renamed global var matching_mode to ul_matching_mode

- avoid exports conflict with the other usrloc alternative modules

Daniel-Constantin Mierla authored on 30/04/2018 10:51:07
Showing 1 changed files
... ...
@@ -111,7 +111,7 @@ extern unsigned int ul_db_srvid;
111 111
 #define CONTACT_PATH         (2)
112 112
 #define CONTACT_CALLID_ONLY  (3)
113 113
 
114
-extern int matching_mode;
114
+extern int ul_matching_mode;
115 115
 
116 116
 extern int ul_db_ops_ruid;
117 117
 
Browse code

usrloc: cleanup by server_id. (#1480)

* usrloc: cleanup by server_id.

* usrloc: reverted README file changes.

* usrloc: moved server_id db request assignment under conditional command.

Konstantin authored on 12/03/2018 12:25:18 • Daniel-Constantin Mierla committed on 12/03/2018 12:25:18
Showing 1 changed files
... ...
@@ -100,7 +100,7 @@ extern str ul_xavp_contact_name;
100 100
 extern db1_con_t* ul_dbh;   /* Database connection handle */
101 101
 extern db_func_t ul_dbf;
102 102
 
103
-/* filter on load by server id */
103
+/* filter on load and during cleanup by server id */
104 104
 extern unsigned int ul_db_srvid;
105 105
 
106 106
 /*
Browse code

increased location table contact field size from 255 to 512

Juha Heinanen authored on 14/09/2017 11:44:41
Showing 1 changed files
... ...
@@ -39,7 +39,7 @@
39 39
  */
40 40
 
41 41
 
42
-#define UL_TABLE_VERSION 8
42
+#define UL_TABLE_VERSION 9
43 43
 
44 44
 extern str ruid_col;
45 45
 extern str user_col;
Browse code

usrloc: adding params

db_load: enable/disable loading from the database on mod_init
db_insert_update: insert into table, update on duplicate key

Julien Chavanton authored on 18/03/2017 20:16:15
Showing 1 changed files
... ...
@@ -76,6 +76,7 @@ extern str ulattrs_last_mod_col;
76 76
 extern str db_url;
77 77
 extern int timer_interval;
78 78
 extern int db_mode;
79
+extern int db_insert_update;
79 80
 extern int use_domain;
80 81
 extern int desc_time_order;
81 82
 extern int cseq_delay;
Browse code

usrloc: renamed main files to match module name

Daniel-Constantin Mierla authored on 21/12/2016 20:40:24
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,131 @@
1
+/*
2
+ * User location module interface
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 USRLOC - Usrloc module interface
26
+ *  \ingroup usrloc
27
+ */
28
+
29
+#ifndef UL_MOD_H
30
+#define UL_MOD_H
31
+
32
+
33
+#include "../../lib/srdb1/db.h"
34
+#include "../../core/str.h"
35
+
36
+
37
+/*
38
+ * Module parameters
39
+ */
40
+
41
+
42
+#define UL_TABLE_VERSION 8
43
+
44
+extern str ruid_col;
45
+extern str user_col;
46
+extern str domain_col;
47
+extern str contact_col;
48
+extern str expires_col;
49
+extern str q_col;
50
+extern str callid_col;
51
+extern str cseq_col;
52
+extern str flags_col;
53
+extern str cflags_col;
54
+extern str user_agent_col;
55
+extern str received_col;
56
+extern str path_col;
57
+extern str sock_col;
58
+extern str methods_col;
59
+extern str instance_col;
60
+extern str reg_id_col;
61
+extern str srv_id_col;
62
+extern str con_id_col;
63
+extern str keepalive_col;
64
+extern str partition_col;
65
+extern str last_mod_col;
66
+
67
+extern str ulattrs_user_col;
68
+extern str ulattrs_domain_col;
69
+extern str ulattrs_ruid_col;
70
+extern str ulattrs_aname_col;
71
+extern str ulattrs_atype_col;
72
+extern str ulattrs_avalue_col;
73
+extern str ulattrs_last_mod_col;
74
+
75
+
76
+extern str db_url;
77
+extern int timer_interval;
78
+extern int db_mode;
79
+extern int use_domain;
80
+extern int desc_time_order;
81
+extern int cseq_delay;
82
+extern int ul_fetch_rows;
83
+extern int ul_hash_size;
84
+extern int ul_db_update_as_insert;
85
+extern int ul_db_check_update;
86
+extern int ul_keepalive_timeout;
87
+extern int handle_lost_tcp;
88
+extern int close_expired_tcp;
89
+extern int skip_remote_socket;
90
+
91
+
92
+/*! nat branch flag */
93
+extern unsigned int nat_bflag;
94
+/*! flag to protect against wrong initialization */
95
+extern unsigned int init_flag;
96
+
97
+extern str ul_xavp_contact_name;
98
+
99
+extern db1_con_t* ul_dbh;   /* Database connection handle */
100
+extern db_func_t ul_dbf;
101
+
102
+/* filter on load by server id */
103
+extern unsigned int ul_db_srvid;
104
+
105
+/*
106
+ * Matching algorithms
107
+ */
108
+#define CONTACT_ONLY         (0)
109
+#define CONTACT_CALLID       (1)
110
+#define CONTACT_PATH         (2)
111
+#define CONTACT_CALLID_ONLY  (3)
112
+
113
+extern int matching_mode;
114
+
115
+extern int ul_db_ops_ruid;
116
+
117
+extern int ul_expires_type;
118
+
119
+#define UL_DB_EXPIRES_SET(r, v)   do { \
120
+			if(ul_expires_type==1) { \
121
+				(r)->type = DB1_BIGINT; \
122
+				(r)->val.ll_val = (long long)(v); \
123
+			} else { \
124
+				(r)->type = DB1_DATETIME; \
125
+				(r)->val.time_val = (time_t)(v); \
126
+			} \
127
+		} while(0)
128
+
129
+#define UL_DB_EXPIRES_GET(r)  ((ul_expires_type==1)?(time_t)VAL_BIGINT(r):VAL_TIME(r))
130
+
131
+#endif /* UL_MOD_H */