1usrloc Module
2
3Jan Janak
4
5 FhG FOKUS
6
7Daniel-Constantin Mierla
8
9 <miconda@gmail.com>
10
11Edited by
12
13Jan Janak
14
15Bogdan-Andrei Iancu
16
17Carsten Bock
18
19 ng-voice GmbH
20
21 Copyright © 2003 FhG FOKUS
22
23 Copyright © 2005 Voice Sistem SRL
24
25 Copyright © 2015 ng-voice GmbH
26 __________________________________________________________________
27
28 Table of Contents
29
30 1. Admin Guide
31
32 1. Overview
33
34 1.1. Contact matching
35
36 2. Dependencies
37
38 2.1. Kamailio Modules
39 2.2. External Libraries or Applications
40
41 3. Parameters
42
43 3.1. nat_bflag (int)
44 3.2. user_column (string)
45 3.3. domain_column (string)
46 3.4. contact_column (string)
47 3.5. expires_column (string)
48 3.6. q_column (string)
49 3.7. callid_column (string)
50 3.8. cseq_column (string)
51 3.9. methods_column (string)
52 3.10. flags_column (string)
53 3.11. cflags_column (string)
54 3.12. user_agent_column (string)
55 3.13. received_column (string)
56 3.14. socket_column (string)
57 3.15. path_column (string)
58 3.16. ruid_column (string)
59 3.17. instance_column (string)
60 3.18. reg_id_column (string)
61 3.19. server_id_column (string)
62 3.20. connection_id_column (string)
63 3.21. keepalive_column (string)
64 3.22. partition_column (string)
65 3.23. use_domain (int)
66 3.24. desc_time_order (int)
67 3.25. timer_interval (int)
68 3.26. db_url (string)
69 3.27. db_mode (int)
70 3.28. db_load (int)
71 3.29. db_insert_update (int)
72 3.30. matching_mode (int)
73 3.31. cseq_delay (int)
74 3.32. fetch_rows (int)
75 3.33. hash_size (int)
76 3.34. preload (string)
77 3.35. db_update_as_insert (int)
78 3.36. db_check_update (int)
79 3.37. timer_procs (int)
80 3.38. xavp_contact (string)
81 3.39. db_ops_ruid (int)
82 3.40. handle_lost_tcp (int)
83 3.41. close_expired_tcp (int)
84 3.42. expires_type (int)
85 3.43. db_raw_fetch_type (int)
86 3.44. db_insert_null (int)
87 3.45. skip_remote_socket (int)
88 3.46. db_timer_clean (int)
89 3.47. rm_expired_delay (int)
90 3.48. server_id_filter (int)
91 3.49. version_table (int)
92 3.50. ka_mode (int)
93 3.51. ka_method (str)
94 3.52. ka_from (str)
95 3.53. ka_domain (str)
96 3.54. ka_filter (int)
97 3.55. ka_timeout (int)
98 3.56. ka_loglevel (int)
99 3.57. ka_logmsg (str)
100
101 4. RPC Commands
102
103 4.1. ul.dump
104 4.2. ul.lookup table AOR
105 4.3. ul.rm table AOR
106 4.4. ul.rm_contact table AOR contact
107 4.5. ul.flush
108 4.6. ul.add
109 4.7. ul.db_users
110 4.8. ul.db_contacts
111 4.9. ul.db_expired_contacts
112
113 5. Statistics
114
115 5.1. users
116 5.2. contacts
117 5.3. expires
118 5.4. registered_users
119
120 2. Developer Guide
121
122 1. Available Functions
123
124 1.1. ul_register_domain(name)
125 1.2. ul_insert_urecord(domain, aor, rec)
126 1.3. ul_delete_urecord(domain, aor)
127 1.4. ul_delete_urecord_by_ruid(domain, ruid)
128 1.5. ul_get_urecord(domain, aor)
129 1.6. ul_lock_udomain(domain)
130 1.7. ul_unlock_udomain(domain)
131 1.8. ul_release_urecord(record)
132 1.9. ul_insert_ucontact(record, contact, expires, q, callid,
133 cseq, flags, cont, ua, sock)
134
135 1.10. ul_delete_ucontact (record, contact)
136 1.11. ul_get_ucontact(record, contact)
137 1.12. ul_get_all_ucontacts (buf, len, flags)
138 1.13. ul_update_ucontact(contact, expires, q, callid, cseq,
139 set, res, ua, sock)
140
141 1.14. ul_bind_ursloc( api )
142 1.15. ul_register_ulcb(type ,callback, param)
143 1.16. ul_get_num_users()
144
145 List of Examples
146
147 1.1. Set nat_bflag parameter
148 1.2. Set user_column parameter
149 1.3. Set user_column parameter
150 1.4. Set contact_column parameter
151 1.5. Set expires_column parameter
152 1.6. Set q_column parameter
153 1.7. Set callid_column parameter
154 1.8. Set cseq_column parameter
155 1.9. Set methods_column parameter
156 1.10. Set flags_column parameter
157 1.11. Set cflags_column parameter
158 1.12. Set user_agent_column parameter
159 1.13. Set received_column parameter
160 1.14. Set socket_column parameter
161 1.15. Set path_column parameter
162 1.16. Set ruid_column parameter
163 1.17. Set instance_column parameter
164 1.18. Set reg_id_column parameter
165 1.19. Set server_id_column parameter
166 1.20. Set connection_id_column parameter
167 1.21. Set keepalive_column parameter
168 1.22. Set partition_column parameter
169 1.23. Set use_domain parameter
170 1.24. Set desc_time_order parameter
171 1.25. Set timer_interval parameter
172 1.26. Set db_url parameter
173 1.27. Set db_mode parameter
174 1.28. Set db_load parameter
175 1.29. Set db_insert_update parameter
176 1.30. Set matching_mode parameter
177 1.31. Set cseq_delay parameter
178 1.32. Set fetch_rows parameter
179 1.33. Set hash_size parameter
180 1.34. Set preload parameter
181 1.35. Set db_update_as_insert parameter
182 1.36. Set db_check_update parameter
183 1.37. Set timer_procs parameter
184 1.38. Set xavp_contact parameter
185 1.39. Set db_ops_ruid parameter
186 1.40. Set handle_lost_tcp parameter
187 1.41. Set close_expired_tcp parameter
188 1.42. Set expires_type parameter
189 1.43. Set db_raw_fetch_type parameter
190 1.44. Set db_insert_null parameter
191 1.45. Set skip_remote_socket parameter
192 1.46. Set db_timer_clean parameter
193 1.47. Set rm_expired_delay parameter
194 1.48. Set server_id_filter parameter
195 1.49. version_table parameter usage
196 1.50. ka_mode parameter usage
197 1.51. ka_method parameter usage
198 1.52. ka_from parameter usage
199 1.53. ka_domain parameter usage
200 1.54. ka_filter parameter usage
201 1.55. Set ka_timeout parameter
202 1.56. ka_loglevel parameter usage
203 1.57. ka_logmsg parameter usage
204
205Chapter 1. Admin Guide
206
207 Table of Contents
208
209 1. Overview
210
211 1.1. Contact matching
212
213 2. Dependencies
214
215 2.1. Kamailio Modules
216 2.2. External Libraries or Applications
217
218 3. Parameters
219
220 3.1. nat_bflag (int)
221 3.2. user_column (string)
222 3.3. domain_column (string)
223 3.4. contact_column (string)
224 3.5. expires_column (string)
225 3.6. q_column (string)
226 3.7. callid_column (string)
227 3.8. cseq_column (string)
228 3.9. methods_column (string)
229 3.10. flags_column (string)
230 3.11. cflags_column (string)
231 3.12. user_agent_column (string)
232 3.13. received_column (string)
233 3.14. socket_column (string)
234 3.15. path_column (string)
235 3.16. ruid_column (string)
236 3.17. instance_column (string)
237 3.18. reg_id_column (string)
238 3.19. server_id_column (string)
239 3.20. connection_id_column (string)
240 3.21. keepalive_column (string)
241 3.22. partition_column (string)
242 3.23. use_domain (int)
243 3.24. desc_time_order (int)
244 3.25. timer_interval (int)
245 3.26. db_url (string)
246 3.27. db_mode (int)
247 3.28. db_load (int)
248 3.29. db_insert_update (int)
249 3.30. matching_mode (int)
250 3.31. cseq_delay (int)
251 3.32. fetch_rows (int)
252 3.33. hash_size (int)
253 3.34. preload (string)
254 3.35. db_update_as_insert (int)
255 3.36. db_check_update (int)
256 3.37. timer_procs (int)
257 3.38. xavp_contact (string)
258 3.39. db_ops_ruid (int)
259 3.40. handle_lost_tcp (int)
260 3.41. close_expired_tcp (int)
261 3.42. expires_type (int)
262 3.43. db_raw_fetch_type (int)
263 3.44. db_insert_null (int)
264 3.45. skip_remote_socket (int)
265 3.46. db_timer_clean (int)
266 3.47. rm_expired_delay (int)
267 3.48. server_id_filter (int)
268 3.49. version_table (int)
269 3.50. ka_mode (int)
270 3.51. ka_method (str)
271 3.52. ka_from (str)
272 3.53. ka_domain (str)
273 3.54. ka_filter (int)
274 3.55. ka_timeout (int)
275 3.56. ka_loglevel (int)
276 3.57. ka_logmsg (str)
277
278 4. RPC Commands
279
280 4.1. ul.dump
281 4.2. ul.lookup table AOR
282 4.3. ul.rm table AOR
283 4.4. ul.rm_contact table AOR contact
284 4.5. ul.flush
285 4.6. ul.add
286 4.7. ul.db_users
287 4.8. ul.db_contacts
288 4.9. ul.db_expired_contacts
289
290 5. Statistics
291
292 5.1. users
293 5.2. contacts
294 5.3. expires
295 5.4. registered_users
296
2971. Overview
298
299 1.1. Contact matching
300
301 The User location module module keeps a user location table and
302 provides access to the table for other modules. The module exports no
303 functions that can be used directly from routing scripts.
304
3051.1. Contact matching
306
307 How the contacts are matched (for the same AOR - Address of Record) is
308 an important aspect of the usrloc module, especially in the context of
309 NAT traversal - this raises more problems since contacts from different
310 phones of the same user may overlap (if both are behind NATs with the
311 same configuration) or the re-register contact of the same phone may be
312 seen as a new one (due different binding via NAT).
313
314 The SIP RFC 3261 publishes a matching algorithm based only on the
315 contact string with Call-id and Cseq extra checking (if the Call-ID is
316 the same, it must have a higher Cseq number, otherwise it is invalid).
317 But as argued above, this is not enough in NAT traversal context, so
318 the Kamailio implementation of contact matching offers more algorithms:
319 * Contact based only - it is strict RFC 3261 compliancy - the Contact
320 URI is matched as string and extra checked via Call-ID and cseq (if
321 Call-ID is the same, it must have a higher cseq number, otherwise
322 it is invalid).
323 * Contact and Call-id based - it is an extension of the first case -
324 the contact and Call-ID must be matched as string; the cseq must be
325 higher than the previous one - so be careful how you deal with
326 REGISTER retransmissions in this case.
327 * contact and path based - it is an extension of the first case - the
328 contact and path must be matched as string; the cseq must be higher
329 than the previous one - so be careful how you deal with REGISTER
330 retransmissions in this case.
331 * Call-id only based - it is not according to RFC3261, as it will
332 check the Call-ID only (independent of the Contact-Header or Path).
333
334 To find out how to control/select the contact matching algorithm,
335 please see the module parameter matching_mode - Section 3.30,
336 “matching_mode (int)”.
337
3382. Dependencies
339
340 2.1. Kamailio Modules
341 2.2. External Libraries or Applications
342
3432.1. Kamailio Modules
344
345 The following modules must be loaded before this module:
346 * Optionally a database module.
347
3482.2. External Libraries or Applications
349
350 The following libraries or applications must be installed before
351 running Kamailio with this module loaded:
352 * None.
353
3543. Parameters
355
356 3.1. nat_bflag (int)
357 3.2. user_column (string)
358 3.3. domain_column (string)
359 3.4. contact_column (string)
360 3.5. expires_column (string)
361 3.6. q_column (string)
362 3.7. callid_column (string)
363 3.8. cseq_column (string)
364 3.9. methods_column (string)
365 3.10. flags_column (string)
366 3.11. cflags_column (string)
367 3.12. user_agent_column (string)
368 3.13. received_column (string)
369 3.14. socket_column (string)
370 3.15. path_column (string)
371 3.16. ruid_column (string)
372 3.17. instance_column (string)
373 3.18. reg_id_column (string)
374 3.19. server_id_column (string)
375 3.20. connection_id_column (string)
376 3.21. keepalive_column (string)
377 3.22. partition_column (string)
378 3.23. use_domain (int)
379 3.24. desc_time_order (int)
380 3.25. timer_interval (int)
381 3.26. db_url (string)
382 3.27. db_mode (int)
383 3.28. db_load (int)
384 3.29. db_insert_update (int)
385 3.30. matching_mode (int)
386 3.31. cseq_delay (int)
387 3.32. fetch_rows (int)
388 3.33. hash_size (int)
389 3.34. preload (string)
390 3.35. db_update_as_insert (int)
391 3.36. db_check_update (int)
392 3.37. timer_procs (int)
393 3.38. xavp_contact (string)
394 3.39. db_ops_ruid (int)
395 3.40. handle_lost_tcp (int)
396 3.41. close_expired_tcp (int)
397 3.42. expires_type (int)
398 3.43. db_raw_fetch_type (int)
399 3.44. db_insert_null (int)
400 3.45. skip_remote_socket (int)
401 3.46. db_timer_clean (int)
402 3.47. rm_expired_delay (int)
403 3.48. server_id_filter (int)
404 3.49. version_table (int)
405 3.50. ka_mode (int)
406 3.51. ka_method (str)
407 3.52. ka_from (str)
408 3.53. ka_domain (str)
409 3.54. ka_filter (int)
410 3.55. ka_timeout (int)
411 3.56. ka_loglevel (int)
412 3.57. ka_logmsg (str)
413
4143.1. nat_bflag (int)
415
416 The index of the branch flag to be used as NAT marker (if the contact
417 is or not natted). This is a branch flag and it will be imported and
418 used by all other modules depending of usrloc module.
419
420 Default value is “not set”.
421
422 Example 1.1. Set nat_bflag parameter
423...
424modparam("usrloc", "nat_bflag", 3)
425...
426
4273.2. user_column (string)
428
429 Name of database column containing usernames.
430
431 Default value is “username”.
432
433 Example 1.2. Set user_column parameter
434...
435modparam("usrloc", "user_column", "username")
436...
437
4383.3. domain_column (string)
439
440 Name of database column containing domains.
441
442 Default value is “domain”.
443
444 Example 1.3. Set user_column parameter
445...
446modparam("usrloc", "domain_column", "domain")
447...
448
4493.4. contact_column (string)
450
451 Name of database column containing contacts.
452
453 Default value is “contact”.
454
455 Example 1.4. Set contact_column parameter
456...
457modparam("usrloc", "contact_column", "contact")
458...
459
4603.5. expires_column (string)
461
462 Name of database column containing expires value.
463
464 Default value is “expires”.
465
466 Example 1.5. Set expires_column parameter
467...
468modparam("usrloc", "expires_column", "expires")
469...
470
4713.6. q_column (string)
472
473 Name of database column containing q values.
474
475 Default value is “q”.
476
477 Example 1.6. Set q_column parameter
478...
479modparam("usrloc", "q_column", "q")
480...
481
4823.7. callid_column (string)
483
484 Name of database column containing Call-ID values.
485
486 Default value is “callid”.
487
488 Example 1.7. Set callid_column parameter
489...
490modparam("usrloc", "callid_column", "callid")
491...
492
4933.8. cseq_column (string)
494
495 Name of database column containing Cseq.
496
497 Default value is “cseq”.
498
499 Example 1.8. Set cseq_column parameter
500...
501modparam("usrloc", "cseq_column", "cseq")
502...
503
5043.9. methods_column (string)
505
506 Name of database column containing supported methods.
507
508 Default value is “methods”.
509
510 Example 1.9. Set methods_column parameter
511...
512modparam("usrloc", "methods_column", "methods")
513...
514
5153.10. flags_column (string)
516
517 Name of database column to save the internal flags of the record.
518
519 Default value is “flags”.
520
521 Example 1.10. Set flags_column parameter
522...
523modparam("usrloc", "flags_column", "flags")
524...
525
5263.11. cflags_column (string)
527
528 Name of database column to save the branch/contact flags of the record.
529
530 Default value is “cflags”.
531
532 Example 1.11. Set cflags_column parameter
533...
534modparam("usrloc", "cflags_column", "cflags")
535...
536
5373.12. user_agent_column (string)
538
539 Name of database column containing user-agent values.
540
541 Default value is “user_agent”.
542
543 Example 1.12. Set user_agent_column parameter
544...
545modparam("usrloc", "user_agent_column", "user_agent")
546...
547
5483.13. received_column (string)
549
550 Name of database column containing the source IP, port, and protocol
551 from the REGISTER message.
552
553 Default value is “received”.
554
555 Example 1.13. Set received_column parameter
556...
557modparam("usrloc", "received_column", "received")
558...
559
5603.14. socket_column (string)
561
562 Name of database column containing the received socket information
563 (IP:port) for the REGISTER message.
564
565 Default value is “socket”.
566
567 Example 1.14. Set socket_column parameter
568...
569modparam("usrloc", "socket_column", "socket")
570...
571
5723.15. path_column (string)
573
574 Name of database column containing the Path header.
575
576 Default value is “path”.
577
578 Example 1.15. Set path_column parameter
579...
580modparam("usrloc", "path_column", "path")
581...
582
5833.16. ruid_column (string)
584
585 Name of database column containing the Kamailio record unique id.
586
587 Default value is “ruid”.
588
589 Example 1.16. Set ruid_column parameter
590...
591modparam("usrloc", "ruid_column", "myruid")
592...
593
5943.17. instance_column (string)
595
596 Name of database column containing the SIP instance ID (GRUU -
597 RFC5627). This is a unique device identifier - UUID.
598
599 Default value is “instance”.
600
601 Example 1.17. Set instance_column parameter
602...
603modparam("usrloc", "instance_column", "myinstance")
604...
605
6063.18. reg_id_column (string)
607
608 Name of database table column containing the value for reg-id.
609
610 Default value is “reg_id”.
611
612 Example 1.18. Set reg_id_column parameter
613...
614modparam("usrloc", "reg_id_column", "r_id")
615...
616
6173.19. server_id_column (string)
618
619 Name of database table column containing the value for server id.
620
621 Default value is “server_id”.
622
623 Example 1.19. Set server_id_column parameter
624...
625modparam("usrloc", "server_id_column", "srv_id")
626...
627
6283.20. connection_id_column (string)
629
630 Name of database table column containing the value for connection id.
631
632 Default value is “connection_id”.
633
634 Example 1.20. Set connection_id_column parameter
635...
636modparam("usrloc", "connection_id_column", "con_id")
637...
638
6393.21. keepalive_column (string)
640
641 Name of database table column containing the value for keepalive
642 status.
643
644 Default value is “keepalive”.
645
646 Example 1.21. Set keepalive_column parameter
647...
648modparam("usrloc", "keepalive_column", "kalive")
649...
650
6513.22. partition_column (string)
652
653 Name of database table column containing the value for partition id.
654
655 Default value is “partition”.
656
657 Example 1.22. Set partition_column parameter
658...
659modparam("usrloc", "partition_column", "part")
660...
661
6623.23. use_domain (int)
663
664 If the domain part of the user should be also saved and used for
665 identifying the user (along with the username part). Useful in multi
666 domain scenarios. Non 0 value means true.
667
668 Default value is “0 (false)”.
669
670 Example 1.23. Set use_domain parameter
671...
672modparam("usrloc", "use_domain", 1)
673...
674
6753.24. desc_time_order (int)
676
677 If the user's contacts should be kept timestamp ordered; otherwise the
678 contact will be ordered based on q value. Non 0 value means true.
679
680 Default value is “0 (false)”.
681
682 Example 1.24. Set desc_time_order parameter
683...
684modparam("usrloc", "desc_time_order", 1)
685...
686
6873.25. timer_interval (int)
688
689 Number of seconds between two timer runs. The module uses a timer to
690 delete expired contacts, synchronize with database, send keepalives and
691 other tasks, that need to be run periodically.
692
693 Default value is 60.
694
695 Example 1.25. Set timer_interval parameter
696...
697modparam("usrloc", "timer_interval", 120)
698...
699
7003.26. db_url (string)
701
702 URL of the database that should be used.
703
704 Default value is “mysql://kamailio:kamailiorw@localhost/kamailio”.
705
706 Example 1.26. Set db_url parameter
707...
708modparam("usrloc", "db_url", "dbdriver://username:password@dbhost/dbname")
709...
710
7113.27. db_mode (int)
712
713 The usrloc module can utilize a database for persistent contact
714 storage. If a database is used, the location database (contacts) will
715 survive machine restarts or software crashes. The disadvantage is that
716 accessing a database can be very time consuming. Therefore, usrloc
717 module implements four database accessing modes:
718 * 0 - This disables database completely. Only memory will be used.
719 Contacts will not survive restart. Use this value if you need a
720 really fast usrloc and contact persistence is not necessary or is
721 provided by other means.
722 * 1 - Write-Through scheme. All changes to usrloc are immediately
723 reflected in database too. This is very slow, but very reliable.
724 Use this scheme if speed is not your priority but need to make sure
725 that no registered contacts will be lost during crash or reboot.
726 * 2 - Write-Back scheme. This is a combination of previous two
727 schemes. All changes are made to memory and database
728 synchronization is done in the timer. The timer deletes all expired
729 contacts and flushes all modified or new contacts to database. Use
730 this scheme if you encounter high-load peaks and want them to
731 process as fast as possible. The mode will not help at all if the
732 load is high all the time. Also, latency of this mode is much lower
733 than latency of mode 1, but slightly higher than latency of mode 0.
734 * 3 - DB-Only scheme. No memory cache is kept, all operations being
735 directly performed with the database. The timer deletes all expired
736 contacts from database - cleans after clients that didn't
737 un-register or re-register. The mode is useful if you configure
738 more servers sharing the same DB without any replication at SIP
739 level. The mode may be slower due the high number of DB operation.
740 For example NAT pinging is a killer since during each ping cycle
741 all natted contact are loaded from the DB; The lack of memory
742 caching also disable the statistics exports.
743 * 4 - This uses database to load records at startup but uses only
744 memory during the runtime. Records are not written back at all, not
745 even at shutdown. Useful for scenarios when registrations are
746 replicated to a node that does the storage in database during
747 runtime.
748
749Warning
750
751 In case of crash or restart contacts that are in memory only and
752 haven't been flushed yet will get lost. If you want minimize the risk,
753 use shorter timer interval.
754
755 Default value is 0.
756
757 Example 1.27. Set db_mode parameter
758...
759modparam("usrloc", "db_mode", 2)
760...
761
7623.28. db_load (int)
763
764 Determine if the usrloc module should load contacts from the database
765 storage during module initialization A value of 0 disable the loading
766 from the database, this parameter is ignored if db_mode 4 is set
767
768 Default value is 1.
769
770 Example 1.28. Set db_load parameter
771...
772modparam("usrloc", "db_load", 0)
773...
774
7753.29. db_insert_update (int)
776
777 Determine if the usrloc module should do an update when a duplicate key
778 is found while inserting A value of 1 will activate update on duplicate
779 key
780
781 Default value is 0.
782
783 Example 1.29. Set db_insert_update parameter
784...
785modparam("usrloc", "db_insert_update", 1)
786...
787
7883.30. matching_mode (int)
789
790 What contact matching algorithm to be used. Refer to section ??? for
791 the description of the algorithms.
792
793 The parameter may take the following values:
794 * 0 - CONTACT ONLY based matching algorithm.
795 * 1 - CONTACT and CALLID based matching algorithm.
796 * 2 - CONTACT and PATH based matching algorithm. This mode is like
797 mode 0 but allows for duplicate contacts from differing paths. If
798 no path is available, it defaults to mode 0.
799 * 3 - CALLID only based matching algorithm. This mode will discard
800 any duplicate registration coming through different paths.
801
802 Default value is 0 (CONTACT_ONLY).
803
804 Example 1.30. Set matching_mode parameter
805...
806modparam("usrloc", "matching_mode", 1)
807...
808
8093.31. cseq_delay (int)
810
811 Delay (in seconds) for accepting as retransmissions register requests
812 with same Call-ID and Cseq. The delay is calculated starting from the
813 receiving time of the first register with that Call-ID and Cseq.
814
815 Retransmissions within this delay interval will be accepted and replied
816 as the original request, but no update will be done in location. If the
817 delay is exceeded, error is reported.
818
819 A value of 0 disable the retransmission detection.
820
821 Default value is “20 seconds”.
822
823 Example 1.31. Set cseq_delay parameter
824...
825modparam("usrloc", "cseq_delay", 5)
826...
827
8283.32. fetch_rows (int)
829
830 The number of the rows to be fetched at once from database when loading
831 the location records. This value can be used to tune the load time at
832 startup. For 1MB of private memory (default) it should be below 4000.
833 The database driver must support fetch_result() capability.
834
835 Default value is “2000”.
836
837 Example 1.32. Set fetch_rows parameter
838...
839modparam("usrloc", "fetch_rows", 3000)
840...
841
8423.33. hash_size (int)
843
844 The number of entries of the hash table used by usrloc to store the
845 location records is 2^hash_size. For hash_size=4, the number of slots
846 of the hash table is 16.
847
848 Default value is “10” (1024 slots).
849
850 Example 1.33. Set hash_size parameter
851...
852modparam("usrloc", "hash_size", 12)
853...
854
8553.34. preload (string)
856
857 Preload location table given as value. A location table is loaded based
858 on fixup of registrar functions, therefore you need to use this
859 parameter only to load tables that are not used by registrar module
860 directly in configuration file.
861
862 Default value is “NULL”.
863
864 Example 1.34. Set preload parameter
865...
866modparam("usrloc", "preload", "location")
867...
868
8693.35. db_update_as_insert (int)
870
871 Set this parameter if you want to do INSERT DB operations instead of
872 UPDATE DB operations. It is recommended to set this parameter if you
873 use Cassandra as a DB backend.
874
875 Default value is “0”.
876
877 Example 1.35. Set db_update_as_insert parameter
878...
879modparam("usrloc", "db_update_as_insert", 1)
880...
881
8823.36. db_check_update (int)
883
884 Set this parameter to 1 if you want to do DB INSERT if the number of
885 affected rows by contact DB UPDATE operation is 0. The database module
886 driver has to implement affected_rows() DB API function, otherwise this
887 parameter is ignored - e.g., MySQL and Postgres DB connectors offer
888 affected_rows().
889
890 Default value is “0” (no DB INSERT).
891
892 Example 1.36. Set db_check_update parameter
893...
894modparam("usrloc", "db_check_update", 1)
895...
896
8973.37. timer_procs (int)
898
899 Number of timer processes to be started by module. Timer processes take
900 care of checking expired records and synchronization with database. If
901 set to 0, no dedicated timer is started, the one from core will be
902 used.
903
904 If the number of timer processes is greater than 1, the workload of
905 synchronization and record expiration is split up among the multiple
906 processes. (Each process is assigned a range of slots from the internal
907 hash table, and is responsible for cleanup and storage on those slots.)
908
909 Default value is “0”.
910
911 Example 1.37. Set timer_procs parameter
912...
913modparam("usrloc", "timer_procs", 4)
914...
915
9163.38. xavp_contact (string)
917
918 The name of XAVP storing the attributes per contact. They are saved in
919 location record and restored at lookup. The tm module parameter
920 xavp_contact must also be set to the same value to use the
921 t_load_contacts and t_next_contacts functions.
922
923 Default value is “NULL”.
924
925 Example 1.38. Set xavp_contact parameter
926...
927modparam("tm|usrloc", "xavp_contact", "ulattrs")
928...
929
9303.39. db_ops_ruid (int)
931
932 If set to 1, database queries for update or delete are done using ruid
933 value. If it is set to 0, the old style using aor, contact and call-id
934 is done.
935
936 Default value is “1”.
937
938 Example 1.39. Set db_ops_ruid parameter
939...
940modparam("usrloc", "db_ops_ruid", 0)
941...
942
9433.40. handle_lost_tcp (int)
944
945 If set to 1, Kamailio will remove location records made via
946 TCP/TLS/WS/WSS transports when it looses corresponding tcp connections.
947 Does not currently work in DB-Only scheme.
948
949 Default value is “0”.
950
951 Example 1.40. Set handle_lost_tcp parameter
952...
953modparam("usrloc", "handle_lost_tcp", 1)
954...
955
9563.41. close_expired_tcp (int)
957
958 If set to 1, Kamailio will close the TCP connection when a contact has
959 expired, if the corresponding transport is TCP/TLS/WS/WSS.
960
961 Default value is “0”.
962
963 Example 1.41. Set close_expired_tcp parameter
964...
965modparam("usrloc", "close_expired_tcp", 1)
966...
967
9683.42. expires_type (int)
969
970 If set to 1, Kamailio expects to deal with BIGINT type on database
971 columns for expires and last modified values. It allows to handle
972 better the daylight time adjustments. If set to 0, those columns are
973 expected to be on default type 'DATETIME'. When it is 1, the database
974 columns types have to be changed manually to 'BIGINT'.
975
976 Default value is “0”.
977
978 Example 1.42. Set expires_type parameter
979...
980modparam("usrloc", "expires_type", 1)
981...
982
9833.43. db_raw_fetch_type (int)
984
985 This affect DB-only mode and controls what kind of raw query is used to
986 fetch the contacts from database for specific needs (e.g., sending NAT
987 keepalives). If it is set to 0, then the common SQL query is used
988 (working for MySQL, PostgreSQL, ...). If it is set to 1, the query
989 required by Oracle is used.
990
991 Default value is “0”.
992
993 Example 1.43. Set db_raw_fetch_type parameter
994...
995modparam("usrloc", "db_raw_fetch_type", 1)
996...
997
9983.44. db_insert_null (int)
999
1000 If set to 1, the insert operation to database will add null values in
1001 the statement. It has to be set to 1 for the database systems that do
1002 not have table definitions that create automatically the null fields
1003 (e.g., db_mongodb) for each stored record.
1004
1005 When set to 0, the fields that default to null are not added to the DB
1006 insert statement if they don't have a different value, making the query
1007 smaller.
1008
1009 Default value is “0” (don't add null fields in insert statement).
1010
1011 Example 1.44. Set db_insert_null parameter
1012...
1013modparam("usrloc", "db_insert_null", 1)
1014...
1015
10163.45. skip_remote_socket (int)
1017
1018 If set to 1, Kamailio will skip location record when loading from
1019 database, if socket value of the record does not in kamailio listening
1020 socket list.
1021
1022 Default value is “0”.
1023
1024 Example 1.45. Set skip_remote_socket parameter
1025...
1026modparam("usrloc", "skip_remote_socket", 1)
1027...
1028
10293.46. db_timer_clean (int)
1030
1031 Enable (1) or disable (0) cleaning of expired db records on timer basis
1032 for db_mode WRITE-BACK and WRITE-THROUGH. It uses the secondary timer
1033 process.
1034
1035 Default value is “0”.
1036
1037 Example 1.46. Set db_timer_clean parameter
1038...
1039modparam("usrloc", "db_timer_clean", 1)
1040...
1041
10423.47. rm_expired_delay (int)
1043
1044 Specify the number of seconds to delay the removal of expired records.
1045 For now it works for DB_ONLY mode (db_mode=3).
1046
1047 Default value is “0”.
1048
1049 Example 1.47. Set rm_expired_delay parameter
1050...
1051modparam("usrloc", "rm_expired_delay", 30)
1052...
1053
10543.48. server_id_filter (int)
1055
1056 Enable (1) or disable (0) filter records by server_id on load and
1057 during cleaning of expired db records. It could be useful when you want
1058 to use the same location table for several kamailio instances which are
1059 configured to work in db_mode=1 or db_mode=2 (cache modes). Otherwise
1060 one instance of proxy cleans records made by another proxy and that
1061 breaks its cache.
1062
1063 Default value is “0”.
1064
1065 Example 1.48. Set server_id_filter parameter
1066...
1067modparam("usrloc", "server_id_filter", 1)
1068...
1069
10703.49. version_table (int)
1071
1072 If set to 0, the module will skip checking the version for location
1073 table.
1074
1075 Default value is “1 (check for table version)”.
1076
1077 Example 1.49. version_table parameter usage
1078...
1079modparam("usrloc", "version_table", 0)
1080...
1081
10823.50. ka_mode (int)
1083
1084 Keepalive mode - control the internal keepalive mechanism. With this
1085 feature enabled, the module sends periodically (based on timer
1086 interval) SIP requests to location contacts and measures the round trip
1087 in microseconds (the round trip value can be seen in the response of
1088 the RPC command 'ul.dump').
1089
1090 Its value is a set of flags:
1091 * 0 - if the value is zero, no keepalive is sent
1092 * 1 (bit 1 set) - if set to 1, the keepalive is enabled for all
1093 contacts
1094 * 2 (bit 2 set) - the keepalive is sent only for natted contacts
1095 (nat_bflag set)
1096 * 4 (bit 3 set) - the keepalive is sent only for UDP contacts
1097
1098 For example, if set to 6, then keepalive is sent only natted UDP
1099 contacs.
1100
1101 Note: the internal keepalive of usrloc module conflicts in some way
1102 with the keepalive done by nathelper module. It is recommended to
1103 enable only one.
1104
1105 Note: the internal keepalive is for the moment implemented only for
1106 contact records stored in memory.
1107
1108 Note: it is recommeder to set 'timer_procs' parameter in order to have
1109 dedicated timer processes for usrloc module and off-load the keepalive
1110 sending process from the core timers.
1111
1112 Default value is “0 (keepalive disabled)”.
1113
1114 Example 1.50. ka_mode parameter usage
1115...
1116modparam("usrloc", "ka_mode", 1)
1117...
1118
11193.51. ka_method (str)
1120
1121 The SIP method type for keepalive requests.
1122
1123 Default value is “OPTIONS”.
1124
1125 Example 1.51. ka_method parameter usage
1126...
1127modparam("usrloc", "ka_method", "NOTIFY")
1128...
1129
11303.52. ka_from (str)
1131
1132 The SIP URI to be set in the From header of the keepalive requests.
1133
1134 Default value is “sip:server@kamailio.org”.
1135
1136 Example 1.52. ka_from parameter usage
1137...
1138modparam("usrloc", "ka_from", "sip:server@mydomain.com")
1139...
1140
11413.53. ka_domain (str)
1142
1143 The domain to be set in To header URI if the multi-domain is not
1144 enabled. If multi-domain is enabled, then the domain from the location
1145 record is used and this parameter is ignored.
1146
1147 Default value is “kamailio.org”.
1148
1149 Example 1.53. ka_domain parameter usage
1150...
1151modparam("usrloc", "ka_domain", "mydomain.com")
1152...
1153
11543.54. ka_filter (int)
1155
1156 Set filters for keepalive processing.
1157
1158 Its value is a set of flags:
1159 * 0 - if the value is zero, no filter is enabled for keepalives
1160 * 1 (bit 1 set) - keepalives sent only to records matching the
1161 server_id global parameter.
1162
1163 Default value is “0” (no filter).
1164
1165 Example 1.54. ka_filter parameter usage
1166...
1167modparam("usrloc", "ka_filter", 1)
1168...
1169
11703.55. ka_timeout (int)
1171
1172 The parameter sets the interval in seconds after which a contact is
1173 removed from location table if it does not reply to SIP keepalives
1174 (usually OPTIONS ping requests).
1175
1176 The features is available only for contacts that are stored in memory
1177 (not working for db only mode of the usrloc module).
1178
1179 Keepalives are sent stateless, not using TM module. The value of this
1180 parameter has to be few times higher than timer interval.
1181
1182 Default value is “0” (feature disabled).
1183
1184 Example 1.55. Set ka_timeout parameter
1185...
1186modparam("usrloc", "ka_timeout", 120)
1187...
1188
11893.56. ka_loglevel (int)
1190
1191 The level to print the log message when the keepalive response is
1192 received. It should be a value between -5 (L_ALERT) and 3 (L_DBG).
1193
1194 Default value is “255” (disabled).
1195
1196 Example 1.56. ka_loglevel parameter usage
1197...
1198modparam("usrloc", "ka_loglevel", 1)
1199...
1200
12013.57. ka_logmsg (str)
1202
1203 The formatted log specification to be added to the message printed when
1204 the keepalive is received and roundtrip time is computed. The log
1205 message starts with "keepalive roundtrip: %u.%06u sec - ruid [%.*s]",
1206 then concatenates the value of this parameter and the end of line.
1207
1208 The value of this parameter can contain script variables that are
1209 evaluated with the SIP response.
1210
1211 Default value is “ to-uri: [$tu] remote-addr: [$sas]”.
1212
1213 Example 1.57. ka_logmsg parameter usage
1214...
1215modparam("usrloc", "ka_logmsg", " to-uri: [$tu] remote-addr: [$sas]")
1216...
1217
12184. RPC Commands
1219
1220 4.1. ul.dump
1221 4.2. ul.lookup table AOR
1222 4.3. ul.rm table AOR
1223 4.4. ul.rm_contact table AOR contact
1224 4.5. ul.flush
1225 4.6. ul.add
1226 4.7. ul.db_users
1227 4.8. ul.db_contacts
1228 4.9. ul.db_expired_contacts
1229
12304.1. ul.dump
1231
1232 Dumps the content of the location table
1233
1234 Parameters:
1235 * None.
1236
12374.2. ul.lookup table AOR
1238
1239 Looks up the contents of an AOR entry in the location table
1240
1241 Parameters:
1242 * table name - table where the AOR resides (Ex: location).
1243 * AOR - user AOR in username[@domain] format (domain must be supplied
1244 only if use_domain option is on).
1245
12464.3. ul.rm table AOR
1247
1248 Deletes an entire AOR record (including its contacts).
1249
1250 Parameters:
1251 * table name - table where the AOR resides (Ex: location).
1252 * AOR - user AOR in username[@domain] format (domain must be supplied
1253 only if use_domain option is on).
1254
12554.4. ul.rm_contact table AOR contact
1256
1257 Deletes a contact from an AOR record.
1258
1259 Parameters:
1260 * table name - table where the AOR is removed from (Ex: location).
1261 * AOR - user AOR in username[@domain] format (domain must be supplied
1262 only if use_domain option is on).
1263 * contact - exact contact to be removed
1264
12654.5. ul.flush
1266
1267 Triggers the flush of USRLOC memory cache into DB.
1268
12694.6. ul.add
1270
1271 Adds a new contact for an user AOR.
1272
1273 Parameters:
1274 * table name - table where the contact will be added (Ex: location).
1275 * AOR - user AOR in username[@domain] format (domain must be supplied
1276 only if use_domain option is on).
1277 * contact - contact string to be added
1278 * expires - expires value of the contact
1279 * Q - Q value of the contact
1280 * path value with the Path vector (use '0' or '.' if it should not be
1281 set)
1282 * flags - internal USRLOC flags of the contact
1283 * cflags - per branch flags of the contact
1284 * methods - mask with supported requests of the contact
1285 * received (optional) value with the received-from address (source
1286 address) (use '0' or '.' if it should not be set). Format:
1287 sip:srcip:srcport;transport=abc
1288 * socket (optional) value with the local socket address (use '0' or
1289 '.' if it should not be set). Format: proto:localip:localport
1290
1291 Note: the position of parameters is relevant, in the case of optional
1292 parameters, use '0' or '.' for parameters that should not be set which
1293 are positioned before any parameter that has to be set.
1294
12954.7. ul.db_users
1296
1297 Tell number of different users (AoRs) in a location table that have
1298 unexpired contacts.
1299
1300 Parameters:
1301 * table name - location table where the users are looked for, for
1302 example, location.
1303
13044.8. ul.db_contacts
1305
1306 Tell number of unexpired contacts in a location table.
1307
1308 Parameters:
1309 * table name - location table where the contacts are looked for, for
1310 example, location.
1311
13124.9. ul.db_expired_contacts
1313
1314 Tell number of expired contacts in a location table.
1315
1316 Parameters:
1317 * table name - location table where the contacts are looked for, for
1318 example, location.
1319
13205. Statistics
1321
1322 5.1. users
1323 5.2. contacts
1324 5.3. expires
1325 5.4. registered_users
1326
1327 Exported statistics are listed in the next sections.
1328
13295.1. users
1330
1331 Number of AOR existing in the USRLOC memory cache for that domain - can
1332 not be reset; this statistic will be register for each used domain (Ex:
1333 location).
1334
13355.2. contacts
1336
1337 Number of contacts existing in the USRLOC memory cache for that domain
1338 - can not be reset; this statistic will be register for each used
1339 domain (Ex: location).
1340
13415.3. expires
1342
1343 Total number of expired contacts for that domain - can be reset; this
1344 statistic will be register for each used domain (Ex: location).
1345
13465.4. registered_users
1347
1348 Total number of AOR existing in the USRLOC memory cache for all domains
1349 - can not be reset.
1350
1351Chapter 2. Developer Guide
1352
1353 Table of Contents
1354
1355 1. Available Functions
1356
1357 1.1. ul_register_domain(name)
1358 1.2. ul_insert_urecord(domain, aor, rec)
1359 1.3. ul_delete_urecord(domain, aor)
1360 1.4. ul_delete_urecord_by_ruid(domain, ruid)
1361 1.5. ul_get_urecord(domain, aor)
1362 1.6. ul_lock_udomain(domain)
1363 1.7. ul_unlock_udomain(domain)
1364 1.8. ul_release_urecord(record)
1365 1.9. ul_insert_ucontact(record, contact, expires, q, callid, cseq,
1366 flags, cont, ua, sock)
1367
1368 1.10. ul_delete_ucontact (record, contact)
1369 1.11. ul_get_ucontact(record, contact)
1370 1.12. ul_get_all_ucontacts (buf, len, flags)
1371 1.13. ul_update_ucontact(contact, expires, q, callid, cseq, set,
1372 res, ua, sock)
1373
1374 1.14. ul_bind_ursloc( api )
1375 1.15. ul_register_ulcb(type ,callback, param)
1376 1.16. ul_get_num_users()
1377
13781. Available Functions
1379
1380 1.1. ul_register_domain(name)
1381 1.2. ul_insert_urecord(domain, aor, rec)
1382 1.3. ul_delete_urecord(domain, aor)
1383 1.4. ul_delete_urecord_by_ruid(domain, ruid)
1384 1.5. ul_get_urecord(domain, aor)
1385 1.6. ul_lock_udomain(domain)
1386 1.7. ul_unlock_udomain(domain)
1387 1.8. ul_release_urecord(record)
1388 1.9. ul_insert_ucontact(record, contact, expires, q, callid, cseq,
1389 flags, cont, ua, sock)
1390
1391 1.10. ul_delete_ucontact (record, contact)
1392 1.11. ul_get_ucontact(record, contact)
1393 1.12. ul_get_all_ucontacts (buf, len, flags)
1394 1.13. ul_update_ucontact(contact, expires, q, callid, cseq, set, res,
1395 ua, sock)
1396
1397 1.14. ul_bind_ursloc( api )
1398 1.15. ul_register_ulcb(type ,callback, param)
1399 1.16. ul_get_num_users()
1400
14011.1. ul_register_domain(name)
1402
1403 The function registers a new domain. Domain is just another name for
1404 table used in registrar. The function is called from fixups in
1405 registrar. It gets name of the domain as a parameter and returns
1406 pointer to a new domain structure. The fixup than 'fixes' the parameter
1407 in registrar so that it will pass the pointer instead of the name every
1408 time save() or lookup() is called. Some usrloc functions get the
1409 pointer as parameter when called. For more details see implementation
1410 of save function in registrar.
1411
1412 Meaning of the parameters is as follows:
1413 * const char* name - Name of the domain (also called table) to be
1414 registered.
1415
14161.2. ul_insert_urecord(domain, aor, rec)
1417
1418 The function creates a new record structure and inserts it in the
1419 specified domain. The record is structure that contains all the
1420 contacts for belonging to the specified username.
1421
1422 Meaning of the parameters is as follows:
1423 * udomain_t* domain - Pointer to domain returned by
1424 ul_register_udomain.
1425
1426 * str* aor - Address of Record (aka username) of the new record (at
1427 this time the record will contain no contacts yet).
1428
1429 * urecord_t** rec - The newly created record structure.
1430
14311.3. ul_delete_urecord(domain, aor)
1432
1433 The function deletes all the contacts bound with the given Address Of
1434 Record.
1435
1436 Meaning of the parameters is as follows:
1437 * udomain_t* domain - Pointer to domain returned by
1438 ul_register_udomain.
1439
1440 * str* aor - Address of record (aka username) of the record, that
1441 should be deleted.
1442
14431.4. ul_delete_urecord_by_ruid(domain, ruid)
1444
1445 The function deletes from given domain a contact with given ruid.
1446
1447 Meaning of the parameters is as follows:
1448 * udomain_t* domain - Pointer to domain returned by
1449 ul_register_udomain.
1450
1451 * str* ruid - ruid of contact that should be deleted.
1452
14531.5. ul_get_urecord(domain, aor)
1454
1455 The function returns pointer to record with given Address of Record.
1456
1457 Meaning of the parameters is as follows:
1458 * udomain_t* domain - Pointer to domain returned by
1459 ul_register_udomain.
1460
1461 * str* aor - Address of Record of request record.
1462
14631.6. ul_lock_udomain(domain)
1464
1465 The function lock the specified domain, it means, that no other
1466 processes will be able to access during the time. This prevents race
1467 conditions. Scope of the lock is the specified domain, that means, that
1468 multiple domain can be accessed simultaneously, they don't block each
1469 other.
1470
1471 Meaning of the parameters is as follows:
1472 * udomain_t* domain - Domain to be locked.
1473
14741.7. ul_unlock_udomain(domain)
1475
1476 Unlock the specified domain previously locked by ul_lock_udomain.
1477
1478 Meaning of the parameters is as follows:
1479 * udomain_t* domain - Domain to be unlocked.
1480
14811.8. ul_release_urecord(record)
1482
1483 Do some sanity checks - if all contacts have been removed, delete the
1484 entire record structure.
1485
1486 Meaning of the parameters is as follows:
1487 * urecord_t* record - Record to be released.
1488
14891.9. ul_insert_ucontact(record, contact, expires, q, callid, cseq, flags,
1490cont, ua, sock)
1491
1492 The function inserts a new contact in the given record with specified
1493 parameters.
1494
1495 Meaning of the parameters is as follows:
1496 * urecord_t* record - Record in which the contact should be inserted.
1497 * str* contact - Contact URI.
1498 * time_t expires - Expires of the contact in absolute value.
1499 * float q - q value of the contact.
1500 * str* callid - Call-ID of the REGISTER message that contained the
1501 contact.
1502 * int cseq - CSeq of the REGISTER message that contained the contact.
1503 * unsigned int flags - Flags to be set.
1504 * ucontact_t* cont - Pointer to newly created structure.
1505 * str* ua - User-Agent of the REGISTER message that contained the
1506 contact.
1507 * struct socket_info *sock - socket on which the REGISTER message was
1508 received on.
1509
15101.10. ul_delete_ucontact (record, contact)
1511
1512 The function deletes given contact from record.
1513
1514 Meaning of the parameters is as follows:
1515 * urecord_t* record - Record from which the contact should be
1516 removed.
1517
1518 * ucontact_t* contact - Contact to be deleted.
1519
15201.11. ul_get_ucontact(record, contact)
1521
1522 The function tries to find contact with given Contact URI and returns
1523 pointer to structure representing the contact.
1524
1525 Meaning of the parameters is as follows:
1526 * urecord_t* record - Record to be searched for the contact.
1527
1528 * str_t* contact - URI of the request contact.
1529
15301.12. ul_get_all_ucontacts (buf, len, flags)
1531
1532 The function retrieves all contacts of all registered users and returns
1533 them in the caller-supplied buffer. If the buffer is too small, the
1534 function returns positive value indicating how much additional space
1535 would be necessary to accommodate all of them. Please note that the
1536 positive return value should be used only as a “hint”, as there is no
1537 guarantee that during the time between two subsequent calls number of
1538 registered contacts will remain the same.
1539
1540 If flag parameter is set to non-zero value then only contacts that have
1541 the specified flags set will be returned. It is, for example, possible
1542 to list only contacts that are behind NAT.
1543
1544 Meaning of the parameters is as follows:
1545 * void* buf - Buffer for returning contacts.
1546
1547 * int len - Length of the buffer.
1548
1549 * unsigned int flags - Flags that must be set.
1550
15511.13. ul_update_ucontact(contact, expires, q, callid, cseq, set, res, ua,
1552sock)
1553
1554 The function updates contact with new values.
1555
1556 Meaning of the parameters is as follows:
1557 * ucontact_t* contact - Contact URI.
1558 * time_t expires - Expires of the contact in absolute value.
1559 * float q - q value of the contact.
1560 * str* callid - Call-ID of the REGISTER message that contained the
1561 contact.
1562 * int cseq - CSeq of the REGISTER message that contained the contact.
1563 * unsigned int set - OR value of flags to be set.
1564 * unsigned int res - OR value of flags to be reset.
1565 * str* ua - User-Agent of the REGISTER message that contained the
1566 contact.
1567 * struct socket_info *sock - socket on which the REGISTER message was
1568 received on.
1569
15701.14. ul_bind_ursloc( api )
1571
1572 The function imports all functions that are exported by the USRLOC
1573 module. Overs for other modules which want to user the internal USRLOC
1574 API an easy way to load and access the functions.
1575
1576 Meaning of the parameters is as follows:
1577 * usrloc_api_t* api - USRLOC API
1578
15791.15. ul_register_ulcb(type ,callback, param)
1580
1581 The function register with USRLOC a callback function to be called when
1582 some event occures inside USRLOC.
1583
1584 Meaning of the parameters is as follows:
1585 * int types - type of event for which the callback should be called
1586 (see usrloc/ul_callback.h).
1587 * ul_cb f - callback function; see usrloc/ul_callback.h for
1588 prototype.
1589 * void *param - some parameter to be passed to the callback each time
1590 when it is called.
1591
15921.16. ul_get_num_users()
1593
1594 The function loops through all domains summing up the number of users.
1595