Debian Codegraph @

src/modules/uri_db/README

raw
1 uri_db Module
2
3 Jan Janak
4
5 FhG FOKUS
6
7 Edited by
8
9 Jan Janak
10
11 Bogdan-Andrei Iancu
12
13 Copyright © 2003 FhG FOKUS
14
15 Copyright © 2005 Voice Sistem SRL
16 __________________________________________________________________
17
18 Table of Contents
19
20 1. Admin Guide
21
22 1. Overview
23 2. Dependencies
24
25 2.1. Kamailio Modules
26 2.2. External Libraries or Applications
27
28 3. Parameters
29
30 3.1. db_url (string)
31 3.2. db_table (string)
32 3.3. user_column (string)
33 3.4. domain_column (string)
34 3.5. uriuser_column (string)
35 3.6. use_uri_table (integer)
36 3.7. use_domain (integer)
37
38 4. Functions
39
40 4.1. check_to()
41 4.2. check_from()
42 4.3. check_uri(uri)
43 4.4. does_uri_exist()
44
45 List of Examples
46
47 1.1. Set db_url parameter
48 1.2. Set db_table parameter
49 1.3. Set user_column parameter
50 1.4. Set domain_column parameter
51 1.5. Set uriuser_column parameter
52 1.6. Set use_uri_table parameter
53 1.7. Set use_domain parameter
54 1.8. check_to usage
55 1.9. check_from usage
56 1.10. check_uri usage
57 1.11. does_uri_exist usage
58
59 Chapter 1. Admin Guide
60
61 Table of Contents
62
63 1. Overview
64 2. Dependencies
65
66 2.1. Kamailio Modules
67 2.2. External Libraries or Applications
68
69 3. Parameters
70
71 3.1. db_url (string)
72 3.2. db_table (string)
73 3.3. user_column (string)
74 3.4. domain_column (string)
75 3.5. uriuser_column (string)
76 3.6. use_uri_table (integer)
77 3.7. use_domain (integer)
78
79 4. Functions
80
81 4.1. check_to()
82 4.2. check_from()
83 4.3. check_uri(uri)
84 4.4. does_uri_exist()
85
86 1. Overview
87
88 Various checks related to SIP URI.
89
90 2. Dependencies
91
92 2.1. Kamailio Modules
93 2.2. External Libraries or Applications
94
95 2.1. Kamailio Modules
96
97 The following modules must be loaded before this module:
98 * a Kamailio database module .
99
100 2.2. External Libraries or Applications
101
102 The following libraries or applications must be installed before
103 running Kamailio with this module loaded:
104 * None.
105
106 3. Parameters
107
108 3.1. db_url (string)
109 3.2. db_table (string)
110 3.3. user_column (string)
111 3.4. domain_column (string)
112 3.5. uriuser_column (string)
113 3.6. use_uri_table (integer)
114 3.7. use_domain (integer)
115
116 3.1. db_url (string)
117
118 URL of the database to be used.
119
120 If the db_url string is empty, the default database URL will be used.
121
122 Default value is “mysql://kamailioro:kamailioro@localhost/kamailio”.
123
124 Example 1.1. Set db_url parameter
125 ...
126 modparam("uri_db", "db_url", "mysql://username:password@localhost/kamailio")
127 ...
128
129 3.2. db_table (string)
130
131 The DB table that should be used. It is possible to use the
132 “subscriber” and “uri” table. If the “uri” table should be used, an
133 additional parameter “use_uri_table”) must be set.
134
135 Default value is “subscriber”.
136
137 Example 1.2. Set db_table parameter
138 ...
139 modparam("uri_db", "db_table", "uri")
140 ...
141
142 3.3. user_column (string)
143
144 Column holding usernames in the table.
145
146 Default value is “username”.
147
148 Example 1.3. Set user_column parameter
149 ...
150 modparam("uri_db", "user_column", "username")
151 ...
152
153 3.4. domain_column (string)
154
155 Column holding domain in the table.
156
157 Default value is “domain”.
158
159 Example 1.4. Set domain_column parameter
160 ...
161 modparam("uri_db", "domain_column", "domain")
162 ...
163
164 3.5. uriuser_column (string)
165
166 Column holding URI username in the table.
167
168 Default value is “uri_user”.
169
170 Example 1.5. Set uriuser_column parameter
171 ...
172 modparam("uri_db", "uriuser_column", "uri_user")
173 ...
174
175 3.6. use_uri_table (integer)
176
177 Specify if the “uri” table should be used for checking instead of
178 “subscriber” table. A non-zero value means true.
179
180 Default value is “0 (false)”.
181
182 Example 1.6. Set use_uri_table parameter
183 ...
184 modparam("uri_db", "use_uri_table", 1)
185 ...
186
187 3.7. use_domain (integer)
188
189 Specify if the domain part of the URI should be used to identify the
190 users (along with username). This is useful in multi domain setups, a
191 non-zero value means true.
192
193 This parameter is only evaluated for calls to “does_uri_exist”, all
194 other functions checks the digest username and realm against the given
195 username, if the “uri” table is used.
196
197 Default value is “0 (false)”.
198
199 Example 1.7. Set use_domain parameter
200 ...
201 modparam("uri_db", "use_domain", 1)
202 ...
203
204 4. Functions
205
206 4.1. check_to()
207 4.2. check_from()
208 4.3. check_uri(uri)
209 4.4. does_uri_exist()
210
211 4.1. check_to()
212
213 Check “To” username against URI table (if use_uri_table is set) or
214 digest credentials (no DB backend required).
215
216 This function can be used from REQUEST_ROUTE.
217
218 Example 1.8. check_to usage
219 ...
220 if (check_to()) {
221 ...
222 };
223 ...
224
225 4.2. check_from()
226
227 Check “From” username against URI table (if use_uri_table is set) or
228 digest credentials (no DB backend required).
229
230 This function can be used from REQUEST_ROUTE.
231
232 Example 1.9. check_from usage
233 ...
234 if (check_from()) {
235 ...
236 };
237 ...
238
239 4.3. check_uri(uri)
240
241 Check the username from the given uri against URI table (if
242 use_uri_table is set) or digest credentials (no DB backend required).
243
244 Description of parameters:
245 * uri Has to be a valid SIP URI, used to extract the username from.
246 The parameter can be a static or dynamic (with variables) string.
247
248 This function can be used from REQUEST_ROUTE.
249
250 Example 1.10. check_uri usage
251 ...
252 if (check_uri("$var(uri)")) {
253 ...
254 };
255 ...
256
257 4.4. does_uri_exist()
258
259 Check if username in the request URI belongs to an existing user.
260
261 The checking is done against the URI table (if use_uri_table is set) or
262 the subscriber table.
263
264 This function can be used from REQUEST_ROUTE.
265
266 Example 1.11. does_uri_exist usage
267 ...
268 if (does_uri_exist()) {
269 ...
270 };
271 ...