Browse code

modules: readme files regenerated - presence ... [skip ci]

Kamailio Dev authored on 25/01/2018 18:46:34
Showing 1 changed files
... ...
@@ -1,1429 +1,2 @@
1
-Presence Module
2 1
 
3
-Anca-Maria Vamanu
4 2
 
5
-   Voice Sistem SRL
6
-
7
-Juha Heinanen
8
-
9
-   TutPro Inc.
10
-
11
-Edited by
12
-
13
-Anca-Maria Vamanu
14
-
15
-Edited by
16
-
17
-Juha Heinanen
18
-
19
-   Copyright © 2006 Voice Sistem SRL
20
-
21
-   Copyright © 2009 Juha Heinanen
22
-     __________________________________________________________________
23
-
24
-   Table of Contents
25
-
26
-   1. Admin Guide
27
-
28
-        1. Overview
29
-        2. Dependencies
30
-
31
-              2.1. Kamailio Modules
32
-              2.2. External Libraries or Applications
33
-
34
-        3. Parameters
35
-
36
-              3.1. db_url(str)
37
-              3.2. presentity_table(str)
38
-              3.3. active_watchers_table(str)
39
-              3.4. watchers_table(str)
40
-              3.5. clean_period (int)
41
-              3.6. cseq_offset (int)
42
-              3.7. db_update_period (int)
43
-              3.8. waitn_time (int)
44
-              3.9. notifier_poll_rate (int)
45
-              3.10. notifier_processes (int)
46
-              3.11. force_delete (int)
47
-              3.12. startup_mode (int)
48
-              3.13. to_tag_pref (str)
49
-              3.14. expires_offset (int)
50
-              3.15. max_expires (int)
51
-              3.16. min_expires (int)
52
-              3.17. min_expires_action (int)
53
-              3.18. server_address (str)
54
-              3.19. subs_db_mode (int)
55
-              3.20. publ_cache (int)
56
-              3.21. subs_htable_size (int)
57
-              3.22. pres_htable_size (int)
58
-              3.23. send_fast_notify (int)
59
-              3.24. enable_sphere_check (int)
60
-              3.25. timeout_rm_subs (int)
61
-              3.26. fetch_rows (integer)
62
-              3.27. db_table_lock_type (integer)
63
-              3.28. local_log_level (int)
64
-              3.29. local_log_facility (int)
65
-              3.30. subs_remove_match (int)
66
-              3.31. xavp_cfg (str)
67
-              3.32. retrieve_order (int)
68
-              3.33. retrieve_order_by (str)
69
-              3.34. sip_uri_match (int)
70
-
71
-        4. Functions
72
-
73
-              4.1. handle_publish([sender_uri])
74
-              4.2. handle_subscribe([watcher_uri])
75
-              4.3. pres_auth_status(watcher_uri, presentity_uri)
76
-              4.4. pres_has_subscribers(presentity_uri, event)
77
-              4.5. pres_refresh_watchers(uri, event, type[, file_uri,
78
-                      filename])
79
-
80
-              4.6. pres_update_watchers(uri, event)
81
-
82
-        5. RPC Commands
83
-
84
-              5.1. presence.cleanup
85
-              5.2. presence.refreshWatchers
86
-
87
-        6. Exported Variables
88
-
89
-              6.1. $subs(attr)
90
-              6.2. $notify_reply(attr)
91
-
92
-        7. Events
93
-
94
-              7.1. present:notify-reply
95
-
96
-        8. Installation
97
-
98
-   2. Developer Guide
99
-
100
-        1. bind_presence(presence_api_t* api)
101
-        2. add_event
102
-        3. get_rules_doc
103
-        4. get_auth_status
104
-        5. apply_auth_nbody
105
-        6. agg_nbody
106
-        7. free_body
107
-        8. aux_body_processing
108
-        9. aux_free_body
109
-        10. evs_publ_handl
110
-        11. evs_subs_handl
111
-        12. contains_event
112
-        13. get_event_list
113
-        14. update_watchers_status
114
-        15. get_sphere
115
-        16. get_presentity
116
-        17. free_presentity
117
-
118
-   List of Examples
119
-
120
-   1.1. Set db_url parameter
121
-   1.2. Set presentity_table parameter
122
-   1.3. Set active_watchers_table parameter
123
-   1.4. Set watchers_table parameter
124
-   1.5. Set clean_period parameter
125
-   1.6. Set cseq_offset parameter
126
-   1.7. Set db_update_period parameter
127
-   1.8. Set waitn_time parameter
128
-   1.9. Set notifier_poll_rate parameter
129
-   1.10. Set notifier_processes parameter
130
-   1.11. Set force_delete parameter
131
-   1.12. Set startup_mode parameter
132
-   1.13. Set to_tag_pref parameter
133
-   1.14. Set expires_offset parameter
134
-   1.15. Set max_expires parameter
135
-   1.16. Set min_expires parameter
136
-   1.17. Set min_expires parameter
137
-   1.18. Set server_address parameter
138
-   1.19. Set subs_db_mode parameter
139
-   1.20. Set publ_cache parameter
140
-   1.21. Set subs_htable_size parameter
141
-   1.22. Set pres_htable_size parameter
142
-   1.23. Set send_fast_notify parameter
143
-   1.24. Set enable_sphere_check parameter
144
-   1.25. Set timeout_rm_subs parameter
145
-   1.26. Set fetch_rows parameter
146
-   1.27. Set db_table_lock_type parameter
147
-   1.28. Set local_log_level parameter
148
-   1.29. Set local_log_facility parameter
149
-   1.30. Set subs_remove_match parameter
150
-   1.31. Set xavp_cfg parameter
151
-   1.32. Set retrieve_order parameter
152
-   1.33. Set retrieve_order_by parameter
153
-   1.34. Set sip_uri_match parameter
154
-   1.35. handle_publish usage
155
-   1.36. handle_subscribe usage
156
-   1.37. pres_auth_status usage
157
-   1.38. pres_has_subscribers usage
158
-   1.39. pres_refresh_watchers usage
159
-   1.40. pres_update_watchers usage
160
-   1.41. $subs(name) usage
161
-   1.42. $notify_reply(name) usage
162
-   1.43. $notify_reply(name) usage
163
-   2.1. presence_api_t structure
164
-
165
-Chapter 1. Admin Guide
166
-
167
-   Table of Contents
168
-
169
-   1. Overview
170
-   2. Dependencies
171
-
172
-        2.1. Kamailio Modules
173
-        2.2. External Libraries or Applications
174
-
175
-   3. Parameters
176
-
177
-        3.1. db_url(str)
178
-        3.2. presentity_table(str)
179
-        3.3. active_watchers_table(str)
180
-        3.4. watchers_table(str)
181
-        3.5. clean_period (int)
182
-        3.6. cseq_offset (int)
183
-        3.7. db_update_period (int)
184
-        3.8. waitn_time (int)
185
-        3.9. notifier_poll_rate (int)
186
-        3.10. notifier_processes (int)
187
-        3.11. force_delete (int)
188
-        3.12. startup_mode (int)
189
-        3.13. to_tag_pref (str)
190
-        3.14. expires_offset (int)
191
-        3.15. max_expires (int)
192
-        3.16. min_expires (int)
193
-        3.17. min_expires_action (int)
194
-        3.18. server_address (str)
195
-        3.19. subs_db_mode (int)
196
-        3.20. publ_cache (int)
197
-        3.21. subs_htable_size (int)
198
-        3.22. pres_htable_size (int)
199
-        3.23. send_fast_notify (int)
200
-        3.24. enable_sphere_check (int)
201
-        3.25. timeout_rm_subs (int)
202
-        3.26. fetch_rows (integer)
203
-        3.27. db_table_lock_type (integer)
204
-        3.28. local_log_level (int)
205
-        3.29. local_log_facility (int)
206
-        3.30. subs_remove_match (int)
207
-        3.31. xavp_cfg (str)
208
-        3.32. retrieve_order (int)
209
-        3.33. retrieve_order_by (str)
210
-        3.34. sip_uri_match (int)
211
-
212
-   4. Functions
213
-
214
-        4.1. handle_publish([sender_uri])
215
-        4.2. handle_subscribe([watcher_uri])
216
-        4.3. pres_auth_status(watcher_uri, presentity_uri)
217
-        4.4. pres_has_subscribers(presentity_uri, event)
218
-        4.5. pres_refresh_watchers(uri, event, type[, file_uri, filename])
219
-
220
-        4.6. pres_update_watchers(uri, event)
221
-
222
-   5. RPC Commands
223
-
224
-        5.1. presence.cleanup
225
-        5.2. presence.refreshWatchers
226
-
227
-   6. Exported Variables
228
-
229
-        6.1. $subs(attr)
230
-        6.2. $notify_reply(attr)
231
-
232
-   7. Events
233
-
234
-        7.1. present:notify-reply
235
-
236
-   8. Installation
237
-
238
-1. Overview
239
-
240
-   The Presence module implements the core functionality of SIP event
241
-   notification. It handles PUBLISH and SUBSCRIBE messages and generates
242
-   NOTIFY messages in a general, event independent way. It is extensible
243
-   and allows registering events to it from other Kamailio modules.
244
-   Supported SIP event packages are presence, presence.winfo, dialog;sla
245
-   from the presence_xml module and message-summary from the presence_mwi
246
-   module.
247
-
248
-   The module can use database and memory storage (to improve
249
-   performance). For subscriptions it supports the 4 storage modes: Memory
250
-   Only, Write Back, Write Through and DB Only. For publishes, it stores
251
-   the state documents in database only(because of the large size) and it
252
-   can store a publish cache in memory to avoid unnecessairy database
253
-   queries. Read the subs_db_mode and publ_cache parameter sections to
254
-   decide which is the best storage configuration for you.
255
-
256
-   The module implements several API functions, that can be used by other
257
-   modules. In fact, it can be used only as a resource module, or
258
-   "library". This mode of operation is enabled if the db_url parameter is
259
-   not set to any value.
260
-
261
-   The Kamailio Presence module implements the specifications in: RFC3265,
262
-   RFC3856, RFC3857, RFC3858.
263
-
264
-2. Dependencies
265
-
266
-   2.1. Kamailio Modules
267
-   2.2. External Libraries or Applications
268
-
269
-2.1. Kamailio Modules
270
-
271
-   The following modules must be loaded before this module:
272
-     * a database module.
273
-     * sl.
274
-     * tm.
275
-
276
-2.2. External Libraries or Applications
277
-
278
-     * libxml.
279
-
280
-3. Parameters
281
-
282
-   3.1. db_url(str)
283
-   3.2. presentity_table(str)
284
-   3.3. active_watchers_table(str)
285
-   3.4. watchers_table(str)
286
-   3.5. clean_period (int)
287
-   3.6. cseq_offset (int)
288
-   3.7. db_update_period (int)
289
-   3.8. waitn_time (int)
290
-   3.9. notifier_poll_rate (int)
291
-   3.10. notifier_processes (int)
292
-   3.11. force_delete (int)
293
-   3.12. startup_mode (int)
294
-   3.13. to_tag_pref (str)
295
-   3.14. expires_offset (int)
296
-   3.15. max_expires (int)
297
-   3.16. min_expires (int)
298
-   3.17. min_expires_action (int)
299
-   3.18. server_address (str)
300
-   3.19. subs_db_mode (int)
301
-   3.20. publ_cache (int)
302
-   3.21. subs_htable_size (int)
303
-   3.22. pres_htable_size (int)
304
-   3.23. send_fast_notify (int)
305
-   3.24. enable_sphere_check (int)
306
-   3.25. timeout_rm_subs (int)
307
-   3.26. fetch_rows (integer)
308
-   3.27. db_table_lock_type (integer)
309
-   3.28. local_log_level (int)
310
-   3.29. local_log_facility (int)
311
-   3.30. subs_remove_match (int)
312
-   3.31. xavp_cfg (str)
313
-   3.32. retrieve_order (int)
314
-   3.33. retrieve_order_by (str)
315
-   3.34. sip_uri_match (int)
316
-
317
-3.1. db_url(str)
318
-
319
-   The database url.
320
-
321
-   If set, the module is a fully operational presence server. Otherwise,
322
-   it is used as a 'library', for its exported functions.
323
-
324
-   Default value is “NULL”.
325
-
326
-   Example 1.1. Set db_url parameter
327
-...
328
-modparam("presence", "db_url",
329
-        "mysql://kamailio:kamailiorw@localhost/kamailio")
330
-...
331
-
332
-3.2. presentity_table(str)
333
-
334
-   The name of the db table where PUBLISH presence information is stored.
335
-
336
-   Default value is “presentity”.
337
-
338
-   Example 1.2. Set presentity_table parameter
339
-...
340
-modparam("presence", "presentity_table", "presentity")
341
-...
342
-
343
-3.3. active_watchers_table(str)
344
-
345
-   The name of the db table where active subscription information is
346
-   stored.
347
-
348
-   Default value is “active_watchers”.
349
-
350
-   Example 1.3. Set active_watchers_table parameter
351
-...
352
-modparam("presence", "active_watchers_table", "active_watchers")
353
-...
354
-
355
-3.4. watchers_table(str)
356
-
357
-   The name of the db table where subscription states are stored.
358
-
359
-   Default value is “watchers”.
360
-
361
-   Example 1.4. Set watchers_table parameter
362
-...
363
-modparam("presence", "watchers_table", "watchers")
364
-...
365
-
366
-3.5. clean_period (int)
367
-
368
-   The period in seconds between checks if there are expired messages
369
-   stored in database.
370
-
371
-   Default value is “100”. A zero or negative value disables this
372
-   activity.
373
-
374
-   Example 1.5. Set clean_period parameter
375
-...
376
-modparam("presence", "clean_period", 100)
377
-...
378
-
379
-3.6. cseq_offset (int)
380
-
381
-   The allowed offset between server and client cseq.
382
-
383
-   Default value is “0”.
384
-
385
-   Example 1.6. Set cseq_offset parameter
386
-                ...
387
-                modparam("presence", "cseq_offset", 1)
388
-                ...
389
-
390
-3.7. db_update_period (int)
391
-
392
-   The period at which to synchronize cached subscriber info with the
393
-   database.
394
-
395
-   Default value is “100”. A zero or negative value disables
396
-   synchronization.
397
-
398
-   Example 1.7. Set db_update_period parameter
399
-...
400
-modparam("presence", "db_update_period", 100)
401
-...
402
-
403
-3.8. waitn_time (int)
404
-
405
-   The maximum time period that NOTIFY requests will be buffered for. The
406
-   server will attempt to send NOTIFY requests within many seconds of a
407
-   change occurring.
408
-
409
-   Note: this parameter is only used when notifier_processes is greater
410
-   than 0. When notifier_processes is less than or equal to 0 NOTIFY
411
-   requests are sent immediately.
412
-
413
-   Default value is “5”.
414
-
415
-   Example 1.8. Set waitn_time parameter
416
-...
417
-modparam("presence", "waitn_time", 10)
418
-...
419
-
420
-3.9. notifier_poll_rate (int)
421
-
422
-   The number of times per second that the notifier processes should check
423
-   for work. Approximately 1/(waitn_time * notifier_poll_rate *
424
-   notifier_processes) of the pending updates will be sent each time a
425
-   notifier process runs.
426
-
427
-   Separate notifier processes are only run when subs_db_mode is 3 (DB
428
-   only mode).
429
-
430
-   Default value is “10”.
431
-
432
-   Example 1.9. Set notifier_poll_rate parameter
433
-...
434
-modparam("presence", "notifier_poll_rate", 20)
435
-...
436
-
437
-3.10. notifier_processes (int)
438
-
439
-   The number of notifier processes that should be started.
440
-
441
-   Separate notifier processes are only run when subs_db_mode is 3 (DB
442
-   only mode).
443
-
444
-   Note: setting this parameter to 0 when subs_db_mode is 3 keeps the old
445
-   behaviour (sending NOTIFY requests immediately). This (old) behaviour
446
-   is disabled by default in DB only mode because under load, when lots of
447
-   NOTIFY requests can be sent on a dialog at the same time, there are
448
-   race conditions which result in CSeq re-use.
449
-
450
-   Default value is “1”.
451
-
452
-   Example 1.10. Set notifier_processes parameter
453
-...
454
-modparam("presence", "notifier_processes", 2)
455
-...
456
-
457
-3.11. force_delete (int)
458
-
459
-   Enabling this parameter will delete expired presentity records without
460
-   updating watchers.
461
-
462
-   Set this parameter to “1” to enable.
463
-
464
-   Default value is “0”.
465
-
466
-   Example 1.11. Set force_delete parameter
467
-...
468
-modparam("presence", "force_delete", 1)
469
-...
470
-
471
-3.12. startup_mode (int)
472
-
473
-   Setting this parameter to 0 will provide startup related backward
474
-   compatibility for some modules. Setting to 0 fixes presentity requests
475
-   with low expires (e.g. time() + 1)
476
-
477
-   Set this parameter to “0” to enable backward compatibility.
478
-
479
-   Default value is “1”.
480
-
481
-   Example 1.12. Set startup_mode parameter
482
-...
483
-modparam("presence", "startup_mode", 0)
484
-...
485
-
486
-3.13. to_tag_pref (str)
487
-
488
-   The prefix used when generating to_tag when sending replies for
489
-   SUBSCRIBE requests.
490
-
491
-   Default value is “10”.
492
-
493
-   Example 1.13. Set to_tag_pref parameter
494
-...
495
-modparam("presence", "to_tag_pref", 'pres')
496
-...
497
-
498
-3.14. expires_offset (int)
499
-
500
-   The value in seconds that should be subtracted from the expires value
501
-   when sending a 200OK for a publish. It is used for forcing the client
502
-   to send an update before the old publish expires.
503
-
504
-   Default value is “0”.
505
-
506
-   Example 1.14. Set expires_offset parameter
507
-...
508
-modparam("presence", "expires_offset", 10)
509
-...
510
-
511
-3.15. max_expires (int)
512
-
513
-   The maximum admissible expires value for PUBLISH/SUBSCRIBE message (in
514
-   seconds).
515
-
516
-   Default value is “3600”.
517
-
518
-   Example 1.15. Set max_expires parameter
519
-...
520
-modparam("presence", "max_expires", 3600)
521
-...
522
-
523
-3.16. min_expires (int)
524
-
525
-   The minimum admissible expires value for PUBLISH/SUBSCRIBE message (in
526
-   seconds).
527
-
528
-   If > 0 then min_expires_action parameter determines the response.
529
-
530
-   Default value is “0”.
531
-
532
-   Example 1.16. Set min_expires parameter
533
-            ...
534
-            modparam("presence", "min_expires", 1800)
535
-            ...
536
-
537
-3.17. min_expires_action (int)
538
-
539
-   The action to take when UA sends a expires value less then min_expires.
540
-
541
-   Possible Values
542
-     * 1 : RFC Compliant, returns “423 Interval Too Brief”
543
-     * 2 : forces the min_expires value in the subscription
544
-
545
-   If > 0 then min_expires_action parameter determines the response.
546
-
547
-   Default value is “1”.
548
-
549
-   Example 1.17. Set min_expires parameter
550
-            ...
551
-            modparam("presence", "min_expires", 1800)
552
-            ...
553
-
554
-3.18. server_address (str)
555
-
556
-   The presence server address which will become the value of Contact
557
-   header filed for 200 OK replies to SUBSCRIBE and PUBLISH and in NOTIFY
558
-   messages.
559
-
560
-   Example 1.18. Set server_address parameter
561
-...
562
-modparam("presence", "server_address", "sip:10.10.10.10:5060")
563
-...
564
-
565
-3.19. subs_db_mode (int)
566
-
567
-   The presence module can utilize database for persistent subscription
568
-   storage. If you use database, your subscriptions will survive machine
569
-   restarts or SW crashes. The disadvantage is that accessing database can
570
-   be time consuming. Therefore, presence module implements four database
571
-   accessing modes:
572
-     * 0 - This disables database completely. Only memory will be used.
573
-       Subscriptions will not survive restart. Use this value if you need
574
-       a really fast presence module and subscription persistence is not
575
-       necessary or is provided by other means.
576
-     * 1 - Write-Through scheme. Subscriptions are updated synchronously
577
-       in database and in memory(used for read operations). Use this
578
-       scheme if speed is not top priority, but it's important that no
579
-       subscriptions will be lost during crash or reboot or if you have an
580
-       external application that reads the state of the subscriptions from
581
-       database and they need to be updated synchronously.
582
-     * 2 - Write-Back scheme. This is a combination of previous two
583
-       schemes. All changes are made to memory and database
584
-       synchronization is done in the timer. The timer deletes all expired
585
-       contacts and flushes all modified or new subscriptions to database.
586
-       Use this scheme if you encounter high-load peaks and want them to
587
-       process as fast as possible. Latency of this mode is much lower
588
-       than latency of mode 1, but slightly higher than latency of mode 0.
589
-       To control the interval at which data is flushed to database, set
590
-       the db_update_period parameter.
591
-     * 3 - DB-Only scheme. No memory cache is kept, all operations being
592
-       directly performed with the database. The timer deletes all expired
593
-       subscriptions from database. The mode is useful if you configure
594
-       more servers sharing the same DB without any replication at SIP
595
-       level. The mode may be slower due the high number of DB operation.
596
-
597
-   Default value is 2 (Write-Back scheme).
598
-
599
-   Example 1.19. Set subs_db_mode parameter
600
-...
601
-modparam("presence", "subs_db_mode", 1)
602
-...
603
-
604
-3.20. publ_cache (int)
605
-
606
-   To improve performance, the presence module holds by default a publish
607
-   cache that says if a certain publication exists in database. This is
608
-   only a list of URI + event, so it does not use much memory. The cache
609
-   is used when a Subscription is received to check if there is any
610
-   published state in database. This way unnecessary queries in presentity
611
-   table are avoided.
612
-
613
-   Setting this parameter to 0 will disable the usage of the publish
614
-   cache. This is desirable when you have more servers sharing the same
615
-   database or there are other external entities inserting data into the
616
-   presentity table.
617
-
618
-   Default value is “1”.
619
-
620
-   Example 1.20. Set publ_cache parameter
621
-...
622
-modparam("presence", "publ_cache", 0)
623
-...
624
-
625
-3.21. subs_htable_size (int)
626
-
627
-   The size of the in-memory hash table to store subscription dialogs.
628
-   This parameter will be used as the power of 2 when computing table
629
-   size.
630
-
631
-   Default value is “9 (512)”.
632
-
633
-   Example 1.21. Set subs_htable_size parameter
634
-...
635
-modparam("presence", "subs_htable_size", 11)
636
-...
637
-
638
-3.22. pres_htable_size (int)
639
-
640
-   The size of the in-memory hash table to store publish records. This
641
-   parameter will be used as the power of 2 when computing table size.
642
-
643
-   Default value is “9 (512)”.
644
-
645
-   Example 1.22. Set pres_htable_size parameter
646
-...
647
-modparam("presence", "pres_htable_size", 11)
648
-...
649
-
650
-3.23. send_fast_notify (int)
651
-
652
-   This parameter enables or disables the sending of an initial empty
653
-   NOTIFY after a SUBSCRIBE/reSUBSCRIBE. This caused problems for MWI
654
-   application, because some CPEs (like Samsung) fail to understand an
655
-   empty NOTIFY to an message-summary event. This parameter is enabled by
656
-   default, thus addering to the standard.
657
-
658
-   Default value is “1 ”.
659
-
660
-   Example 1.23. Set send_fast_notify parameter
661
-...
662
-modparam("presence", "send_fast_notify", 0)
663
-...
664
-
665
-3.24. enable_sphere_check (int)
666
-
667
-   This parameter is a flag that should be set if permission rules include
668
-   sphere checking. The sphere information is expected to be present in
669
-   the RPID body published by the presentity. The flag is introduced as
670
-   this check requires extra processing that should be avoided if this
671
-   feature is not supported by the clients.
672
-
673
-   Default value is “0 ”.
674
-
675
-   Example 1.24. Set enable_sphere_check parameter
676
-...
677
-modparam("presence", "enable_sphere_check", 1)
678
-...
679
-
680
-3.25. timeout_rm_subs (int)
681
-
682
-   This parameter is a flag that should be set if subscriptions should be
683
-   removed from the active_watchers when a NOTIFY times out. RFC3265
684
-   section 3.2.2 defines this behaviour as a SHOULD, so by default it is
685
-   on. Disabling this will keep subscriptions active on unreliable
686
-   networks.
687
-
688
-   Default value is “1”.
689
-
690
-   Example 1.25. Set timeout_rm_subs parameter
691
-...
692
-modparam("presence", "timeout_rm_subs", 0)
693
-...
694
-
695
-3.26. fetch_rows (integer)
696
-
697
-   Number of rows to be loaded in one step from database.
698
-
699
-   Default value is 500.
700
-
701
-   Example 1.26. Set fetch_rows parameter
702
-...
703
-modparam("presence", "fetch_rows", 1000)
704
-...
705
-
706
-3.27. db_table_lock_type (integer)
707
-
708
-   Enable (=1) or disable (=0) the Locks for table during an transaction.
709
-   Locking only the "current" table causes problems with a MySQL-Databases
710
-   in "DB-Only" mode.
711
-
712
-   In order to use the Presence-Module in "DB_ONLY"-mode with a
713
-   MySQL-Backend, set this parameter to "0", otherwise the
714
-   MySQL-Operations will fail. The Presence-Module will generate a "500
715
-   Server error" due to the failed MySQL-queries.
716
-
717
-   Default value is 1 (Write Lock for the Tables).
718
-
719
-   Example 1.27. Set db_table_lock_type parameter
720
-...
721
-modparam("presence", "db_table_lock_type", 0)
722
-...
723
-
724
-3.28. local_log_level (int)
725
-
726
-   Control log level for some debug messages inside the module.
727
-
728
-   Default value is 2 (L_INFO).
729
-
730
-   Example 1.28. Set local_log_level parameter
731
-...
732
-modparam("presence", "local_log_level", 3)
733
-...
734
-
735
-3.29. local_log_facility (int)
736
-
737
-   Control syslog facility for some debug messages inside the module.
738
-
739
-   Default value is taken from the core log_facility configuration
740
-   parameter.
741
-
742
-   Example 1.29. Set local_log_facility parameter
743
-...
744
-modparam("presence", "local_log_facility", "LOG_LOCAL3")
745
-...
746
-
747
-3.30. subs_remove_match (int)
748
-
749
-   Control how to match the subscriptions to remove from memory. If set to
750
-   0, then the match is done on To-Tag (local generated), if set to 1,
751
-   then the match is done on all dialog attributes (Call-Id, From-Tag,
752
-   To-Tag).
753
-
754
-   Default value is 0.
755
-
756
-   Example 1.30. Set subs_remove_match parameter
757
-...
758
-modparam("presence", "subs_remove_match", 1)
759
-...
760
-
761
-3.31. xavp_cfg (str)
762
-
763
-   The name of the xavp to be used to specify attributes for internal
764
-   processing of presence module.
765
-
766
-   Inner attributes inside xavp can be:
767
-     * priority - integer value to set the priority of the presence
768
-       document (higher value, higher priority). It can set the order of
769
-       the aggregated presence documents sent by NOTIFY (first the
770
-       document with higher priority). If xavp_cfg parameter is set but
771
-       this attribute is not in the avp, the priority of the presence
772
-       document is based on timestamp, so newer documents have higher
773
-       priority.
774
-     * delete_subscription - integer value to give extra control of
775
-       deleting the subscription after processing of
776
-       event_route[presence:notify-reply]. If value = 1, it deletes the
777
-       subscription. If xavp_cfg parameter is set but this attribute is
778
-       not in the avp, the subscription is not deleted. this does not
779
-       apply for codes 404, 481 and 408 (when timeout_rm_subs = 1) where
780
-       subscription is deleted.
781
-
782
-   Default value is empty (not set).
783
-
784
-   Example 1.31. Set xavp_cfg parameter
785
-...
786
-modparam("presence", "xavp_cfg", "pres")
787
-...
788
-if(is_method("PUBLISH")) {
789
-    $xavp(pres=>priority) = 100;
790
-}
791
-...
792
-
793
-3.32. retrieve_order (int)
794
-
795
-   If set to 0, presentity records are retrieve by received_time order. If
796
-   set to 1, presentity records are retrieve by the value of
797
-   retrieve_order_by parameter.
798
-
799
-   Default value is 0.
800
-
801
-   Example 1.32. Set retrieve_order parameter
802
-...
803
-modparam("presence", "retrieve_order", 1)
804
-...
805
-
806
-3.33. retrieve_order_by (str)
807
-
808
-   Used to set the order-by of the db query for fetching the presence
809
-   records when retrieve_order is set to 1.
810
-
811
-   Default value is “priority”.
812
-
813
-   Example 1.33. Set retrieve_order_by parameter
814
-...
815
-modparam("presence", "retrieve_order_by", "priority, received_time")
816
-...
817
-
818
-3.34. sip_uri_match (int)
819
-
820
-   The mode used when comparing uris.
821
-
822
-   Possible Values
823
-     * 0 : case sensitive
824
-     * 1 : case insensitive
825
-
826
-   Default value is “0”.
827
-
828
-   Example 1.34. Set sip_uri_match parameter
829
-            ...
830
-            modparam("presence", "sip_uri_match", 1)
831
-            ...
832
-
833
-4. Functions
834
-
835
-   4.1. handle_publish([sender_uri])
836
-   4.2. handle_subscribe([watcher_uri])
837
-   4.3. pres_auth_status(watcher_uri, presentity_uri)
838
-   4.4. pres_has_subscribers(presentity_uri, event)
839
-   4.5. pres_refresh_watchers(uri, event, type[, file_uri, filename])
840
-   4.6. pres_update_watchers(uri, event)
841
-
842
-4.1.  handle_publish([sender_uri])
843
-
844
-   Handles PUBLISH requests by storing and updating published information
845
-   in memory cache and database, then calls functions to send NOTIFY
846
-   messages when changes in the published information occur. It takes one
847
-   argument -> sender_uri. The parameter was added for enabling BLA
848
-   implementation. If present, notification of a change in published state
849
-   is not sent to the respective uri even though a subscription exists. It
850
-   should be taken from the Sender header. It was left at the decision of
851
-   the administrator whether or not to transmit the content of this header
852
-   as parameter for handle_publish, to prevent security problems.
853
-
854
-   This function can be used from REQUEST_ROUTE.
855
-
856
-   Return code:
857
-     * 1 - if success.
858
-     * -1 - if error.
859
-
860
-   The module sends an appropriate stateless reply in all cases.
861
-
862
-   Example 1.35. handle_publish usage
863
-...
864
-        if(is_method("PUBLISH"))
865
-        {
866
-                if($hdr(Sender)!= NULL)
867
-                        handle_publish("$hdr(Sender)");
868
-                else
869
-                        handle_publish();
870
-                t_release();
871
-        }
872
-...
873
-
874
-4.2.  handle_subscribe([watcher_uri])
875
-
876
-   The function which handles SUBSCRIBE requests. It stores or updates
877
-   information in memory and database and calls functions to send NOTIFY
878
-   messages when a SUBSCRIBE which initiate a dialog is received.
879
-
880
-   By default this function uses the From: URI from the SUBSCRIBE request
881
-   as the Watcher URI. The optional watcher_uri parameter can be used to
882
-   specify a different Watcher URI, possibly taken from a SIP header like
883
-   P-Asserted-Identity:.
884
-
885
-   This function can be used from REQUEST_ROUTE.
886
-
887
-   Return code:
888
-     * 1 - if success.
889
-     * -1 - if error.
890
-
891
-   The module sends an appropriate stateless reply in all cases.
892
-
893
-   Example 1.36. handle_subscribe usage
894
-...
895
-if(method=="SUBSCRIBE")
896
-    handle_subscribe();
897
-...
898
-
899
-4.3.  pres_auth_status(watcher_uri, presentity_uri)
900
-
901
-   The function checks if watcher URI is authorized to subscribe event
902
-   'presence' of presentity URI. Both watcher_uri and presentity_uri can
903
-   be static strings or contain pseudo variables.
904
-
905
-   The function returns ACTIVE_STATUS, if subscription is allowed, and
906
-   PENDING_STATUS, TERMINATED_STATUS, or WAITING_STATUS otherwise. See
907
-   presence/subscribe.h for the corresponding integer codes. In case of
908
-   error, function returns -1.
909
-
910
-   This function can be used from REQUEST_ROUTE.
911
-
912
-   Example 1.37. pres_auth_status usage
913
-...
914
-if (method=="MESSAGE") {
915
-    pres_auth_status("$fu", $ru");
916
-    if ($retcode == 1) {
917
-        t_relay();
918
-    } else {
919
-        send_reply("403", "Forbidden");
920
-    }
921
-}
922
-...
923
-
924
-4.4.  pres_has_subscribers(presentity_uri, event)
925
-
926
-   Allows to check if presentity has any subscribers of event.
927
-
928
-   This function can be used from ANY_ROUTE.
929
-
930
-   Example 1.38. pres_has_subscribers usage
931
-            ...
932
-            if(pres_has_subscribers($var(uri), "message-summary"))
933
-            do something...;
934
-            ...
935
-
936
-4.5.  pres_refresh_watchers(uri, event, type[, file_uri, filename])
937
-
938
-   The function can be used in configuration to triger notifies to
939
-   watchers if a change in watchers authorization or in published state
940
-   occurred (i.e., updates of xcap documents).
941
-
942
-   Parameters:
943
-     * uri - the uri of the user who made the change and whose watchers
944
-       should be informed.
945
-     * event - the event package.
946
-     * type - it distinguishes between the three different types of events
947
-       that can trigger the refresh, depending on its value:
948
-          + 0 - a change in watchers authentication.
949
-          + 1 - a statical update in published state through direct update
950
-            in db table.
951
-          + 2 - a statical update in published state by modifying the pidf
952
-            manipulation document.
953
-     * file_uri - the uri of the pidf-manipulation file on the XCAP server
954
-       (only used for type 2).
955
-     * filename - the name of the pidf-manipulation file on the XCAP
956
-       server (only used for type 2).
957
-
958
-   This function can be used from ANY_ROUTE.
959
-
960
-   Example 1.39. pres_refresh_watchers usage
961
-...
962
-pres_refresh_watchers("sip:test@kamailio.org", "presence", 1);
963
-...
964
-
965
-4.6.  pres_update_watchers(uri, event)
966
-
967
-   The function can be used in configuration to triger updates to watchers
968
-   status if a change in watchers authorization state occurred (i.e.,
969
-   updates of xcap documents change state from pending to active).
970
-
971
-   Parameters:
972
-     * uri - the uri of the user who made the change and whose watchers
973
-       should be informed. Can be PV.
974
-     * event - the event package (e.g., presence).
975
-
976
-   This function can be used from ANY_ROUTE.
977
-
978
-   Example 1.40. pres_update_watchers usage
979
-...
980
-pres_update_watchers("sip:test@kamailio.org", "presence");
981
-...
982
-
983
-5. RPC Commands
984
-
985
-   5.1. presence.cleanup
986
-   5.2. presence.refreshWatchers
987
-
988
-5.1. presence.cleanup
989
-
990
-   Manually triggers the cleanup functions for the active_watchers,
991
-   presentity, and watchers tables. Useful if you have set clean_period
992
-   and/or db_update_period to zero or less.
993
-
994
-   Name: presence.cleanup
995
-
996
-   Parameters: none
997
-
998
-   RPC Command Format:
999
-...
1000
-kamcmd presence.cleanup
1001
-...
1002
-
1003
-5.2. presence.refreshWatchers
1004
-
1005
-   Triggers sending Notify messages to watchers if a change in watchers
1006
-   authorization or in published state occurred.
1007
-
1008
-   Name: presence.refreshWatchers
1009
-
1010
-   Parameters:
1011
-     * uri - the uri of the user who made the change and whose watchers
1012
-       should be informed
1013
-     * event - the event package.
1014
-     * type - it distinguishes between the three different types of events
1015
-       that can trigger the refresh, depending on its value:
1016
-          + 0 - a change in watchers authentication.
1017
-          + 1 - a statical update in published state through direct update
1018
-            in db table.
1019
-          + 2 - a statical update in published state by modifying the pidf
1020
-            manipulation document.
1021
-     * file_uri - the uri of the pidf-manipulation file on the XCAP server
1022
-       (only used for type 2).
1023
-     * filename - the name of the pidf-manipulation file on the XCAP
1024
-       server (only used for type 2).
1025
-
1026
-   RPC Command Format:
1027
-...
1028
-kamcmd presence.refreshWatchers sip:test@kamailio.org presence 1
1029
-...
1030
-
1031
-6. Exported Variables
1032
-
1033
-   6.1. $subs(attr)
1034
-   6.2. $notify_reply(attr)
1035
-
1036
-6.1. $subs(attr)
1037
-
1038
-   Access the attributes of handled subscription. It must be used after a
1039
-   successful call of “handle_subscription()” or in the following events.
1040
-     * tm:local-request - before notify is sent
1041
-     * present:notify-reply - after notify is sent
1042
-
1043
-   The “attr” can be:
1044
-     * uri - subscription presentity uri
1045
-     * pres_uri - alias for presentity uri
1046
-     * to_user
1047
-     * to_domain
1048
-     * from_user
1049
-     * from_domain
1050
-     * watcher_username
1051
-     * watcher_domain
1052
-     * event
1053
-     * event_id
1054
-     * to_tag
1055
-     * from_tag
1056
-     * callid
1057
-     * remote_cseq
1058
-     * local_cseq
1059
-     * contact
1060
-     * local_contact
1061
-     * record_route
1062
-     * expires
1063
-     * status
1064
-     * reason
1065
-     * version
1066
-     * flags
1067
-     * user_agent
1068
-
1069
-   Example 1.41. $subs(name) usage
1070
-...
1071
-if(handle_subscription())
1072
-{
1073
-  xlog("presentity=$subs(uri)\n");
1074
-}
1075
-...
1076
-
1077
-6.2. $notify_reply(attr)
1078
-
1079
-   Access the reply message received when notifying subscriber. It must be
1080
-   used in the following events.
1081
-     * present:notify-reply - after notify is sent
1082
-
1083
-   The “attr” can be any pseudo var that accesses attributes of msg
1084
-
1085
-   Example 1.42. $notify_reply(name) usage
1086
-...
1087
-event_route[presence:notify-reply]
1088
-{
1089
-  xlog("received message = $notify_reply($mb)\n");
1090
-}
1091
-...
1092
-
1093
-7. Events
1094
-
1095
-   7.1. present:notify-reply
1096
-
1097
-7.1. present:notify-reply
1098
-
1099
-   Fired after notify reply is received or timeout.
1100
-
1101
-   Example 1.43. $notify_reply(name) usage
1102
-...
1103
-event_route[presence:notify-reply]
1104
-{
1105
-  xlog("received message = $notify_reply($mb)\n");
1106
-}
1107
-...
1108
-
1109
-8. Installation
1110
-
1111
-   The module requires 3 tables in the Kamailio database: "presentity",
1112
-   "active_watchers" and "watchers". The SQL syntax to create them can be
1113
-   found in presence-create.sql script in the database directories in the
1114
-   kamailio/scripts folder. You can also find the complete database
1115
-   documentation on the project webpage,
1116
-   https://www.kamailio.org/docs/db-tables/kamailio-db-devel.html.
1117
-
1118
-Chapter 2. Developer Guide
1119
-
1120
-   Table of Contents
1121
-
1122
-   1. bind_presence(presence_api_t* api)
1123
-   2. add_event
1124
-   3. get_rules_doc
1125
-   4. get_auth_status
1126
-   5. apply_auth_nbody
1127
-   6. agg_nbody
1128
-   7. free_body
1129
-   8. aux_body_processing
1130
-   9. aux_free_body
1131
-   10. evs_publ_handl
1132
-   11. evs_subs_handl
1133
-   12. contains_event
1134
-   13. get_event_list
1135
-   14. update_watchers_status
1136
-   15. get_sphere
1137
-   16. get_presentity
1138
-   17. free_presentity
1139
-
1140
-   The module provides the following functions that can be used in other
1141
-   Kamailio modules.
1142
-
1143
-1.  bind_presence(presence_api_t* api)
1144
-
1145
-   This function binds the presence modules and fills the structure with
1146
-   one exported function -> add_event, which when called adds a new event
1147
-   to be handled by presence.
1148
-
1149
-   Example 2.1. presence_api_t structure
1150
-...
1151
-typedef struct presence_api {
1152
-        add_event_t add_event;
1153
-        contains_event_t contains_event;
1154
-        search_event_t search_event;
1155
-        get_event_list_t get_event_list;
1156
-
1157
-        update_watchers_t update_watchers_status;
1158
-
1159
-        /* subs hash table handling functions */
1160
-        new_shtable_t new_shtable;
1161
-        destroy_shtable_t destroy_shtable;
1162
-        insert_shtable_t insert_shtable;
1163
-        search_shtable_t search_shtable;
1164
-        delete_shtable_t delete_shtable;
1165
-        update_shtable_t update_shtable;
1166
-        /* function to duplicate a subs structure*/
1167
-        mem_copy_subs_t  mem_copy_subs;
1168
-        /* function used for update in database*/
1169
-        update_db_subs_t update_db_subs_timer;
1170
-        /* function to extract dialog information from a
1171
-        SUBSCRIBE message */
1172
-        extract_sdialog_info_t extract_sdialog_info;
1173
-        /* function to request sphere defition for a presentity */
1174
-        pres_get_sphere_t get_sphere;
1175
-
1176
-}presence_api_t;
1177
-...
1178
-
1179
-2.  add_event
1180
-
1181
-   Field type:
1182
-...
1183
-typedef int (*add_event_t)(pres_ev_t* event);
1184
-...
1185
-
1186
-   This function receives as a parameter a structure with event specific
1187
-   information and adds it to presence event list.
1188
-
1189
-   The structure received as a parameter:
1190
-...
1191
-typedef struct pres_ev
1192
-{
1193
-        str name;
1194
-        event_t* evp;
1195
-        str content_type;
1196
-        int default_expires;
1197
-        int type;
1198
-        int etag_not_new;
1199
-        /*
1200
-         *  0 - the standard mechanism (allocating new etag
1201
-                        for each Publish)
1202
-         *  1 - allocating an etag only
1203
-                        for an initial Publish
1204
-        */
1205
-        int req_auth;
1206
-        get_rules_doc_t* get_rules_doc;
1207
-        apply_auth_t*  apply_auth_nbody;
1208
-        is_allowed_t*  get_auth_status;
1209
-
1210
-        /* an agg_body_t function should be registered
1211
-         * if the event permits having multiple published
1212
-         * states and requires an aggregation of the information
1213
-         * otherwise, this field should be NULL and the last
1214
-         * published state is taken when constructing Notify msg
1215
-         */
1216
-        agg_nbody_t* agg_nbody;
1217
-        publ_handling_t  * evs_publ_handl;
1218
-        subs_handling_t  * evs_subs_handl;
1219
-        free_body_t* free_body;
1220
-    /* sometimes it is necessary that a module make changes for a body for each
1221
-     * active watcher (e.g. setting the "version" parameter in an XML document.
1222
-     * If a module registers the aux_body_processing callback, it gets called fo
1223
-r
1224
-     * each watcher. It either gets the body received by the PUBLISH, or the bod
1225
-y
1226
-     * generated by the agg_nbody function.
1227
-     * The module can deceide if it makes a copy of the original body, which is
1228
-then
1229
-     * manipulated, or if it works directly in the original body. If the module
1230
-makes a
1231
-     * copy of the original body, it also has to register the aux_free_body() to
1232
-     * free this "per watcher" body.
1233
-     */
1234
-    aux_body_processing_t* aux_body_processing;
1235
-    free_body_t* aux_free_body;
1236
-        struct pres_ev* wipeer;
1237
-        struct pres_ev* next;
1238
-
1239
-}pres_ev_t;
1240
-...
1241
-
1242
-3.  get_rules_doc
1243
-
1244
-   Filed type:
1245
-...
1246
-typedef int (get_rules_doc_t)(str* user, str* domain, str** rules_doc);
1247
-...
1248
-
1249
-   This function returns the authorization rules document that will be
1250
-   used in obtaining the status of the subscription and processing the
1251
-   notified body. A reference to the document should be put in the
1252
-   auth_rules_doc of the subs_t structure given as a parameter to the
1253
-   functions described bellow.
1254
-
1255
-4.  get_auth_status
1256
-
1257
-   This filed is a function to be called for a subscription request to
1258
-   return the state for that subscription according to authorization
1259
-   rules. In the auth_rules_doc field of the subs_t structure received as
1260
-   a parameter should contain the rules document of the presentity in
1261
-   case, if it exists.
1262
-
1263
-   It is called only if the req_auth field is not 0.
1264
-
1265
-   Filed type:
1266
-...
1267
-typedef int (is_allowed_t)(struct subscription* subs);
1268
-...
1269
-
1270
-5.  apply_auth_nbody
1271
-
1272
-   This parameter should be a function to be called for an event that
1273
-   requires authorization, when constructing final body. The authorization
1274
-   document is taken from the auth_rules_doc field of the subs_t structure
1275
-   given as a parameter. It is called only if the req_auth field is not 0.
1276
-
1277
-   Filed type:
1278
-...
1279
-typedef int (apply_auth_t)(str* , struct subscription*, str** );
1280
-...
1281
-
1282
-6.  agg_nbody
1283
-
1284
-   If present, this field marks that the events requires aggregation of
1285
-   states. This function receives a body array and should return the final
1286
-   body. If not present, it is considered that the event does not require
1287
-   aggregation and the most recent published information is used when
1288
-   constructing Notifies.
1289
-
1290
-   Filed type:
1291
-...
1292
-typedef str* (agg_nbody_t)(str* pres_user, str* pres_domain,
1293
-str** body_array, int n, int off_index);
1294
-..
1295
-
1296
-7.  free_body
1297
-
1298
-   This field must be field in if subsequent processing is performed on
1299
-   the info from database before being inserted in Notify message body(if
1300
-   agg_nbody or apply_auth_nbody fields are filled in). It should match
1301
-   the allocation function used when processing the body.
1302
-
1303
-   Filed type:
1304
-...
1305
-typedef void(free_body_t)(char* body);
1306
-..
1307
-
1308
-8.  aux_body_processing
1309
-
1310
-   This field must be set if the module needs to manipulate the NOTIFY
1311
-   body for each watcher. E.g. if the XML body includes a 'version'
1312
-   parameter which will be increased for each NOTIFY, on a "per watcher"
1313
-   basis. The module can either allocate a new buffer for the new body an
1314
-   return it (aux_free_body function must be set too) or it manipualtes
1315
-   the original body directly and returns NULL.
1316
-
1317
-   Filed type:
1318
-...
1319
-typedef str* (aux_body_processing_t)(struct subscription *subs, str* body);
1320
-..
1321
-
1322
-9.  aux_free_body
1323
-
1324
-   This field must be set if the module registers the aux_body_processing
1325
-   function and allocates memory for the new modified body. Then, this
1326
-   function will be used to free the pointer returned by the
1327
-   aux_body_processing function. If the module does use the
1328
-   aux_body_processing, but does not allocate new memory, but manipulates
1329
-   directly the original body buffer, then the aux_body_processing must
1330
-   return NULL and this field should not be set.
1331
-
1332
-   Filed type:
1333
-...
1334
-typedef void(free_body_t)(char* body);
1335
-..
1336
-
1337
-10.  evs_publ_handl
1338
-
1339
-   This function is called when handling Publish requests. Most contain
1340
-   body correctness check.
1341
-
1342
-...
1343
-typedef int (publ_handling_t)(struct sip_msg*);
1344
-..
1345
-
1346
-11.  evs_subs_handl
1347
-
1348
-   It is not compulsory. Should contain event specific handling for
1349
-   Subscription requests.
1350
-
1351
-   Filed type:
1352
-...
1353
-typedef int (subs_handling_t)(struct sip_msg*);
1354
-..
1355
-
1356
-12.  contains_event
1357
-
1358
-   Field type:
1359
-..
1360
-typedef pres_ev_t* (*contains_event_t)(str* name,
1361
-event_t* parsed_event);
1362
-...
1363
-
1364
-   The function parses the event name received as a parameter and searches
1365
-   the result in the list. It returns the found event or NULL, if not
1366
-   found. If the second argument is an allocated event_t* structure it
1367
-   fills it with the result of the parsing.
1368
-
1369
-13.  get_event_list
1370
-
1371
-   Field type:
1372
-...
1373
-typedef int (*get_event_list_t) (str** ev_list);
1374
-...
1375
-
1376
-   This function returns a string representation of the events registered
1377
-   in presence module.( used for Allowed-Events header).
1378
-
1379
-14.  update_watchers_status
1380
-
1381
-   Field type:
1382
-...
1383
-typedef int (*update_watchers_t)(str pres_uri, pres_ev_t* ev,
1384
-str* rules_doc);
1385
-...
1386
-
1387
-   This function is an external command that can be used to announce a
1388
-   change in authorization rules for a presentity. It updates the stored
1389
-   status and sends a Notify to the watchers whose status has changes.
1390
-   (used by presence_xml module when notified through an RPC command of a
1391
-   change in an xcap document).
1392
-
1393
-15.  get_sphere
1394
-
1395
-   Field type:
1396
-...
1397
-typedef char* (*pres_get_sphere_t)(str* pres_uri);
1398
-...
1399
-
1400
-   This function searches for a sphere definition in the published
1401
-   information if this has type RPID. If not found returns NULL. (the
1402
-   return value is allocated in private memory and should be freed)
1403
-
1404
-16.  get_presentity
1405
-
1406
-   Field type:
1407
-...
1408
-typedef str* (*pres_get_presentity_t)(str pres_uri, pres_ev_t *ev, str *etag, st
1409