|
@@ -12,13 +12,11 @@ Edited by
|
|
|
|
|
|
Anca-Maria Vamanu
|
|
Anca-Maria Vamanu
|
|
|
|
|
|
-Edited by
|
|
|
|
-
|
|
|
|
Juha Heinanen
|
|
Juha Heinanen
|
|
|
|
|
|
- Copyright © 2006 Voice Sistem SRL
|
|
|
|
|
|
+ Copyright © 2006 Voice Sistem SRL
|
|
|
|
|
|
- Copyright © 2009 Juha Heinanen
|
|
|
|
|
|
+ Copyright © 2009 Juha Heinanen
|
|
__________________________________________________________________
|
|
__________________________________________________________________
|
|
|
|
|
|
Table of Contents
|
|
Table of Contents
|
|
@@ -42,26 +40,27 @@ Juha Heinanen
|
|
3.7. waitn_time (int)
|
|
3.7. waitn_time (int)
|
|
3.8. notifier_poll_rate (int)
|
|
3.8. notifier_poll_rate (int)
|
|
3.9. notifier_processes (int)
|
|
3.9. notifier_processes (int)
|
|
- 3.10. to_tag_pref (str)
|
|
|
|
- 3.11. expires_offset (int)
|
|
|
|
- 3.12. max_expires (int)
|
|
|
|
- 3.13. min_expires (int)
|
|
|
|
- 3.14. min_expires_action (int)
|
|
|
|
- 3.15. server_address (str)
|
|
|
|
- 3.16. subs_db_mode (int)
|
|
|
|
- 3.17. publ_cache (int)
|
|
|
|
- 3.18. subs_htable_size (int)
|
|
|
|
- 3.19. pres_htable_size (int)
|
|
|
|
- 3.20. send_fast_notify (int)
|
|
|
|
- 3.21. enable_sphere_check (int)
|
|
|
|
- 3.22. timeout_rm_subs (int)
|
|
|
|
- 3.23. fetch_rows (integer)
|
|
|
|
- 3.24. db_table_lock_type (integer)
|
|
|
|
- 3.25. local_log_level (int)
|
|
|
|
- 3.26. subs_remove_match (int)
|
|
|
|
- 3.27. xavp_cfg (str)
|
|
|
|
- 3.28. retrieve_order (int)
|
|
|
|
- 3.29. sip_uri_match (int)
|
|
|
|
|
|
+ 3.10. force_delete (int)
|
|
|
|
+ 3.11. to_tag_pref (str)
|
|
|
|
+ 3.12. expires_offset (int)
|
|
|
|
+ 3.13. max_expires (int)
|
|
|
|
+ 3.14. min_expires (int)
|
|
|
|
+ 3.15. min_expires_action (int)
|
|
|
|
+ 3.16. server_address (str)
|
|
|
|
+ 3.17. subs_db_mode (int)
|
|
|
|
+ 3.18. publ_cache (int)
|
|
|
|
+ 3.19. subs_htable_size (int)
|
|
|
|
+ 3.20. pres_htable_size (int)
|
|
|
|
+ 3.21. send_fast_notify (int)
|
|
|
|
+ 3.22. enable_sphere_check (int)
|
|
|
|
+ 3.23. timeout_rm_subs (int)
|
|
|
|
+ 3.24. fetch_rows (integer)
|
|
|
|
+ 3.25. db_table_lock_type (integer)
|
|
|
|
+ 3.26. local_log_level (int)
|
|
|
|
+ 3.27. subs_remove_match (int)
|
|
|
|
+ 3.28. xavp_cfg (str)
|
|
|
|
+ 3.29. retrieve_order (int)
|
|
|
|
+ 3.30. sip_uri_match (int)
|
|
|
|
|
|
4. Functions
|
|
4. Functions
|
|
|
|
|
|
@@ -124,34 +123,35 @@ Juha Heinanen
|
|
1.7. Set waitn_time parameter
|
|
1.7. Set waitn_time parameter
|
|
1.8. Set notifier_poll_rate parameter
|
|
1.8. Set notifier_poll_rate parameter
|
|
1.9. Set notifier_processes parameter
|
|
1.9. Set notifier_processes parameter
|
|
- 1.10. Set to_tag_pref parameter
|
|
|
|
- 1.11. Set expires_offset parameter
|
|
|
|
- 1.12. Set max_expires parameter
|
|
|
|
- 1.13. Set min_expires parameter
|
|
|
|
|
|
+ 1.10. Set force_delete parameter
|
|
|
|
+ 1.11. Set to_tag_pref parameter
|
|
|
|
+ 1.12. Set expires_offset parameter
|
|
|
|
+ 1.13. Set max_expires parameter
|
|
1.14. Set min_expires parameter
|
|
1.14. Set min_expires parameter
|
|
- 1.15. Set server_address parameter
|
|
|
|
- 1.16. Set subs_db_mode parameter
|
|
|
|
- 1.17. Set publ_cache parameter
|
|
|
|
- 1.18. Set subs_htable_size parameter
|
|
|
|
- 1.19. Set pres_htable_size parameter
|
|
|
|
- 1.20. Set send_fast_notify parameter
|
|
|
|
- 1.21. Set enable_sphere_check parameter
|
|
|
|
- 1.22. Set timeout_rm_subs parameter
|
|
|
|
- 1.23. Set fetch_rows parameter
|
|
|
|
- 1.24. Set db_table_lock_type parameter
|
|
|
|
- 1.25. Set local_log_level parameter
|
|
|
|
- 1.26. Set subs_remove_match parameter
|
|
|
|
- 1.27. Set xavp_cfg parameter
|
|
|
|
- 1.28. Set retrieve_order parameter
|
|
|
|
- 1.29. Set sip_uri_match parameter
|
|
|
|
- 1.30. handle_publish usage
|
|
|
|
- 1.31. handle_subscribe usage
|
|
|
|
- 1.32. pres_auth_status usage
|
|
|
|
- 1.33. pres_refresh_watchers usage
|
|
|
|
- 1.34. pres_update_watchers usage
|
|
|
|
- 1.35. $subs(name) usage
|
|
|
|
- 1.36. $notify_reply(name) usage
|
|
|
|
|
|
+ 1.15. Set min_expires parameter
|
|
|
|
+ 1.16. Set server_address parameter
|
|
|
|
+ 1.17. Set subs_db_mode parameter
|
|
|
|
+ 1.18. Set publ_cache parameter
|
|
|
|
+ 1.19. Set subs_htable_size parameter
|
|
|
|
+ 1.20. Set pres_htable_size parameter
|
|
|
|
+ 1.21. Set send_fast_notify parameter
|
|
|
|
+ 1.22. Set enable_sphere_check parameter
|
|
|
|
+ 1.23. Set timeout_rm_subs parameter
|
|
|
|
+ 1.24. Set fetch_rows parameter
|
|
|
|
+ 1.25. Set db_table_lock_type parameter
|
|
|
|
+ 1.26. Set local_log_level parameter
|
|
|
|
+ 1.27. Set subs_remove_match parameter
|
|
|
|
+ 1.28. Set xavp_cfg parameter
|
|
|
|
+ 1.29. Set retrieve_order parameter
|
|
|
|
+ 1.30. Set sip_uri_match parameter
|
|
|
|
+ 1.31. handle_publish usage
|
|
|
|
+ 1.32. handle_subscribe usage
|
|
|
|
+ 1.33. pres_auth_status usage
|
|
|
|
+ 1.34. pres_refresh_watchers usage
|
|
|
|
+ 1.35. pres_update_watchers usage
|
|
|
|
+ 1.36. $subs(name) usage
|
|
1.37. $notify_reply(name) usage
|
|
1.37. $notify_reply(name) usage
|
|
|
|
+ 1.38. $notify_reply(name) usage
|
|
2.1. presence_api_t structure
|
|
2.1. presence_api_t structure
|
|
|
|
|
|
Chapter 1. Admin Guide
|
|
Chapter 1. Admin Guide
|
|
@@ -175,26 +175,27 @@ Chapter 1. Admin Guide
|
|
3.7. waitn_time (int)
|
|
3.7. waitn_time (int)
|
|
3.8. notifier_poll_rate (int)
|
|
3.8. notifier_poll_rate (int)
|
|
3.9. notifier_processes (int)
|
|
3.9. notifier_processes (int)
|
|
- 3.10. to_tag_pref (str)
|
|
|
|
- 3.11. expires_offset (int)
|
|
|
|
- 3.12. max_expires (int)
|
|
|
|
- 3.13. min_expires (int)
|
|
|
|
- 3.14. min_expires_action (int)
|
|
|
|
- 3.15. server_address (str)
|
|
|
|
- 3.16. subs_db_mode (int)
|
|
|
|
- 3.17. publ_cache (int)
|
|
|
|
- 3.18. subs_htable_size (int)
|
|
|
|
- 3.19. pres_htable_size (int)
|
|
|
|
- 3.20. send_fast_notify (int)
|
|
|
|
- 3.21. enable_sphere_check (int)
|
|
|
|
- 3.22. timeout_rm_subs (int)
|
|
|
|
- 3.23. fetch_rows (integer)
|
|
|
|
- 3.24. db_table_lock_type (integer)
|
|
|
|
- 3.25. local_log_level (int)
|
|
|
|
- 3.26. subs_remove_match (int)
|
|
|
|
- 3.27. xavp_cfg (str)
|
|
|
|
- 3.28. retrieve_order (int)
|
|
|
|
- 3.29. sip_uri_match (int)
|
|
|
|
|
|
+ 3.10. force_delete (int)
|
|
|
|
+ 3.11. to_tag_pref (str)
|
|
|
|
+ 3.12. expires_offset (int)
|
|
|
|
+ 3.13. max_expires (int)
|
|
|
|
+ 3.14. min_expires (int)
|
|
|
|
+ 3.15. min_expires_action (int)
|
|
|
|
+ 3.16. server_address (str)
|
|
|
|
+ 3.17. subs_db_mode (int)
|
|
|
|
+ 3.18. publ_cache (int)
|
|
|
|
+ 3.19. subs_htable_size (int)
|
|
|
|
+ 3.20. pres_htable_size (int)
|
|
|
|
+ 3.21. send_fast_notify (int)
|
|
|
|
+ 3.22. enable_sphere_check (int)
|
|
|
|
+ 3.23. timeout_rm_subs (int)
|
|
|
|
+ 3.24. fetch_rows (integer)
|
|
|
|
+ 3.25. db_table_lock_type (integer)
|
|
|
|
+ 3.26. local_log_level (int)
|
|
|
|
+ 3.27. subs_remove_match (int)
|
|
|
|
+ 3.28. xavp_cfg (str)
|
|
|
|
+ 3.29. retrieve_order (int)
|
|
|
|
+ 3.30. sip_uri_match (int)
|
|
|
|
|
|
4. Functions
|
|
4. Functions
|
|
|
|
|
|
@@ -278,26 +279,27 @@ Chapter 1. Admin Guide
|
|
3.7. waitn_time (int)
|
|
3.7. waitn_time (int)
|
|
3.8. notifier_poll_rate (int)
|
|
3.8. notifier_poll_rate (int)
|
|
3.9. notifier_processes (int)
|
|
3.9. notifier_processes (int)
|
|
- 3.10. to_tag_pref (str)
|
|
|
|
- 3.11. expires_offset (int)
|
|
|
|
- 3.12. max_expires (int)
|
|
|
|
- 3.13. min_expires (int)
|
|
|
|
- 3.14. min_expires_action (int)
|
|
|
|
- 3.15. server_address (str)
|
|
|
|
- 3.16. subs_db_mode (int)
|
|
|
|
- 3.17. publ_cache (int)
|
|
|
|
- 3.18. subs_htable_size (int)
|
|
|
|
- 3.19. pres_htable_size (int)
|
|
|
|
- 3.20. send_fast_notify (int)
|
|
|
|
- 3.21. enable_sphere_check (int)
|
|
|
|
- 3.22. timeout_rm_subs (int)
|
|
|
|
- 3.23. fetch_rows (integer)
|
|
|
|
- 3.24. db_table_lock_type (integer)
|
|
|
|
- 3.25. local_log_level (int)
|
|
|
|
- 3.26. subs_remove_match (int)
|
|
|
|
- 3.27. xavp_cfg (str)
|
|
|
|
- 3.28. retrieve_order (int)
|
|
|
|
- 3.29. sip_uri_match (int)
|
|
|
|
|
|
+ 3.10. force_delete (int)
|
|
|
|
+ 3.11. to_tag_pref (str)
|
|
|
|
+ 3.12. expires_offset (int)
|
|
|
|
+ 3.13. max_expires (int)
|
|
|
|
+ 3.14. min_expires (int)
|
|
|
|
+ 3.15. min_expires_action (int)
|
|
|
|
+ 3.16. server_address (str)
|
|
|
|
+ 3.17. subs_db_mode (int)
|
|
|
|
+ 3.18. publ_cache (int)
|
|
|
|
+ 3.19. subs_htable_size (int)
|
|
|
|
+ 3.20. pres_htable_size (int)
|
|
|
|
+ 3.21. send_fast_notify (int)
|
|
|
|
+ 3.22. enable_sphere_check (int)
|
|
|
|
+ 3.23. timeout_rm_subs (int)
|
|
|
|
+ 3.24. fetch_rows (integer)
|
|
|
|
+ 3.25. db_table_lock_type (integer)
|
|
|
|
+ 3.26. local_log_level (int)
|
|
|
|
+ 3.27. subs_remove_match (int)
|
|
|
|
+ 3.28. xavp_cfg (str)
|
|
|
|
+ 3.29. retrieve_order (int)
|
|
|
|
+ 3.30. sip_uri_match (int)
|
|
|
|
|
|
3.1. db_url(str)
|
|
3.1. db_url(str)
|
|
|
|
|
|
@@ -306,7 +308,7 @@ Chapter 1. Admin Guide
|
|
If set, the module is a fully operational presence server. Otherwise,
|
|
If set, the module is a fully operational presence server. Otherwise,
|
|
it is used as a 'library', for its exported functions.
|
|
it is used as a 'library', for its exported functions.
|
|
|
|
|
|
- Default value is “NULL�.
|
|
|
|
|
|
+ Default value is "NULL".
|
|
|
|
|
|
Example 1.1. Set db_url parameter
|
|
Example 1.1. Set db_url parameter
|
|
...
|
|
...
|
|
@@ -318,7 +320,7 @@ modparam("presence", "db_url",
|
|
|
|
|
|
The name of the db table where PUBLISH presence information is stored.
|
|
The name of the db table where PUBLISH presence information is stored.
|
|
|
|
|
|
- Default value is “presentity�.
|
|
|
|
|
|
+ Default value is "presentity".
|
|
|
|
|
|
Example 1.2. Set presentity_table parameter
|
|
Example 1.2. Set presentity_table parameter
|
|
...
|
|
...
|
|
@@ -330,7 +332,7 @@ modparam("presence", "presentity_table", "presentity")
|
|
The name of the db table where active subscription information is
|
|
The name of the db table where active subscription information is
|
|
stored.
|
|
stored.
|
|
|
|
|
|
- Default value is “active_watchers�.
|
|
|
|
|
|
+ Default value is "active_watchers".
|
|
|
|
|
|
Example 1.3. Set active_watchers_table parameter
|
|
Example 1.3. Set active_watchers_table parameter
|
|
...
|
|
...
|
|
@@ -341,7 +343,7 @@ modparam("presence", "active_watchers_table", "active_watchers")
|
|
|
|
|
|
The name of the db table where subscription states are stored.
|
|
The name of the db table where subscription states are stored.
|
|
|
|
|
|
- Default value is “watchers�.
|
|
|
|
|
|
+ Default value is "watchers".
|
|
|
|
|
|
Example 1.4. Set watchers_table parameter
|
|
Example 1.4. Set watchers_table parameter
|
|
...
|
|
...
|
|
@@ -353,7 +355,7 @@ modparam("presence", "watchers_table", "watchers")
|
|
The period in seconds between checks if there are expired messages
|
|
The period in seconds between checks if there are expired messages
|
|
stored in database.
|
|
stored in database.
|
|
|
|
|
|
- Default value is “100�. A zero or negative value disables this
|
|
|
|
|
|
+ Default value is "100". A zero or negative value disables this
|
|
activity.
|
|
activity.
|
|
|
|
|
|
Example 1.5. Set clean_period parameter
|
|
Example 1.5. Set clean_period parameter
|
|
@@ -366,7 +368,7 @@ modparam("presence", "clean_period", 100)
|
|
The period at which to synchronize cached subscriber info with the
|
|
The period at which to synchronize cached subscriber info with the
|
|
database.
|
|
database.
|
|
|
|
|
|
- Default value is “100�. A zero or negative value disables
|
|
|
|
|
|
+ Default value is "100". A zero or negative value disables
|
|
synchronization.
|
|
synchronization.
|
|
|
|
|
|
Example 1.6. Set db_update_period parameter
|
|
Example 1.6. Set db_update_period parameter
|
|
@@ -384,7 +386,7 @@ modparam("presence", "db_update_period", 100)
|
|
than 0. When notifier_processes is less than or equal to 0 NOTIFY
|
|
than 0. When notifier_processes is less than or equal to 0 NOTIFY
|
|
requests are sent immediately.
|
|
requests are sent immediately.
|
|
|
|
|
|
- Default value is “5�.
|
|
|
|
|
|
+ Default value is "5".
|
|
|
|
|
|
Example 1.7. Set waitn_time parameter
|
|
Example 1.7. Set waitn_time parameter
|
|
...
|
|
...
|
|
@@ -401,7 +403,7 @@ modparam("presence", "waitn_time", 10)
|
|
Separate notifier processes are only run when subs_db_mode is 3 (DB
|
|
Separate notifier processes are only run when subs_db_mode is 3 (DB
|
|
only mode).
|
|
only mode).
|
|
|
|
|
|
- Default value is “10�.
|
|
|
|
|
|
+ Default value is "10".
|
|
|
|
|
|
Example 1.8. Set notifier_poll_rate parameter
|
|
Example 1.8. Set notifier_poll_rate parameter
|
|
...
|
|
...
|
|
@@ -421,93 +423,107 @@ modparam("presence", "notifier_poll_rate", 20)
|
|
NOTIFY requests can be sent on a dialog at the same time, there are
|
|
NOTIFY requests can be sent on a dialog at the same time, there are
|
|
race conditions which result in CSeq re-use.
|
|
race conditions which result in CSeq re-use.
|
|
|
|
|
|
- Default value is “1�.
|
|
|
|
|
|
+ Default value is "1".
|
|
|
|
|
|
Example 1.9. Set notifier_processes parameter
|
|
Example 1.9. Set notifier_processes parameter
|
|
...
|
|
...
|
|
modparam("presence", "notifier_processes", 2)
|
|
modparam("presence", "notifier_processes", 2)
|
|
...
|
|
...
|
|
|
|
|
|
-3.10. to_tag_pref (str)
|
|
|
|
|
|
+3.10. force_delete (int)
|
|
|
|
+
|
|
|
|
+ Enabling this parameter will delete expired presentity records without
|
|
|
|
+ updating watchers.
|
|
|
|
+
|
|
|
|
+ Set this parameter to "1" to enable.
|
|
|
|
+
|
|
|
|
+ Default value is "0".
|
|
|
|
+
|
|
|
|
+ Example 1.10. Set force_delete parameter
|
|
|
|
+...
|
|
|
|
+modparam("presence", "force_delete", 1)
|
|
|
|
+...
|
|
|
|
+
|
|
|
|
+3.11. to_tag_pref (str)
|
|
|
|
|
|
The prefix used when generating to_tag when sending replies for
|
|
The prefix used when generating to_tag when sending replies for
|
|
SUBSCRIBE requests.
|
|
SUBSCRIBE requests.
|
|
|
|
|
|
- Default value is “10�.
|
|
|
|
|
|
+ Default value is "10".
|
|
|
|
|
|
- Example 1.10. Set to_tag_pref parameter
|
|
|
|
|
|
+ Example 1.11. Set to_tag_pref parameter
|
|
...
|
|
...
|
|
modparam("presence", "to_tag_pref", 'pres')
|
|
modparam("presence", "to_tag_pref", 'pres')
|
|
...
|
|
...
|
|
|
|
|
|
-3.11. expires_offset (int)
|
|
|
|
|
|
+3.12. expires_offset (int)
|
|
|
|
|
|
The value in seconds that should be subtracted from the expires value
|
|
The value in seconds that should be subtracted from the expires value
|
|
when sending a 200OK for a publish. It is used for forcing the client
|
|
when sending a 200OK for a publish. It is used for forcing the client
|
|
to send an update before the old publish expires.
|
|
to send an update before the old publish expires.
|
|
|
|
|
|
- Default value is “0�.
|
|
|
|
|
|
+ Default value is "0".
|
|
|
|
|
|
- Example 1.11. Set expires_offset parameter
|
|
|
|
|
|
+ Example 1.12. Set expires_offset parameter
|
|
...
|
|
...
|
|
modparam("presence", "expires_offset", 10)
|
|
modparam("presence", "expires_offset", 10)
|
|
...
|
|
...
|
|
|
|
|
|
-3.12. max_expires (int)
|
|
|
|
|
|
+3.13. max_expires (int)
|
|
|
|
|
|
The maximum admissible expires value for PUBLISH/SUBSCRIBE message (in
|
|
The maximum admissible expires value for PUBLISH/SUBSCRIBE message (in
|
|
seconds).
|
|
seconds).
|
|
|
|
|
|
- Default value is “3600�.
|
|
|
|
|
|
+ Default value is "3600".
|
|
|
|
|
|
- Example 1.12. Set max_expires parameter
|
|
|
|
|
|
+ Example 1.13. Set max_expires parameter
|
|
...
|
|
...
|
|
modparam("presence", "max_expires", 3600)
|
|
modparam("presence", "max_expires", 3600)
|
|
...
|
|
...
|
|
|
|
|
|
-3.13. min_expires (int)
|
|
|
|
|
|
+3.14. min_expires (int)
|
|
|
|
|
|
The minimum admissible expires value for PUBLISH/SUBSCRIBE message (in
|
|
The minimum admissible expires value for PUBLISH/SUBSCRIBE message (in
|
|
seconds).
|
|
seconds).
|
|
|
|
|
|
If > 0 then min_expires_action parameter determines the response.
|
|
If > 0 then min_expires_action parameter determines the response.
|
|
|
|
|
|
- Default value is “0�.
|
|
|
|
|
|
+ Default value is "0".
|
|
|
|
|
|
- Example 1.13. Set min_expires parameter
|
|
|
|
|
|
+ Example 1.14. Set min_expires parameter
|
|
...
|
|
...
|
|
modparam("presence", "min_expires", 1800)
|
|
modparam("presence", "min_expires", 1800)
|
|
...
|
|
...
|
|
|
|
|
|
-3.14. min_expires_action (int)
|
|
|
|
|
|
+3.15. min_expires_action (int)
|
|
|
|
|
|
The action to take when UA sends a expires value less then min_expires.
|
|
The action to take when UA sends a expires value less then min_expires.
|
|
|
|
|
|
Possible Values
|
|
Possible Values
|
|
- * 1 : RFC Compliant, returns “423 Interval Too Brief�
|
|
|
|
|
|
+ * 1 : RFC Compliant, returns "423 Interval Too Brief"
|
|
* 2 : forces the min_expires value in the subscription
|
|
* 2 : forces the min_expires value in the subscription
|
|
|
|
|
|
If > 0 then min_expires_action parameter determines the response.
|
|
If > 0 then min_expires_action parameter determines the response.
|
|
|
|
|
|
- Default value is “1�.
|
|
|
|
|
|
+ Default value is "1".
|
|
|
|
|
|
- Example 1.14. Set min_expires parameter
|
|
|
|
|
|
+ Example 1.15. Set min_expires parameter
|
|
...
|
|
...
|
|
modparam("presence", "min_expires", 1800)
|
|
modparam("presence", "min_expires", 1800)
|
|
...
|
|
...
|
|
|
|
|
|
-3.15. server_address (str)
|
|
|
|
|
|
+3.16. server_address (str)
|
|
|
|
|
|
The presence server address which will become the value of Contact
|
|
The presence server address which will become the value of Contact
|
|
header filed for 200 OK replies to SUBSCRIBE and PUBLISH and in NOTIFY
|
|
header filed for 200 OK replies to SUBSCRIBE and PUBLISH and in NOTIFY
|
|
messages.
|
|
messages.
|
|
|
|
|
|
- Example 1.15. Set server_address parameter
|
|
|
|
|
|
+ Example 1.16. Set server_address parameter
|
|
...
|
|
...
|
|
modparam("presence", "server_address", "sip:10.10.10.10:5060")
|
|
modparam("presence", "server_address", "sip:10.10.10.10:5060")
|
|
...
|
|
...
|
|
|
|
|
|
-3.16. subs_db_mode (int)
|
|
|
|
|
|
+3.17. subs_db_mode (int)
|
|
|
|
|
|
The presence module can utilize database for persistent subscription
|
|
The presence module can utilize database for persistent subscription
|
|
storage. If you use database, your subscriptions will survive machine
|
|
storage. If you use database, your subscriptions will survive machine
|
|
@@ -541,12 +557,12 @@ modparam("presence", "server_address", "sip:10.10.10.10:5060")
|
|
|
|
|
|
Default value is 2 (Write-Back scheme).
|
|
Default value is 2 (Write-Back scheme).
|
|
|
|
|
|
- Example 1.16. Set subs_db_mode parameter
|
|
|
|
|
|
+ Example 1.17. Set subs_db_mode parameter
|
|
...
|
|
...
|
|
modparam("presence", "subs_db_mode", 1)
|
|
modparam("presence", "subs_db_mode", 1)
|
|
...
|
|
...
|
|
|
|
|
|
-3.17. publ_cache (int)
|
|
|
|
|
|
+3.18. publ_cache (int)
|
|
|
|
|
|
To improve performance, the presence module holds by default a publish
|
|
To improve performance, the presence module holds by default a publish
|
|
cache that says if a certain publication exists in database. This is
|
|
cache that says if a certain publication exists in database. This is
|
|
@@ -560,39 +576,39 @@ modparam("presence", "subs_db_mode", 1)
|
|
database or there are other external entities inserting data into the
|
|
database or there are other external entities inserting data into the
|
|
presentity table.
|
|
presentity table.
|
|
|
|
|
|
- Default value is “1�.
|
|
|
|
|
|
+ Default value is "1".
|
|
|
|
|
|
- Example 1.17. Set publ_cache parameter
|
|
|
|
|
|
+ Example 1.18. Set publ_cache parameter
|
|
...
|
|
...
|
|
modparam("presence", "publ_cache", 0)
|
|
modparam("presence", "publ_cache", 0)
|
|
...
|
|
...
|
|
|
|
|
|
-3.18. subs_htable_size (int)
|
|
|
|
|
|
+3.19. subs_htable_size (int)
|
|
|
|
|
|
The size of the in-memory hash table to store subscription dialogs.
|
|
The size of the in-memory hash table to store subscription dialogs.
|
|
This parameter will be used as the power of 2 when computing table
|
|
This parameter will be used as the power of 2 when computing table
|
|
size.
|
|
size.
|
|
|
|
|
|
- Default value is “9 (512)�.
|
|
|
|
|
|
+ Default value is "9 (512)".
|
|
|
|
|
|
- Example 1.18. Set subs_htable_size parameter
|
|
|
|
|
|
+ Example 1.19. Set subs_htable_size parameter
|
|
...
|
|
...
|
|
modparam("presence", "subs_htable_size", 11)
|
|
modparam("presence", "subs_htable_size", 11)
|
|
...
|
|
...
|
|
|
|
|
|
-3.19. pres_htable_size (int)
|
|
|
|
|
|
+3.20. pres_htable_size (int)
|
|
|
|
|
|
The size of the in-memory hash table to store publish records. This
|
|
The size of the in-memory hash table to store publish records. This
|
|
parameter will be used as the power of 2 when computing table size.
|
|
parameter will be used as the power of 2 when computing table size.
|
|
|
|
|
|
- Default value is “9 (512)�.
|
|
|
|
|
|
+ Default value is "9 (512)".
|
|
|
|
|
|
- Example 1.19. Set pres_htable_size parameter
|
|
|
|
|
|
+ Example 1.20. Set pres_htable_size parameter
|
|
...
|
|
...
|
|
modparam("presence", "pres_htable_size", 11)
|
|
modparam("presence", "pres_htable_size", 11)
|
|
...
|
|
...
|
|
|
|
|
|
-3.20. send_fast_notify (int)
|
|
|
|
|
|
+3.21. send_fast_notify (int)
|
|
|
|
|
|
This parameter enables or disables the sending of an initial empty
|
|
This parameter enables or disables the sending of an initial empty
|
|
NOTIFY after a SUBSCRIBE/reSUBSCRIBE. This caused problems for MWI
|
|
NOTIFY after a SUBSCRIBE/reSUBSCRIBE. This caused problems for MWI
|
|
@@ -600,14 +616,14 @@ modparam("presence", "pres_htable_size", 11)
|
|
empty NOTIFY to an message-summary event. This parameter is enabled by
|
|
empty NOTIFY to an message-summary event. This parameter is enabled by
|
|
default, thus addering to the standard.
|
|
default, thus addering to the standard.
|
|
|
|
|
|
- Default value is “1 �.
|
|
|
|
|
|
+ Default value is "1 ".
|
|
|
|
|
|
- Example 1.20. Set send_fast_notify parameter
|
|
|
|
|
|
+ Example 1.21. Set send_fast_notify parameter
|
|
...
|
|
...
|
|
modparam("presence", "send_fast_notify", 0)
|
|
modparam("presence", "send_fast_notify", 0)
|
|
...
|
|
...
|
|
|
|
|
|
-3.21. enable_sphere_check (int)
|
|
|
|
|
|
+3.22. enable_sphere_check (int)
|
|
|
|
|
|
This parameter is a flag that should be set if permission rules include
|
|
This parameter is a flag that should be set if permission rules include
|
|
sphere checking. The sphere information is expected to be present in
|
|
sphere checking. The sphere information is expected to be present in
|
|
@@ -615,14 +631,14 @@ modparam("presence", "send_fast_notify", 0)
|
|
this check requires extra processing that should be avoided if this
|
|
this check requires extra processing that should be avoided if this
|
|
feature is not supported by the clients.
|
|
feature is not supported by the clients.
|
|
|
|
|
|
- Default value is “0 �.
|
|
|
|
|
|
+ Default value is "0 ".
|
|
|
|
|
|
- Example 1.21. Set enable_sphere_check parameter
|
|
|
|
|
|
+ Example 1.22. Set enable_sphere_check parameter
|
|
...
|
|
...
|
|
modparam("presence", "enable_sphere_check", 1)
|
|
modparam("presence", "enable_sphere_check", 1)
|
|
...
|
|
...
|
|
|
|
|
|
-3.22. timeout_rm_subs (int)
|
|
|
|
|
|
+3.23. timeout_rm_subs (int)
|
|
|
|
|
|
This parameter is a flag that should be set if subscriptions should be
|
|
This parameter is a flag that should be set if subscriptions should be
|
|
removed from the active_watchers when a NOTIFY times out. RFC3265
|
|
removed from the active_watchers when a NOTIFY times out. RFC3265
|
|
@@ -630,25 +646,25 @@ modparam("presence", "enable_sphere_check", 1)
|
|
on. Disabling this will keep subscriptions active on unreliable
|
|
on. Disabling this will keep subscriptions active on unreliable
|
|
networks.
|
|
networks.
|
|
|
|
|
|
- Default value is “1�.
|
|
|
|
|
|
+ Default value is "1".
|
|
|
|
|
|
- Example 1.22. Set timeout_rm_subs parameter
|
|
|
|
|
|
+ Example 1.23. Set timeout_rm_subs parameter
|
|
...
|
|
...
|
|
modparam("presence", "timeout_rm_subs", 0)
|
|
modparam("presence", "timeout_rm_subs", 0)
|
|
...
|
|
...
|
|
|
|
|
|
-3.23. fetch_rows (integer)
|
|
|
|
|
|
+3.24. fetch_rows (integer)
|
|
|
|
|
|
Number of rows to be loaded in one step from database.
|
|
Number of rows to be loaded in one step from database.
|
|
|
|
|
|
Default value is 500.
|
|
Default value is 500.
|
|
|
|
|
|
- Example 1.23. Set fetch_rows parameter
|
|
|
|
|
|
+ Example 1.24. Set fetch_rows parameter
|
|
...
|
|
...
|
|
modparam("presence", "fetch_rows", 1000)
|
|
modparam("presence", "fetch_rows", 1000)
|
|
...
|
|
...
|
|
|
|
|
|
-3.24. db_table_lock_type (integer)
|
|
|
|
|
|
+3.25. db_table_lock_type (integer)
|
|
|
|
|
|
Enable (=1) or disable (=0) the Locks for table during an transaction.
|
|
Enable (=1) or disable (=0) the Locks for table during an transaction.
|
|
Locking only the "current" table causes problems with a MySQL-Databases
|
|
Locking only the "current" table causes problems with a MySQL-Databases
|
|
@@ -661,23 +677,23 @@ modparam("presence", "fetch_rows", 1000)
|
|
|
|
|
|
Default value is 1 (Write Lock for the Tables).
|
|
Default value is 1 (Write Lock for the Tables).
|
|
|
|
|
|
- Example 1.24. Set db_table_lock_type parameter
|
|
|
|
|
|
+ Example 1.25. Set db_table_lock_type parameter
|
|
...
|
|
...
|
|
modparam("presence", "db_table_lock_type", 0)
|
|
modparam("presence", "db_table_lock_type", 0)
|
|
...
|
|
...
|
|
|
|
|
|
-3.25. local_log_level (int)
|
|
|
|
|
|
+3.26. local_log_level (int)
|
|
|
|
|
|
Control log level for some debug messages inside the module.
|
|
Control log level for some debug messages inside the module.
|
|
|
|
|
|
Default value is 2 (L_INFO).
|
|
Default value is 2 (L_INFO).
|
|
|
|
|
|
- Example 1.25. Set local_log_level parameter
|
|
|
|
|
|
+ Example 1.26. Set local_log_level parameter
|
|
...
|
|
...
|
|
modparam("presence", "local_log_level", 3)
|
|
modparam("presence", "local_log_level", 3)
|
|
...
|
|
...
|
|
|
|
|
|
-3.26. subs_remove_match (int)
|
|
|
|
|
|
+3.27. subs_remove_match (int)
|
|
|
|
|
|
Control how to match the subscriptions to remove from memory. If set to
|
|
Control how to match the subscriptions to remove from memory. If set to
|
|
0, then the match is done on To-Tag (local generated), if set to 1,
|
|
0, then the match is done on To-Tag (local generated), if set to 1,
|
|
@@ -686,12 +702,12 @@ modparam("presence", "local_log_level", 3)
|
|
|
|
|
|
Default value is 0.
|
|
Default value is 0.
|
|
|
|
|
|
- Example 1.26. Set subs_remove_match parameter
|
|
|
|
|
|
+ Example 1.27. Set subs_remove_match parameter
|
|
...
|
|
...
|
|
modparam("presence", "subs_remove_match", 1)
|
|
modparam("presence", "subs_remove_match", 1)
|
|
...
|
|
...
|
|
|
|
|
|
-3.27. xavp_cfg (str)
|
|
|
|
|
|
+3.28. xavp_cfg (str)
|
|
|
|
|
|
The name of the xavp to be used to specify attributes for internal
|
|
The name of the xavp to be used to specify attributes for internal
|
|
processing of presence module.
|
|
processing of presence module.
|
|
@@ -707,7 +723,7 @@ modparam("presence", "subs_remove_match", 1)
|
|
|
|
|
|
Default value is empty (not set).
|
|
Default value is empty (not set).
|
|
|
|
|
|
- Example 1.27. Set xavp_cfg parameter
|
|
|
|
|
|
+ Example 1.28. Set xavp_cfg parameter
|
|
...
|
|
...
|
|
modparam("presence", "xavp_cfg", "pres")
|
|
modparam("presence", "xavp_cfg", "pres")
|
|
...
|
|
...
|
|
@@ -716,19 +732,19 @@ if(is_method("PUBLISH")) {
|
|
}
|
|
}
|
|
...
|
|
...
|
|
|
|
|
|
-3.28. retrieve_order (int)
|
|
|
|
|
|
+3.29. retrieve_order (int)
|
|
|
|
|
|
If set to 0, presentity records are retrieve by received_time order. if
|
|
If set to 0, presentity records are retrieve by received_time order. if
|
|
set to 1, presentity records are retrieve by priority order.
|
|
set to 1, presentity records are retrieve by priority order.
|
|
|
|
|
|
Default value is 0.
|
|
Default value is 0.
|
|
|
|
|
|
- Example 1.28. Set retrieve_order parameter
|
|
|
|
|
|
+ Example 1.29. Set retrieve_order parameter
|
|
...
|
|
...
|
|
modparam("presence", "retrieve_order", 1)
|
|
modparam("presence", "retrieve_order", 1)
|
|
...
|
|
...
|
|
|
|
|
|
-3.29. sip_uri_match (int)
|
|
|
|
|
|
+3.30. sip_uri_match (int)
|
|
|
|
|
|
The mode used when comparing uris.
|
|
The mode used when comparing uris.
|
|
|
|
|
|
@@ -736,9 +752,9 @@ modparam("presence", "retrieve_order", 1)
|
|
* 0 : case sensitive
|
|
* 0 : case sensitive
|
|
* 1 : case insensitive
|
|
* 1 : case insensitive
|
|
|
|
|
|
- Default value is “0�.
|
|
|
|
|
|
+ Default value is "0".
|
|
|
|
|
|
- Example 1.29. Set sip_uri_match parameter
|
|
|
|
|
|
+ Example 1.30. Set sip_uri_match parameter
|
|
...
|
|
...
|
|
modparam("presence", "sip_uri_match", 1)
|
|
modparam("presence", "sip_uri_match", 1)
|
|
...
|
|
...
|
|
@@ -751,7 +767,7 @@ modparam("presence", "retrieve_order", 1)
|
|
4.4. pres_refresh_watchers(uri, event, type[, file_uri, filename])
|
|
4.4. pres_refresh_watchers(uri, event, type[, file_uri, filename])
|
|
4.5. pres_update_watchers(uri, event)
|
|
4.5. pres_update_watchers(uri, event)
|
|
|
|
|
|
-4.1. handle_publish([sender_uri])
|
|
|
|
|
|
+4.1. handle_publish([sender_uri])
|
|
|
|
|
|
Handles PUBLISH requests by storing and updating published information
|
|
Handles PUBLISH requests by storing and updating published information
|
|
in memory cache and database, then calls functions to send NOTIFY
|
|
in memory cache and database, then calls functions to send NOTIFY
|
|
@@ -771,7 +787,7 @@ modparam("presence", "retrieve_order", 1)
|
|
|
|
|
|
The module sends an appropriate stateless reply in all cases.
|
|
The module sends an appropriate stateless reply in all cases.
|
|
|
|
|
|
- Example 1.30. handle_publish usage
|
|
|
|
|
|
+ Example 1.31. handle_publish usage
|
|
...
|
|
...
|
|
if(is_method("PUBLISH"))
|
|
if(is_method("PUBLISH"))
|
|
{
|
|
{
|
|
@@ -783,7 +799,7 @@ modparam("presence", "retrieve_order", 1)
|
|
}
|
|
}
|
|
...
|
|
...
|
|
|
|
|
|
-4.2. handle_subscribe([watcher_uri])
|
|
|
|
|
|
+4.2. handle_subscribe([watcher_uri])
|
|
|
|
|
|
The function which handles SUBSCRIBE requests. It stores or updates
|
|
The function which handles SUBSCRIBE requests. It stores or updates
|
|
information in memory and database and calls functions to send NOTIFY
|
|
information in memory and database and calls functions to send NOTIFY
|
|
@@ -802,13 +818,13 @@ modparam("presence", "retrieve_order", 1)
|
|
|
|
|
|
The module sends an appropriate stateless reply in all cases.
|
|
The module sends an appropriate stateless reply in all cases.
|
|
|
|
|
|
- Example 1.31. handle_subscribe usage
|
|
|
|
|
|
+ Example 1.32. handle_subscribe usage
|
|
...
|
|
...
|
|
if(method=="SUBSCRIBE")
|
|
if(method=="SUBSCRIBE")
|
|
handle_subscribe();
|
|
handle_subscribe();
|
|
...
|
|
...
|
|
|
|
|
|
-4.3. pres_auth_status(watcher_uri, presentity_uri)
|
|
|
|
|
|
+4.3. pres_auth_status(watcher_uri, presentity_uri)
|
|
|
|
|
|
The function checks if watcher is authorized to subscribe event
|
|
The function checks if watcher is authorized to subscribe event
|
|
'presence' of presentity. Both watcher_uri and presentity_uri are
|
|
'presence' of presentity. Both watcher_uri and presentity_uri are
|
|
@@ -819,7 +835,7 @@ if(method=="SUBSCRIBE")
|
|
|
|
|
|
This function can be used from REQUEST_ROUTE.
|
|
This function can be used from REQUEST_ROUTE.
|
|
|
|
|
|
- Example 1.32. pres_auth_status usage
|
|
|
|
|
|
+ Example 1.33. pres_auth_status usage
|
|
...
|
|
...
|
|
if (method=="MESSAGE") {
|
|
if (method=="MESSAGE") {
|
|
pres_auth_status("$fu", $ru");
|
|
pres_auth_status("$fu", $ru");
|
|
@@ -831,7 +847,7 @@ if (method=="MESSAGE") {
|
|
}
|
|
}
|
|
...
|
|
...
|
|
|
|
|
|
-4.4. pres_refresh_watchers(uri, event, type[, file_uri, filename])
|
|
|
|
|
|
+4.4. pres_refresh_watchers(uri, event, type[, file_uri, filename])
|
|
|
|
|
|
The function can be used in configuration to triger notifies to
|
|
The function can be used in configuration to triger notifies to
|
|
watchers if a change in watchers authorization or in published state
|
|
watchers if a change in watchers authorization or in published state
|
|
@@ -855,12 +871,12 @@ if (method=="MESSAGE") {
|
|
|
|
|
|
This function can be used from ANY_ROUTE.
|
|
This function can be used from ANY_ROUTE.
|
|
|
|
|
|
- Example 1.33. pres_refresh_watchers usage
|
|
|
|
|
|
+ Example 1.34. pres_refresh_watchers usage
|
|
...
|
|
...
|
|
pres_refresh_watchers("sip:[email protected]", "presence", 1);
|
|
pres_refresh_watchers("sip:[email protected]", "presence", 1);
|
|
...
|
|
...
|
|
|
|
|
|
-4.5. pres_update_watchers(uri, event)
|
|
|
|
|
|
+4.5. pres_update_watchers(uri, event)
|
|
|
|
|
|
The function can be used in configuration to triger updates to watchers
|
|
The function can be used in configuration to triger updates to watchers
|
|
status if a change in watchers authorization state occurred (i.e.,
|
|
status if a change in watchers authorization state occurred (i.e.,
|
|
@@ -873,7 +889,7 @@ pres_refresh_watchers("sip:[email protected]", "presence", 1);
|
|
|
|
|
|
This function can be used from ANY_ROUTE.
|
|
This function can be used from ANY_ROUTE.
|
|
|
|
|
|
- Example 1.34. pres_update_watchers usage
|
|
|
|
|
|
+ Example 1.35. pres_update_watchers usage
|
|
...
|
|
...
|
|
pres_update_watchers("sip:[email protected]", "presence");
|
|
pres_update_watchers("sip:[email protected]", "presence");
|
|
...
|
|
...
|
|
@@ -883,7 +899,7 @@ pres_update_watchers("sip:[email protected]", "presence");
|
|
5.1. refreshWatchers
|
|
5.1. refreshWatchers
|
|
5.2. cleanup
|
|
5.2. cleanup
|
|
|
|
|
|
-5.1. refreshWatchers
|
|
|
|
|
|
+5.1. refreshWatchers
|
|
|
|
|
|
Triggers sending Notify messages to watchers if a change in watchers
|
|
Triggers sending Notify messages to watchers if a change in watchers
|
|
authorization or in published state occurred.
|
|
authorization or in published state occurred.
|
|
@@ -913,7 +929,7 @@ pres_update_watchers("sip:[email protected]", "presence");
|
|
1
|
|
1
|
|
_empty_line_
|
|
_empty_line_
|
|
|
|
|
|
-5.2. cleanup
|
|
|
|
|
|
+5.2. cleanup
|
|
|
|
|
|
Manually triggers the cleanup functions for the active_watchers,
|
|
Manually triggers the cleanup functions for the active_watchers,
|
|
presentity, and watchers tables. Useful if you have set clean_period
|
|
presentity, and watchers tables. Useful if you have set clean_period
|
|
@@ -931,7 +947,7 @@ pres_update_watchers("sip:[email protected]", "presence");
|
|
|
|
|
|
6.1. presence.cleanup
|
|
6.1. presence.cleanup
|
|
|
|
|
|
-6.1. presence.cleanup
|
|
|
|
|
|
+6.1. presence.cleanup
|
|
|
|
|
|
Manually triggers the cleanup functions for the active_watchers,
|
|
Manually triggers the cleanup functions for the active_watchers,
|
|
presentity, and watchers tables. Useful if you have set clean_period
|
|
presentity, and watchers tables. Useful if you have set clean_period
|
|
@@ -949,11 +965,11 @@ pres_update_watchers("sip:[email protected]", "presence");
|
|
7.1. $subs(attr)
|
|
7.1. $subs(attr)
|
|
|
|
|
|
Access the attributes of handled subscription. It must be used after a
|
|
Access the attributes of handled subscription. It must be used after a
|
|
- successful call of “handle_subscription()� or in the following events.
|
|
|
|
|
|
+ successful call of "handle_subscription()" or in the following events.
|
|
* tm:local-request - before notify is sent
|
|
* tm:local-request - before notify is sent
|
|
* present:notify-reply - after notify is sent
|
|
* present:notify-reply - after notify is sent
|
|
|
|
|
|
- The “attr� can be:
|
|
|
|
|
|
+ The "attr" can be:
|
|
* uri - subscription presentity uri
|
|
* uri - subscription presentity uri
|
|
* pres_uri - alias for presentity uri
|
|
* pres_uri - alias for presentity uri
|
|
* to_user
|
|
* to_user
|
|
@@ -979,7 +995,7 @@ pres_update_watchers("sip:[email protected]", "presence");
|
|
* flags
|
|
* flags
|
|
* user_agent
|
|
* user_agent
|
|
|
|
|
|
- Example 1.35. $subs(name) usage
|
|
|
|
|
|
+ Example 1.36. $subs(name) usage
|
|
...
|
|
...
|
|
if(handle_subscription())
|
|
if(handle_subscription())
|
|
{
|
|
{
|
|
@@ -993,9 +1009,9 @@ if(handle_subscription())
|
|
used in the following events.
|
|
used in the following events.
|
|
* present:notify-reply - after notify is sent
|
|
* present:notify-reply - after notify is sent
|
|
|
|
|
|
- The “attr� can be any pseudo var that accesses attributes of msg
|
|
|
|
|
|
+ The "attr" can be any pseudo var that accesses attributes of msg
|
|
|
|
|
|
- Example 1.36. $notify_reply(name) usage
|
|
|
|
|
|
+ Example 1.37. $notify_reply(name) usage
|
|
...
|
|
...
|
|
event_route[presence:notify-reply]
|
|
event_route[presence:notify-reply]
|
|
{
|
|
{
|
|
@@ -1011,7 +1027,7 @@ event_route[presence:notify-reply]
|
|
|
|
|
|
Fired after notify reply is received or timeout.
|
|
Fired after notify reply is received or timeout.
|
|
|
|
|
|
- Example 1.37. $notify_reply(name) usage
|
|
|
|
|
|
+ Example 1.38. $notify_reply(name) usage
|
|
...
|
|
...
|
|
event_route[presence:notify-reply]
|
|
event_route[presence:notify-reply]
|
|
{
|
|
{
|
|
@@ -1053,7 +1069,7 @@ Chapter 2. Developer Guide
|
|
The module provides the following functions that can be used in other
|
|
The module provides the following functions that can be used in other
|
|
Kamailio modules.
|
|
Kamailio modules.
|
|
|
|
|
|
-1. bind_presence(presence_api_t* api)
|
|
|
|
|
|
+1. bind_presence(presence_api_t* api)
|
|
|
|
|
|
This function binds the presence modules and fills the structure with
|
|
This function binds the presence modules and fills the structure with
|
|
one exported function -> add_event, which when called adds a new event
|
|
one exported function -> add_event, which when called adds a new event
|
|
@@ -1089,7 +1105,7 @@ typedef struct presence_api {
|
|
}presence_api_t;
|
|
}presence_api_t;
|
|
...
|
|
...
|
|
|
|
|
|
-2. add_event
|
|
|
|
|
|
+2. add_event
|
|
|
|
|
|
Field type:
|
|
Field type:
|
|
...
|
|
...
|
|
@@ -1132,17 +1148,16 @@ typedef struct pres_ev
|
|
free_body_t* free_body;
|
|
free_body_t* free_body;
|
|
/* sometimes it is necessary that a module make changes for a body for each
|
|
/* sometimes it is necessary that a module make changes for a body for each
|
|
* active watcher (e.g. setting the "version" parameter in an XML document.
|
|
* active watcher (e.g. setting the "version" parameter in an XML document.
|
|
- * If a module registers the aux_body_processing callback, it gets called f
|
|
|
|
-or
|
|
|
|
- * each watcher. It either gets the body received by the PUBLISH, or the bo
|
|
|
|
-dy
|
|
|
|
|
|
+ * If a module registers the aux_body_processing callback, it gets called fo
|
|
|
|
+r
|
|
|
|
+ * each watcher. It either gets the body received by the PUBLISH, or the bod
|
|
|
|
+y
|
|
* generated by the agg_nbody function.
|
|
* generated by the agg_nbody function.
|
|
* The module can deceide if it makes a copy of the original body, which is
|
|
* The module can deceide if it makes a copy of the original body, which is
|
|
- then
|
|
|
|
|
|
+then
|
|
* manipulated, or if it works directly in the original body. If the module
|
|
* manipulated, or if it works directly in the original body. If the module
|
|
- makes a
|
|
|
|
- * copy of the original body, it also has to register the aux_free_body() t
|
|
|
|
-o
|
|
|
|
|
|
+makes a
|
|
|
|
+ * copy of the original body, it also has to register the aux_free_body() to
|
|
* free this "per watcher" body.
|
|
* free this "per watcher" body.
|
|
*/
|
|
*/
|
|
aux_body_processing_t* aux_body_processing;
|
|
aux_body_processing_t* aux_body_processing;
|
|
@@ -1153,7 +1168,7 @@ o
|
|
}pres_ev_t;
|
|
}pres_ev_t;
|
|
...
|
|
...
|
|
|
|
|
|
-3. get_rules_doc
|
|
|
|
|
|
+3. get_rules_doc
|
|
|
|
|
|
Filed type:
|
|
Filed type:
|
|
...
|
|
...
|
|
@@ -1166,7 +1181,7 @@ typedef int (get_rules_doc_t)(str* user, str* domain, str** rules_doc);
|
|
auth_rules_doc of the subs_t structure given as a parameter to the
|
|
auth_rules_doc of the subs_t structure given as a parameter to the
|
|
functions described bellow.
|
|
functions described bellow.
|
|
|
|
|
|
-4. get_auth_status
|
|
|
|
|
|
+4. get_auth_status
|
|
|
|
|
|
This filed is a function to be called for a subscription request to
|
|
This filed is a function to be called for a subscription request to
|
|
return the state for that subscription according to authorization
|
|
return the state for that subscription according to authorization
|
|
@@ -1181,7 +1196,7 @@ typedef int (get_rules_doc_t)(str* user, str* domain, str** rules_doc);
|
|
typedef int (is_allowed_t)(struct subscription* subs);
|
|
typedef int (is_allowed_t)(struct subscription* subs);
|
|
...
|
|
...
|
|
|
|
|
|
-5. apply_auth_nbody
|
|
|
|
|
|
+5. apply_auth_nbody
|
|
|
|
|
|
This parameter should be a function to be called for an event that
|
|
This parameter should be a function to be called for an event that
|
|
requires authorization, when constructing final body. The authorization
|
|
requires authorization, when constructing final body. The authorization
|
|
@@ -1193,7 +1208,7 @@ typedef int (is_allowed_t)(struct subscription* subs);
|
|
typedef int (apply_auth_t)(str* , struct subscription*, str** );
|
|
typedef int (apply_auth_t)(str* , struct subscription*, str** );
|
|
...
|
|
...
|
|
|
|
|
|
-6. agg_nbody
|
|
|
|
|
|
+6. agg_nbody
|
|
|
|
|
|
If present, this field marks that the events requires aggregation of
|
|
If present, this field marks that the events requires aggregation of
|
|
states. This function receives a body array and should return the final
|
|
states. This function receives a body array and should return the final
|
|
@@ -1207,7 +1222,7 @@ typedef str* (agg_nbody_t)(str* pres_user, str* pres_domain,
|
|
str** body_array, int n, int off_index);
|
|
str** body_array, int n, int off_index);
|
|
..
|
|
..
|
|
|
|
|
|
-7. free_body
|
|
|
|
|
|
+7. free_body
|
|
|
|
|
|
This field must be field in if subsequent processing is performed on
|
|
This field must be field in if subsequent processing is performed on
|
|
the info from database before being inserted in Notify message body(if
|
|
the info from database before being inserted in Notify message body(if
|
|
@@ -1219,7 +1234,7 @@ str** body_array, int n, int off_index);
|
|
typedef void(free_body_t)(char* body);
|
|
typedef void(free_body_t)(char* body);
|
|
..
|
|
..
|
|
|
|
|
|
-8. aux_body_processing
|
|
|
|
|
|
+8. aux_body_processing
|
|
|
|
|
|
This field must be set if the module needs to manipulate the NOTIFY
|
|
This field must be set if the module needs to manipulate the NOTIFY
|
|
body for each watcher. E.g. if the XML body includes a 'version'
|
|
body for each watcher. E.g. if the XML body includes a 'version'
|
|
@@ -1233,7 +1248,7 @@ typedef void(free_body_t)(char* body);
|
|
typedef str* (aux_body_processing_t)(struct subscription *subs, str* body);
|
|
typedef str* (aux_body_processing_t)(struct subscription *subs, str* body);
|
|
..
|
|
..
|
|
|
|
|
|
-9. aux_free_body
|
|
|
|
|
|
+9. aux_free_body
|
|
|
|
|
|
This field must be set if the module registers the aux_body_processing
|
|
This field must be set if the module registers the aux_body_processing
|
|
function and allocates memory for the new modified body. Then, this
|
|
function and allocates memory for the new modified body. Then, this
|
|
@@ -1248,7 +1263,7 @@ typedef str* (aux_body_processing_t)(struct subscription *subs, str* body);
|
|
typedef void(free_body_t)(char* body);
|
|
typedef void(free_body_t)(char* body);
|
|
..
|
|
..
|
|
|
|
|
|
-10. evs_publ_handl
|
|
|
|
|
|
+10. evs_publ_handl
|
|
|
|
|
|
This function is called when handling Publish requests. Most contain
|
|
This function is called when handling Publish requests. Most contain
|
|
body correctness check.
|
|
body correctness check.
|
|
@@ -1257,7 +1272,7 @@ typedef void(free_body_t)(char* body);
|
|
typedef int (publ_handling_t)(struct sip_msg*);
|
|
typedef int (publ_handling_t)(struct sip_msg*);
|
|
..
|
|
..
|
|
|
|
|
|
-11. evs_subs_handl
|
|
|
|
|
|
+11. evs_subs_handl
|
|
|
|
|
|
It is not compulsory. Should contain event specific handling for
|
|
It is not compulsory. Should contain event specific handling for
|
|
Subscription requests.
|
|
Subscription requests.
|
|
@@ -1267,7 +1282,7 @@ typedef int (publ_handling_t)(struct sip_msg*);
|
|
typedef int (subs_handling_t)(struct sip_msg*);
|
|
typedef int (subs_handling_t)(struct sip_msg*);
|
|
..
|
|
..
|
|
|
|
|
|
-12. contains_event
|
|
|
|
|
|
+12. contains_event
|
|
|
|
|
|
Field type:
|
|
Field type:
|
|
..
|
|
..
|
|
@@ -1280,7 +1295,7 @@ event_t* parsed_event);
|
|
found. If the second argument is an allocated event_t* structure it
|
|
found. If the second argument is an allocated event_t* structure it
|
|
fills it with the result of the parsing.
|
|
fills it with the result of the parsing.
|
|
|
|
|
|
-13. get_event_list
|
|
|
|
|
|
+13. get_event_list
|
|
|
|
|
|
Field type:
|
|
Field type:
|
|
...
|
|
...
|
|
@@ -1290,7 +1305,7 @@ typedef int (*get_event_list_t) (str** ev_list);
|
|
This function returns a string representation of the events registered
|
|
This function returns a string representation of the events registered
|
|
in presence module.( used for Allowed-Events header).
|
|
in presence module.( used for Allowed-Events header).
|
|
|
|
|
|
-14. update_watchers_status
|
|
|
|
|
|
+14. update_watchers_status
|
|
|
|
|
|
Field type:
|
|
Field type:
|
|
...
|
|
...
|
|
@@ -1304,7 +1319,7 @@ str* rules_doc);
|
|
(used by presence_xml module when notified through an MI command of a
|
|
(used by presence_xml module when notified through an MI command of a
|
|
change in an xcap document).
|
|
change in an xcap document).
|
|
|
|
|
|
-15. get_sphere
|
|
|
|
|
|
+15. get_sphere
|
|
|
|
|
|
Field type:
|
|
Field type:
|
|
...
|
|
...
|
|
@@ -1315,12 +1330,12 @@ typedef char* (*pres_get_sphere_t)(str* pres_uri);
|
|
information if this has type RPID. If not found returns NULL. (the
|
|
information if this has type RPID. If not found returns NULL. (the
|
|
return value is allocated in private memory and should be freed)
|
|
return value is allocated in private memory and should be freed)
|
|
|
|
|
|
-16. get_presentity
|
|
|
|
|
|
+16. get_presentity
|
|
|
|
|
|
Field type:
|
|
Field type:
|
|
...
|
|
...
|
|
-typedef str* (*pres_get_presentity_t)(str pres_uri, pres_ev_t *ev, str *etag, s
|
|
|
|
-tr *contact);
|
|
|
|
|
|
+typedef str* (*pres_get_presentity_t)(str pres_uri, pres_ev_t *ev, str *etag, st
|
|
|
|
+r *contact);
|
|
...
|
|
...
|
|
|
|
|
|
This function returns a pointer to a str containing an XML document
|
|
This function returns a pointer to a str containing an XML document
|
|
@@ -1331,7 +1346,7 @@ tr *contact);
|
|
Once you are finished with the presentity document you must call
|
|
Once you are finished with the presentity document you must call
|
|
free_presentity to free the allocated memory.
|
|
free_presentity to free the allocated memory.
|
|
|
|
|
|
-17. free_presentity
|
|
|
|
|
|
+17. free_presentity
|
|
|
|
|
|
Field type:
|
|
Field type:
|
|
...
|
|
...
|