Browse code

modules_k/*: moved k modules in directory modules/

Daniel-Constantin Mierla authored on 20/01/2013 11:57:52
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,357 +0,0 @@
1
-Presence_XML Module
2
-
3
-Anca-Maria Vamanu
4
-
5
-   Voice Sistem SRL
6
-
7
-Edited by
8
-
9
-Anca-Maria Vamanu
10
-
11
-   Copyright © 2007 Voice Sistem SRL
12
-     __________________________________________________________________
13
-
14
-   Table of Contents
15
-
16
-   1. Admin Guide
17
-
18
-        1. Overview
19
-        2. Dependencies
20
-
21
-              2.1. Kamailio Modules
22
-              2.2. External Libraries or Applications
23
-
24
-        3. Parameters
25
-
26
-              3.1. db_url(str)
27
-              3.2. xcap_table(str)
28
-              3.3. disable_presence(int)
29
-              3.4. disable_winfo(int)
30
-              3.5. disable_bla(int)
31
-              3.6. force_active (int)
32
-              3.7. integrated_xcap_server (int)
33
-              3.8. xcap_server (str)
34
-              3.9. passive_mode(int)
35
-              3.10. xcapauth_userdel_reason(str)
36
-
37
-        4. Functions
38
-
39
-              4.1. pres_check_basic(presentity_uri, status)
40
-              4.2. pres_check_activities(presentity_uri, activity)
41
-
42
-        5. Installation
43
-        6. Exported pseudo-variables
44
-
45
-   2. Developer Guide
46
-
47
-   List of Examples
48
-
49
-   1.1. Set db_url parameter
50
-   1.2. Set xcap_table parameter
51
-   1.3. Set disable_presence parameter
52
-   1.4. Set disable_winfo parameter
53
-   1.5. Set disable_bla parameter
54
-   1.6. Set force_active parameter
55
-   1.7. Set integrated_xcap_server parameter
56
-   1.8. Set xcap_server parameter
57
-   1.9. Set passive_mode parameter
58
-   1.10. Set xcapauth_userdel_reason parameter
59
-   1.11. pres_check_basic usage
60
-   1.12. pres_check_activities usage
61
-
62
-Chapter 1. Admin Guide
63
-
64
-   Table of Contents
65
-
66
-   1. Overview
67
-   2. Dependencies
68
-
69
-        2.1. Kamailio Modules
70
-        2.2. External Libraries or Applications
71
-
72
-   3. Parameters
73
-
74
-        3.1. db_url(str)
75
-        3.2. xcap_table(str)
76
-        3.3. disable_presence(int)
77
-        3.4. disable_winfo(int)
78
-        3.5. disable_bla(int)
79
-        3.6. force_active (int)
80
-        3.7. integrated_xcap_server (int)
81
-        3.8. xcap_server (str)
82
-        3.9. passive_mode(int)
83
-        3.10. xcapauth_userdel_reason(str)
84
-
85
-   4. Functions
86
-
87
-        4.1. pres_check_basic(presentity_uri, status)
88
-        4.2. pres_check_activities(presentity_uri, activity)
89
-
90
-   5. Installation
91
-   6. Exported pseudo-variables
92
-
93
-1. Overview
94
-
95
-   The module does specific handling for notify-subscribe events using xml
96
-   bodies. It is used with the general event handling module, presence. It
97
-   constructs and adds 3 events to it:
98
-     * presence - SIMPLE status presence: RFC 3856
99
-     * presence.winfo - SIMPLE watcher info: RFC 3857
100
-     * dialog;sla (or dialog;ma) - Bridged Line Appearances (BLA) (or
101
-       Multiple Line Appearances (MLA)): draft-anil-sipping-bla
102
-
103
-   You can control which events are enabled via module parameters.
104
-
105
-   This module takes the XCAP permission rule documents from xcap_table.
106
-   The presence permission rules are interpreted according to the
107
-   specifications in RFC 4745 and RFC 5025.
108
-
109
-2. Dependencies
110
-
111
-   2.1. Kamailio Modules
112
-   2.2. External Libraries or Applications
113
-
114
-2.1. Kamailio Modules
115
-
116
-   The following modules must be loaded before this module:
117
-     * a database module.
118
-     * presence.
119
-     * sl.
120
-     * xcap_client.
121
-       Only compulsory if not using an integrated xcap server (if
122
-       'integrated_xcap_server' parameter is not set).
123
-
124
-2.2. External Libraries or Applications
125
-
126
-   The following libraries or applications must be installed before
127
-   running Kamailio with this module loaded:
128
-     * libxml.
129
-
130
-3. Parameters
131
-
132
-   3.1. db_url(str)
133
-   3.2. xcap_table(str)
134
-   3.3. disable_presence(int)
135
-   3.4. disable_winfo(int)
136
-   3.5. disable_bla(int)
137
-   3.6. force_active (int)
138
-   3.7. integrated_xcap_server (int)
139
-   3.8. xcap_server (str)
140
-   3.9. passive_mode(int)
141
-   3.10. xcapauth_userdel_reason(str)
142
-
143
-3.1. db_url(str)
144
-
145
-   The database URL.
146
-
147
-   Default value is “mysql://openser:openserrw@localhost/openser”.
148
-
149
-   Example 1.1. Set db_url parameter
150
-...
151
-modparam("presence_xml", "db_url", "dbdriver://username:password@dbhost/dbname")
152
-...
153
-
154
-3.2. xcap_table(str)
155
-
156
-   The name of the database table where XCAP documents are stored.
157
-
158
-   Default value is “xcap”.
159
-
160
-   Example 1.2. Set xcap_table parameter
161
-...
162
-modparam("presence_xml", "xcap_table", "xcaps")
163
-...
164
-
165
-3.3. disable_presence(int)
166
-
167
-   Set this parameter to disable the handling of the "presence" event.
168
-
169
-   Default value: “0”.
170
-
171
-   Example 1.3. Set disable_presence parameter
172
-...
173
-modparam("presence_xml", "disable_presence", 1)
174
-...
175
-
176
-3.4. disable_winfo(int)
177
-
178
-   Set this parameter to disable the handling of the "presence.winfo"
179
-   event.
180
-
181
-   Default value: “0”.
182
-
183
-   Example 1.4. Set disable_winfo parameter
184
-...
185
-modparam("presence_xml", "disable_winfo", 1)
186
-...
187
-
188
-3.5. disable_bla(int)
189
-
190
-   Set this parameter to disable the handling of the "dialog;sla" event.
191
-
192
-   Default value: “1” (0 - enabled, 1 - disabled).
193
-
194
-   Example 1.5. Set disable_bla parameter
195
-...
196
-modparam("presence_xml", "disable_bla", 1)
197
-...
198
-
199
-3.6. force_active (int)
200
-
201
-   This parameter is used for permissions when handling Subscribe
202
-   messages. If set to 1, subscription state is considered active and the
203
-   presentity is not queried for permissions (should be set to 1 if not
204
-   using an XCAP server). Otherwise, the XCAP server is queried and the
205
-   subscription states is according to user defined permission rules. If
206
-   no rules are defined for a certain watcher, the subscriptions remains
207
-   in pending state and the Notify sent will have no body.
208
-
209
-   Note: When switching from one value to another, the watchers table must
210
-   be emptied.
211
-
212
-   Default value is “0”.
213
-
214
-   Example 1.6. Set force_active parameter
215
-...
216
-modparam("presence_xml", "force_active", 1)
217
-...
218
-
219
-3.7. integrated_xcap_server (int)
220
-
221
-   This parameter is a flag for the type of XCAP servers used. If the XCAP
222
-   server is integrated with Kamailio presence_xml module and access the
223
-   same database tables directly, like the embedded XCAP server
224
-   implemented in xcap_server module, the parameter should be set to a
225
-   positive value. Apart from updating in xcap table, if the integrated
226
-   server is not running on the same Kamailio instance, it must send an MI
227
-   command refershWatchers [pres_uri] [event] when a user modifies a rules
228
-   document, to instruct the presence_xml module to update states from the
229
-   database and, if needed, send NOTIFY updates.
230
-
231
-   Otherwise, it uses xcap_client module to fetch documents from the XCAP
232
-   servers with HTTP requests. This mode is currently not supported.
233
-
234
-   Default value is “0”.
235
-
236
-   Example 1.7. Set integrated_xcap_server parameter
237
-...
238
-modparam("presence_xml", "integrated_xcap_server", 1)
239
-...
240
-
241
-3.8. xcap_server (str)
242
-
243
-   The address of the xcap servers used for storage. This parameter is
244
-   compulsory if the integrated_xcap_server parameter is not set. It can
245
-   be set more that once, to construct an address list of trusted XCAP
246
-   servers.
247
-
248
-   Example 1.8. Set xcap_server parameter
249
-...
250
-modparam("presence_xml", "xcap_server", "xcap_server.example.org")
251
-modparam("presence_xml", "xcap_server", "xcap_server.ag.org")
252
-...
253
-
254
-3.9. passive_mode(int)
255
-
256
-   If set to 1, module acts in passive mode - no bind to presence module,
257
-   no connection to database. Useful when needing only to use $xml(...)
258
-   pseudoc-variable.
259
-
260
-   Default value: “0” (0 - active mode, 1 - passive mode).
261
-
262
-   Example 1.9. Set passive_mode parameter
263
-...
264
-modparam("presence_xml", "passive_mode", 1)
265
-...
266
-
267
-3.10. xcapauth_userdel_reason(str)
268
-
269
-   This parameter represents the reason that will be included in the
270
-   Subscription-State header of the Notify when a rule is no longer found
271
-   in the XCAP pres-auth document for a user that was previously allowed.
272
-   The Subscription state in this case switches to "terminated". Because
273
-   it is not clear which reason is most appropriate in this case from the
274
-   ones defined by the RFC 3265, this parameter offers the possibility for
275
-   the admin to decide which one he wishes to use.
276
-
277
-   Default value: “probation” . Since probation also accepts a retry-after
278
-   parameter to specify after at least how may seconds the client should
279
-   reattempt to resubscribe, you can include this in the parameter also.
280
-
281
-   Example 1.10. Set xcapauth_userdel_reason parameter
282
-...
283
-modparam("presence_xml", "xcapauth_userdel_reason", "probation;retry-after=30")
284
-modparam("presence_xml", "xcapauth_userdel_reason", "rejected")
285
-...
286
-
287
-4. Functions
288
-
289
-   4.1. pres_check_basic(presentity_uri, status)
290
-   4.2. pres_check_activities(presentity_uri, activity)
291
-
292
-4.1.  pres_check_basic(presentity_uri, status)
293
-
294
-   Checks the /presence/tuple/status/basic nodes in the presentity for
295
-   presentity_uri against the value in status.
296
-
297
-   This function can be used from ANY_ROUTE.
298
-
299
-   Return code:
300
-     * 1 - if a match is found.
301
-     * -1 - if a match is not found.
302
-
303
-   Example 1.11. pres_check_basic usage
304
-...
305
-    if (pres_check_basic("$ru", "open")) {
306
-        ...
307
-    } else {
308
-        if (is_method("MESSAGE"))
309
-            m_store();
310
-    else
311
-        send_reply("404", "Not Found");
312
-    }
313
-...
314
-
315
-4.2.  pres_check_activities(presentity_uri, activity)
316
-
317
-   Checks whether a /presence/person/activities/activity node exists in
318
-   the presentity for presentity_uri.
319
-
320
-   This function can be used from ANY_ROUTE.
321
-
322
-   Return code:
323
-     * 1 - if a match is found.
324
-     * -1 - if a match is not found.
325
-     * -2 - if /presence/person or /presence/person/activity do not exist.
326
-
327
-   Example 1.12. pres_check_activities usage
328
-...
329
-    if (pres_check_basic("$ru", "open")) {
330
-        pres_check_activities("$ru", "unknown");
331
-        if ($retcode || $retcode == -2 || !is_method("INVITE"))
332
-            t_relay();
333
-        else
334
-            send_reply("486", "Busy Here");
335
-    } else {
336
-        ...
337
-    }
338
-...
339
-
340
-5. Installation
341
-
342
-   The module requires one table in Kamailio database: “xcap”. The SQL
343
-   syntax to create it can be found in presence-create.sql script in the
344
-   database directories in the kamailio/scripts folder. You can also find
345
-   the complete database documentation on the project webpage,
346
-   http://www.kamailio.org/docs/db-tables/kamailio-db-devel.html.
347
-
348
-6. Exported pseudo-variables
349
-
350
-     * $xml(name=>spec)
351
-
352
-   Exported pseudo-variables are documented at
353
-   http://www.kamailio.org/dokuwiki/.
354
-
355
-Chapter 2. Developer Guide
356
-
357
-   The module exports no function to be used in other Kamailio modules.
Browse code

modules_k/presence_xml Xcap auth reason when user deleted from list

The reason in Subscription-Status header in Notify when a user is
deleted from the contact list can be decided by the admin by setting
presence_xml module parameter xcapauth_usedel_reason. Default value is
"probation".
(cherry picked from commit 3abf967f61a1bd95c28d4e8a929a8bd5df00671d)

Anca Vamanu authored on 27/06/2012 15:34:55
Showing 1 changed files
... ...
@@ -32,6 +32,7 @@ Anca-Maria Vamanu
32 32
               3.7. integrated_xcap_server (int)
33 33
               3.8. xcap_server (str)
34 34
               3.9. passive_mode(int)
35
+              3.10. xcapauth_userdel_reason(str)
35 36
 
36 37
         4. Functions
37 38
 
... ...
@@ -54,8 +55,9 @@ Anca-Maria Vamanu
54 55
    1.7. Set integrated_xcap_server parameter
55 56
    1.8. Set xcap_server parameter
56 57
    1.9. Set passive_mode parameter
57
-   1.10. pres_check_basic usage
58
-   1.11. pres_check_activities usage
58
+   1.10. Set xcapauth_userdel_reason parameter
59
+   1.11. pres_check_basic usage
60
+   1.12. pres_check_activities usage
59 61
 
60 62
 Chapter 1. Admin Guide
61 63
 
... ...
@@ -78,6 +80,7 @@ Chapter 1. Admin Guide
78 80
         3.7. integrated_xcap_server (int)
79 81
         3.8. xcap_server (str)
80 82
         3.9. passive_mode(int)
83
+        3.10. xcapauth_userdel_reason(str)
81 84
 
82 85
    4. Functions
83 86
 
... ...
@@ -135,6 +138,7 @@ Chapter 1. Admin Guide
135 138
    3.7. integrated_xcap_server (int)
136 139
    3.8. xcap_server (str)
137 140
    3.9. passive_mode(int)
141
+   3.10. xcapauth_userdel_reason(str)
138 142
 
139 143
 3.1. db_url(str)
140 144
 
... ...
@@ -260,6 +264,26 @@ modparam("presence_xml", "xcap_server", "xcap_server.ag.org")
260 264
 modparam("presence_xml", "passive_mode", 1)
261 265
 ...
262 266
 
267
+3.10. xcapauth_userdel_reason(str)
268
+
269
+   This parameter represents the reason that will be included in the
270
+   Subscription-State header of the Notify when a rule is no longer found
271
+   in the XCAP pres-auth document for a user that was previously allowed.
272
+   The Subscription state in this case switches to "terminated". Because
273
+   it is not clear which reason is most appropriate in this case from the
274
+   ones defined by the RFC 3265, this parameter offers the possibility for
275
+   the admin to decide which one he wishes to use.
276
+
277
+   Default value: “probation” . Since probation also accepts a retry-after
278
+   parameter to specify after at least how may seconds the client should
279
+   reattempt to resubscribe, you can include this in the parameter also.
280
+
281
+   Example 1.10. Set xcapauth_userdel_reason parameter
282
+...
283
+modparam("presence_xml", "xcapauth_userdel_reason", "probation;retry-after=30")
284
+modparam("presence_xml", "xcapauth_userdel_reason", "rejected")
285
+...
286
+
263 287
 4. Functions
264 288
 
265 289
    4.1. pres_check_basic(presentity_uri, status)
... ...
@@ -276,7 +300,7 @@ modparam("presence_xml", "passive_mode", 1)
276 300
      * 1 - if a match is found.
277 301
      * -1 - if a match is not found.
278 302
 
279
-   Example 1.10. pres_check_basic usage
303
+   Example 1.11. pres_check_basic usage
280 304
 ...
281 305
     if (pres_check_basic("$ru", "open")) {
282 306
         ...
... ...
@@ -300,7 +324,7 @@ modparam("presence_xml", "passive_mode", 1)
300 324
      * -1 - if a match is not found.
301 325
      * -2 - if /presence/person or /presence/person/activity do not exist.
302 326
 
303
-   Example 1.11. pres_check_activities usage
327
+   Example 1.12. pres_check_activities usage
304 328
 ...
305 329
     if (pres_check_basic("$ru", "open")) {
306 330
         pres_check_activities("$ru", "unknown");
Browse code

modules_k/presence_xml: pidf-manipulation now fetched using event->get_pidf_doc()

- Part of the fix to the way presence hard-state works.
- Removed the, now unused, pidf_manipulation modparam

Peter Dunkley authored on 01/06/2012 10:48:29
Showing 1 changed files
... ...
@@ -8,7 +8,7 @@ Edited by
8 8
 
9 9
 Anca-Maria Vamanu
10 10
 
11
-   Copyright � 2007 Voice Sistem SRL
11
+   Copyright © 2007 Voice Sistem SRL
12 12
      __________________________________________________________________
13 13
 
14 14
    Table of Contents
... ...
@@ -29,10 +29,9 @@ Anca-Maria Vamanu
29 29
               3.4. disable_winfo(int)
30 30
               3.5. disable_bla(int)
31 31
               3.6. force_active (int)
32
-              3.7. pidf_manipulation (int)
33
-              3.8. integrated_xcap_server (int)
34
-              3.9. xcap_server (str)
35
-              3.10. passive_mode(int)
32
+              3.7. integrated_xcap_server (int)
33
+              3.8. xcap_server (str)
34
+              3.9. passive_mode(int)
36 35
 
37 36
         4. Functions
38 37
 
... ...
@@ -52,12 +51,11 @@ Anca-Maria Vamanu
52 51
    1.4. Set disable_winfo parameter
53 52
    1.5. Set disable_bla parameter
54 53
    1.6. Set force_active parameter
55
-   1.7. Set pidf_manipulation parameter
56
-   1.8. Set integrated_xcap_server parameter
57
-   1.9. Set xcap_server parameter
58
-   1.10. Set passive_mode parameter
59
-   1.11. pres_check_basic usage
60
-   1.12. pres_check_activities usage
54
+   1.7. Set integrated_xcap_server parameter
55
+   1.8. Set xcap_server parameter
56
+   1.9. Set passive_mode parameter
57
+   1.10. pres_check_basic usage
58
+   1.11. pres_check_activities usage
61 59
 
62 60
 Chapter 1. Admin Guide
63 61
 
... ...
@@ -77,10 +75,9 @@ Chapter 1. Admin Guide
77 75
         3.4. disable_winfo(int)
78 76
         3.5. disable_bla(int)
79 77
         3.6. force_active (int)
80
-        3.7. pidf_manipulation (int)
81
-        3.8. integrated_xcap_server (int)
82
-        3.9. xcap_server (str)
83
-        3.10. passive_mode(int)
78
+        3.7. integrated_xcap_server (int)
79
+        3.8. xcap_server (str)
80
+        3.9. passive_mode(int)
84 81
 
85 82
    4. Functions
86 83
 
... ...
@@ -135,16 +132,15 @@ Chapter 1. Admin Guide
135 132
    3.4. disable_winfo(int)
136 133
    3.5. disable_bla(int)
137 134
    3.6. force_active (int)
138
-   3.7. pidf_manipulation (int)
139
-   3.8. integrated_xcap_server (int)
140
-   3.9. xcap_server (str)
141
-   3.10. passive_mode(int)
135
+   3.7. integrated_xcap_server (int)
136
+   3.8. xcap_server (str)
137
+   3.9. passive_mode(int)
142 138
 
143 139
 3.1. db_url(str)
144 140
 
145 141
    The database URL.
146 142
 
147
-   Default value is "mysql://openser:openserrw@localhost/openser".
143
+   Default value is “mysql://openser:openserrw@localhost/openser”.
148 144
 
149 145
    Example 1.1. Set db_url parameter
150 146
 ...
... ...
@@ -155,7 +151,7 @@ modparam("presence_xml", "db_url", "dbdriver://username:password@dbhost/dbname")
155 151
 
156 152
    The name of the database table where XCAP documents are stored.
157 153
 
158
-   Default value is "xcap".
154
+   Default value is “xcap”.
159 155
 
160 156
    Example 1.2. Set xcap_table parameter
161 157
 ...
... ...
@@ -166,7 +162,7 @@ modparam("presence_xml", "xcap_table", "xcaps")
166 162
 
167 163
    Set this parameter to disable the handling of the "presence" event.
168 164
 
169
-   Default value: "0".
165
+   Default value: “0”.
170 166
 
171 167
    Example 1.3. Set disable_presence parameter
172 168
 ...
... ...
@@ -178,7 +174,7 @@ modparam("presence_xml", "disable_presence", 1)
178 174
    Set this parameter to disable the handling of the "presence.winfo"
179 175
    event.
180 176
 
181
-   Default value: "0".
177
+   Default value: “0”.
182 178
 
183 179
    Example 1.4. Set disable_winfo parameter
184 180
 ...
... ...
@@ -189,7 +185,7 @@ modparam("presence_xml", "disable_winfo", 1)
189 185
 
190 186
    Set this parameter to disable the handling of the "dialog;sla" event.
191 187
 
192
-   Default value: "1" (0 - enabled, 1 - disabled).
188
+   Default value: “1” (0 - enabled, 1 - disabled).
193 189
 
194 190
    Example 1.5. Set disable_bla parameter
195 191
 ...
... ...
@@ -209,32 +205,14 @@ modparam("presence_xml", "disable_bla", 1)
209 205
    Note: When switching from one value to another, the watchers table must
210 206
    be emptied.
211 207
 
212
-   Default value is "0".
208
+   Default value is “0”.
213 209
 
214 210
    Example 1.6. Set force_active parameter
215 211
 ...
216 212
 modparam("presence_xml", "force_active", 1)
217 213
 ...
218 214
 
219
-3.7. pidf_manipulation (int)
220
-
221
-   Setting this parameter to 1 enables the features described in RFC 4827.
222
-   It gives the possibility to have a permanent state notified to the
223
-   users even in the case in which the phone is not online. The presence
224
-   document is taken from the XCAP server and aggregated together with the
225
-   other presence information, if any exist, for each Notify that is sent
226
-   to the watchers. It is also possible to have information notified even
227
-   if not issuing any Publish (useful for services such as email, SMS,
228
-   MMS).
229
-
230
-   Default value is "0".
231
-
232
-   Example 1.7. Set pidf_manipulation parameter
233
-...
234
-modparam("presence_xml", "pidf_manipulation", 1)
235
-...
236
-
237
-3.8. integrated_xcap_server (int)
215
+3.7. integrated_xcap_server (int)
238 216
 
239 217
    This parameter is a flag for the type of XCAP servers used. If the XCAP
240 218
    server is integrated with Kamailio presence_xml module and access the
... ...
@@ -249,35 +227,35 @@ modparam("presence_xml", "pidf_manipulation", 1)
249 227
    Otherwise, it uses xcap_client module to fetch documents from the XCAP
250 228
    servers with HTTP requests. This mode is currently not supported.
251 229
 
252
-   Default value is "0".
230
+   Default value is “0”.
253 231
 
254
-   Example 1.8. Set integrated_xcap_server parameter
232
+   Example 1.7. Set integrated_xcap_server parameter
255 233
 ...
256 234
 modparam("presence_xml", "integrated_xcap_server", 1)
257 235
 ...
258 236
 
259
-3.9. xcap_server (str)
237
+3.8. xcap_server (str)
260 238
 
261 239
    The address of the xcap servers used for storage. This parameter is
262 240
    compulsory if the integrated_xcap_server parameter is not set. It can
263 241
    be set more that once, to construct an address list of trusted XCAP
264 242
    servers.
265 243
 
266
-   Example 1.9. Set xcap_server parameter
244
+   Example 1.8. Set xcap_server parameter
267 245
 ...
268 246
 modparam("presence_xml", "xcap_server", "xcap_server.example.org")
269 247
 modparam("presence_xml", "xcap_server", "xcap_server.ag.org")
270 248
 ...
271 249
 
272
-3.10. passive_mode(int)
250
+3.9. passive_mode(int)
273 251
 
274 252
    If set to 1, module acts in passive mode - no bind to presence module,
275 253
    no connection to database. Useful when needing only to use $xml(...)
276 254
    pseudoc-variable.
277 255
 
278
-   Default value: "0" (0 - active mode, 1 - passive mode).
256
+   Default value: “0” (0 - active mode, 1 - passive mode).
279 257
 
280
-   Example 1.10. Set passive_mode parameter
258
+   Example 1.9. Set passive_mode parameter
281 259
 ...
282 260
 modparam("presence_xml", "passive_mode", 1)
283 261
 ...
... ...
@@ -287,7 +265,7 @@ modparam("presence_xml", "passive_mode", 1)
287 265
    4.1. pres_check_basic(presentity_uri, status)
288 266
    4.2. pres_check_activities(presentity_uri, activity)
289 267
 
290
-4.1. pres_check_basic(presentity_uri, status)
268
+4.1.  pres_check_basic(presentity_uri, status)
291 269
 
292 270
    Checks the /presence/tuple/status/basic nodes in the presentity for
293 271
    presentity_uri against the value in status.
... ...
@@ -298,7 +276,7 @@ modparam("presence_xml", "passive_mode", 1)
298 276
      * 1 - if a match is found.
299 277
      * -1 - if a match is not found.
300 278
 
301
-   Example 1.11. pres_check_basic usage
279
+   Example 1.10. pres_check_basic usage
302 280
 ...
303 281
     if (pres_check_basic("$ru", "open")) {
304 282
         ...
... ...
@@ -310,7 +288,7 @@ modparam("presence_xml", "passive_mode", 1)
310 288
     }
311 289
 ...
312 290
 
313
-4.2. pres_check_activities(presentity_uri, activity)
291
+4.2.  pres_check_activities(presentity_uri, activity)
314 292
 
315 293
    Checks whether a /presence/person/activities/activity node exists in
316 294
    the presentity for presentity_uri.
... ...
@@ -322,7 +300,7 @@ modparam("presence_xml", "passive_mode", 1)
322 300
      * -1 - if a match is not found.
323 301
      * -2 - if /presence/person or /presence/person/activity do not exist.
324 302
 
325
-   Example 1.12. pres_check_activities usage
303
+   Example 1.11. pres_check_activities usage
326 304
 ...
327 305
     if (pres_check_basic("$ru", "open")) {
328 306
         pres_check_activities("$ru", "unknown");
... ...
@@ -337,7 +315,7 @@ modparam("presence_xml", "passive_mode", 1)
337 315
 
338 316
 5. Installation
339 317
 
340
-   The module requires one table in Kamailio database: "xcap". The SQL
318
+   The module requires one table in Kamailio database: “xcap”. The SQL
341 319
    syntax to create it can be found in presence-create.sql script in the
342 320
    database directories in the kamailio/scripts folder. You can also find
343 321
    the complete database documentation on the project webpage,
Browse code

presence_xml: updates to docs to refer to embedded xcap server

Daniel-Constantin Mierla authored on 20/04/2012 07:42:39
Showing 1 changed files
... ...
@@ -21,7 +21,7 @@ Anca-Maria Vamanu
21 21
               2.1. Kamailio Modules
22 22
               2.2. External Libraries or Applications
23 23
 
24
-        3. Exported Parameters
24
+        3. Parameters
25 25
 
26 26
               3.1. db_url(str)
27 27
               3.2. xcap_table(str)
... ...
@@ -34,7 +34,7 @@ Anca-Maria Vamanu
34 34
               3.9. xcap_server (str)
35 35
               3.10. passive_mode(int)
36 36
 
37
-        4. Exported Functions
37
+        4. Functions
38 38
 
39 39
               4.1. pres_check_basic(presentity_uri, status)
40 40
               4.2. pres_check_activities(presentity_uri, activity)
... ...
@@ -69,7 +69,7 @@ Chapter 1. Admin Guide
69 69
         2.1. Kamailio Modules
70 70
         2.2. External Libraries or Applications
71 71
 
72
-   3. Exported Parameters
72
+   3. Parameters
73 73
 
74 74
         3.1. db_url(str)
75 75
         3.2. xcap_table(str)
... ...
@@ -82,7 +82,7 @@ Chapter 1. Admin Guide
82 82
         3.9. xcap_server (str)
83 83
         3.10. passive_mode(int)
84 84
 
85
-   4. Exported Functions
85
+   4. Functions
86 86
 
87 87
         4.1. pres_check_basic(presentity_uri, status)
88 88
         4.2. pres_check_activities(presentity_uri, activity)
... ...
@@ -127,7 +127,7 @@ Chapter 1. Admin Guide
127 127
    running Kamailio with this module loaded:
128 128
      * libxml.
129 129
 
130
-3. Exported Parameters
130
+3. Parameters
131 131
 
132 132
    3.1. db_url(str)
133 133
    3.2. xcap_table(str)
... ...
@@ -236,14 +236,15 @@ modparam("presence_xml", "pidf_manipulation", 1)
236 236
 
237 237
 3.8. integrated_xcap_server (int)
238 238
 
239
-   This parameter is a flag for the type of XCAP server or servers used.
240
-   If the XCAP server is integrated with Kamailio presence_XML module and
241
-   access the same database tables directly, like the XCAP-lite server
242
-   from AG Projects, the parameter should be set to a positive value.
243
-   Apart from updating in xcap table, the integrated server must send an
244
-   MI command refershWatchers [pres_uri] [event] when a user modifies a
245
-   rules document, to instruct the presence_xml module to update states
246
-   from the database and, if needed, send NOTIFY updates.
239
+   This parameter is a flag for the type of XCAP servers used. If the XCAP
240
+   server is integrated with Kamailio presence_xml module and access the
241
+   same database tables directly, like the embedded XCAP server
242
+   implemented in xcap_server module, the parameter should be set to a
243
+   positive value. Apart from updating in xcap table, if the integrated
244
+   server is not running on the same Kamailio instance, it must send an MI
245
+   command refershWatchers [pres_uri] [event] when a user modifies a rules
246
+   document, to instruct the presence_xml module to update states from the
247
+   database and, if needed, send NOTIFY updates.
247 248
 
248 249
    Otherwise, it uses xcap_client module to fetch documents from the XCAP
249 250
    servers with HTTP requests. This mode is currently not supported.
... ...
@@ -281,7 +282,7 @@ modparam("presence_xml", "xcap_server", "xcap_server.ag.org")
281 282
 modparam("presence_xml", "passive_mode", 1)
282 283
 ...
283 284
 
284
-4. Exported Functions
285
+4. Functions
285 286
 
286 287
    4.1. pres_check_basic(presentity_uri, status)
287 288
    4.2. pres_check_activities(presentity_uri, activity)
Browse code

modules dockbook: a bit of restructuring for better ToC

Daniel-Constantin Mierla authored on 01/10/2011 11:54:38
Showing 1 changed files
... ...
@@ -8,7 +8,7 @@ Edited by
8 8
 
9 9
 Anca-Maria Vamanu
10 10
 
11
-   Copyright © 2007 Voice Sistem SRL
11
+   Copyright � 2007 Voice Sistem SRL
12 12
      __________________________________________________________________
13 13
 
14 14
    Table of Contents
... ...
@@ -36,9 +36,8 @@ Anca-Maria Vamanu
36 36
 
37 37
         4. Exported Functions
38 38
 
39
-              4.1. pres_check_basic(char *presentity_uri, char *status)
40
-              4.2. pres_check_activities(char *presentity_uri, char
41
-                      *activity)
39
+              4.1. pres_check_basic(presentity_uri, status)
40
+              4.2. pres_check_activities(presentity_uri, activity)
42 41
 
43 42
         5. Installation
44 43
         6. Exported pseudo-variables
... ...
@@ -85,8 +84,8 @@ Chapter 1. Admin Guide
85 84
 
86 85
    4. Exported Functions
87 86
 
88
-        4.1. pres_check_basic(char *presentity_uri, char *status)
89
-        4.2. pres_check_activities(char *presentity_uri, char *activity)
87
+        4.1. pres_check_basic(presentity_uri, status)
88
+        4.2. pres_check_activities(presentity_uri, activity)
90 89
 
91 90
    5. Installation
92 91
    6. Exported pseudo-variables
... ...
@@ -145,7 +144,7 @@ Chapter 1. Admin Guide
145 144
 
146 145
    The database URL.
147 146
 
148
-   Default value is “mysql://openser:openserrw@localhost/openser”.
147
+   Default value is "mysql://openser:openserrw@localhost/openser".
149 148
 
150 149
    Example 1.1. Set db_url parameter
151 150
 ...
... ...
@@ -156,7 +155,7 @@ modparam("presence_xml", "db_url", "dbdriver://username:password@dbhost/dbname")
156 155
 
157 156
    The name of the database table where XCAP documents are stored.
158 157
 
159
-   Default value is “xcap”.
158
+   Default value is "xcap".
160 159
 
161 160
    Example 1.2. Set xcap_table parameter
162 161
 ...
... ...
@@ -167,7 +166,7 @@ modparam("presence_xml", "xcap_table", "xcaps")
167 166
 
168 167
    Set this parameter to disable the handling of the "presence" event.
169 168
 
170
-   Default value: “0”.
169
+   Default value: "0".
171 170
 
172 171
    Example 1.3. Set disable_presence parameter
173 172
 ...
... ...
@@ -179,7 +178,7 @@ modparam("presence_xml", "disable_presence", 1)
179 178
    Set this parameter to disable the handling of the "presence.winfo"
180 179
    event.
181 180
 
182
-   Default value: “0”.
181
+   Default value: "0".
183 182
 
184 183
    Example 1.4. Set disable_winfo parameter
185 184
 ...
... ...
@@ -190,7 +189,7 @@ modparam("presence_xml", "disable_winfo", 1)
190 189
 
191 190
    Set this parameter to disable the handling of the "dialog;sla" event.
192 191
 
193
-   Default value: “1” (0 - enabled, 1 - disabled).
192
+   Default value: "1" (0 - enabled, 1 - disabled).
194 193
 
195 194
    Example 1.5. Set disable_bla parameter
196 195
 ...
... ...
@@ -210,7 +209,7 @@ modparam("presence_xml", "disable_bla", 1)
210 209
    Note: When switching from one value to another, the watchers table must
211 210
    be emptied.
212 211
 
213
-   Default value is “0”.
212
+   Default value is "0".
214 213
 
215 214
    Example 1.6. Set force_active parameter
216 215
 ...
... ...
@@ -228,7 +227,7 @@ modparam("presence_xml", "force_active", 1)
228 227
    if not issuing any Publish (useful for services such as email, SMS,
229 228
    MMS).
230 229
 
231
-   Default value is “0”.
230
+   Default value is "0".
232 231
 
233 232
    Example 1.7. Set pidf_manipulation parameter
234 233
 ...
... ...
@@ -249,7 +248,7 @@ modparam("presence_xml", "pidf_manipulation", 1)
249 248
    Otherwise, it uses xcap_client module to fetch documents from the XCAP
250 249
    servers with HTTP requests. This mode is currently not supported.
251 250
 
252
-   Default value is “0”.
251
+   Default value is "0".
253 252
 
254 253
    Example 1.8. Set integrated_xcap_server parameter
255 254
 ...
... ...
@@ -275,7 +274,7 @@ modparam("presence_xml", "xcap_server", "xcap_server.ag.org")
275 274
    no connection to database. Useful when needing only to use $xml(...)
276 275
    pseudoc-variable.
277 276
 
278
-   Default value: “0” (0 - active mode, 1 - passive mode).
277
+   Default value: "0" (0 - active mode, 1 - passive mode).
279 278
 
280 279
    Example 1.10. Set passive_mode parameter
281 280
 ...
... ...
@@ -284,10 +283,10 @@ modparam("presence_xml", "passive_mode", 1)
284 283
 
285 284
 4. Exported Functions
286 285
 
287
-   4.1. pres_check_basic(char *presentity_uri, char *status)
288
-   4.2. pres_check_activities(char *presentity_uri, char *activity)
286
+   4.1. pres_check_basic(presentity_uri, status)
287
+   4.2. pres_check_activities(presentity_uri, activity)
289 288
 
290
-4.1.  pres_check_basic(char *presentity_uri, char *status)
289
+4.1. pres_check_basic(presentity_uri, status)
291 290
 
292 291
    Checks the /presence/tuple/status/basic nodes in the presentity for
293 292
    presentity_uri against the value in status.
... ...
@@ -310,7 +309,7 @@ modparam("presence_xml", "passive_mode", 1)
310 309
     }
311 310
 ...
312 311
 
313
-4.2.  pres_check_activities(char *presentity_uri, char *activity)
312
+4.2. pres_check_activities(presentity_uri, activity)
314 313
 
315 314
    Checks whether a /presence/person/activities/activity node exists in
316 315
    the presentity for presentity_uri.
... ...
@@ -337,7 +336,7 @@ modparam("presence_xml", "passive_mode", 1)
337 336
 
338 337
 5. Installation
339 338
 
340
-   The module requires one table in Kamailio database: “xcap”. The SQL
339
+   The module requires one table in Kamailio database: "xcap". The SQL
341 340
    syntax to create it can be found in presence-create.sql script in the
342 341
    database directories in the kamailio/scripts folder. You can also find
343 342
    the complete database documentation on the project webpage,
Browse code

modules_k/presence_xml: Modified pres_check_activities() to return -2 when part of the XML tree is not present

- This is needed because some presence UAs (such as pua_usrloc) only
fill in the basic part of the tree. This change enables you to
distinguish between not having a particular activity set (by a client
that supports that) and not having any activities at all (by clients
that only support basic presence).

pd authored on 18/08/2011 14:12:33
Showing 1 changed files
... ...
@@ -320,11 +320,13 @@ modparam("presence_xml", "passive_mode", 1)
320 320
    Return code:
321 321
      * 1 - if a match is found.
322 322
      * -1 - if a match is not found.
323
+     * -2 - if /presence/person or /presence/person/activity do not exist.
323 324
 
324 325
    Example 1.12. pres_check_activities usage
325 326
 ...
326 327
     if (pres_check_basic("$ru", "open")) {
327
-        if (pres_check_activities("$ru", "unknown") || !is_method("INVITE"))
328
+        pres_check_activities("$ru", "unknown");
329
+        if ($retcode || $retcode == -2 || !is_method("INVITE"))
328 330
             t_relay();
329 331
         else
330 332
             send_reply("486", "Busy Here");
Browse code

modules_k/presence, modules_k/presence_xml: Added new exported functions to enable the online status of a user to be checked

- Exported two new API functions from presence (get_presentity() and
free_presentity()). These functions are used by the new exported
functions.

- Added two new exported functions to presence_xml. pres_check_basic()
enables you to find out whether a users basic status matches the
string you provide. pres_check_activities() enables you to find out
whether any of a users listed activities matches the string you
provide.

pres_check_basic() effectively lets you tell whether a user is
online or offline (based on presence). pres_check_activities()
lets you see what a user is currently doing (for example, is the
user too busy to take a call?).

The results from these exported functions can be used