|
@@ -16,9 +16,9 @@ Edited by
|
|
|
|
|
|
Juha Heinanen
|
|
|
|
|
|
- Copyright © 2006 Voice Sistem SRL
|
|
|
+ Copyright © 2006 Voice Sistem SRL
|
|
|
|
|
|
- Copyright © 2009 Juha Heinanen
|
|
|
+ Copyright © 2009 Juha Heinanen
|
|
|
__________________________________________________________________
|
|
|
|
|
|
Table of Contents
|
|
@@ -61,6 +61,7 @@ Juha Heinanen
|
|
|
3.26. subs_remove_match (int)
|
|
|
3.27. xavp_cfg (str)
|
|
|
3.28. retrieve_order (int)
|
|
|
+ 3.29. sip_uri_match (int)
|
|
|
|
|
|
4. Functions
|
|
|
|
|
@@ -81,7 +82,16 @@ Juha Heinanen
|
|
|
|
|
|
6.1. presence.cleanup
|
|
|
|
|
|
- 7. Installation
|
|
|
+ 7. Pseudo Variables
|
|
|
+
|
|
|
+ 7.1. $subs(attr)
|
|
|
+ 7.2. $notify_reply(attr)
|
|
|
+
|
|
|
+ 8. Events
|
|
|
+
|
|
|
+ 8.1. present:notify-reply
|
|
|
+
|
|
|
+ 9. Installation
|
|
|
|
|
|
2. Developer Guide
|
|
|
|
|
@@ -133,11 +143,15 @@ Juha Heinanen
|
|
|
1.26. Set subs_remove_match parameter
|
|
|
1.27. Set xavp_cfg parameter
|
|
|
1.28. Set retrieve_order parameter
|
|
|
- 1.29. handle_publish usage
|
|
|
- 1.30. handle_subscribe usage
|
|
|
- 1.31. pres_auth_status usage
|
|
|
- 1.32. pres_refresh_watchers usage
|
|
|
- 1.33. pres_update_watchers usage
|
|
|
+ 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.37. $notify_reply(name) usage
|
|
|
2.1. presence_api_t structure
|
|
|
|
|
|
Chapter 1. Admin Guide
|
|
@@ -180,6 +194,7 @@ Chapter 1. Admin Guide
|
|
|
3.26. subs_remove_match (int)
|
|
|
3.27. xavp_cfg (str)
|
|
|
3.28. retrieve_order (int)
|
|
|
+ 3.29. sip_uri_match (int)
|
|
|
|
|
|
4. Functions
|
|
|
|
|
@@ -199,7 +214,16 @@ Chapter 1. Admin Guide
|
|
|
|
|
|
6.1. presence.cleanup
|
|
|
|
|
|
- 7. Installation
|
|
|
+ 7. Pseudo Variables
|
|
|
+
|
|
|
+ 7.1. $subs(attr)
|
|
|
+ 7.2. $notify_reply(attr)
|
|
|
+
|
|
|
+ 8. Events
|
|
|
+
|
|
|
+ 8.1. present:notify-reply
|
|
|
+
|
|
|
+ 9. Installation
|
|
|
|
|
|
1. Overview
|
|
|
|
|
@@ -273,6 +297,7 @@ Chapter 1. Admin Guide
|
|
|
3.26. subs_remove_match (int)
|
|
|
3.27. xavp_cfg (str)
|
|
|
3.28. retrieve_order (int)
|
|
|
+ 3.29. sip_uri_match (int)
|
|
|
|
|
|
3.1. db_url(str)
|
|
|
|
|
@@ -281,7 +306,7 @@ Chapter 1. Admin Guide
|
|
|
If set, the module is a fully operational presence server. Otherwise,
|
|
|
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
|
|
|
...
|
|
@@ -293,7 +318,7 @@ modparam("presence", "db_url",
|
|
|
|
|
|
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
|
|
|
...
|
|
@@ -305,7 +330,7 @@ modparam("presence", "presentity_table", "presentity")
|
|
|
The name of the db table where active subscription information is
|
|
|
stored.
|
|
|
|
|
|
- Default value is "active_watchers".
|
|
|
+ Default value is “active_watchers�.
|
|
|
|
|
|
Example 1.3. Set active_watchers_table parameter
|
|
|
...
|
|
@@ -316,7 +341,7 @@ modparam("presence", "active_watchers_table", "active_watchers")
|
|
|
|
|
|
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
|
|
|
...
|
|
@@ -328,7 +353,7 @@ modparam("presence", "watchers_table", "watchers")
|
|
|
The period in seconds between checks if there are expired messages
|
|
|
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.
|
|
|
|
|
|
Example 1.5. Set clean_period parameter
|
|
@@ -341,7 +366,7 @@ modparam("presence", "clean_period", 100)
|
|
|
The period at which to synchronize cached subscriber info with the
|
|
|
database.
|
|
|
|
|
|
- Default value is "100". A zero or negative value disables
|
|
|
+ Default value is “100�. A zero or negative value disables
|
|
|
synchronization.
|
|
|
|
|
|
Example 1.6. Set db_update_period parameter
|
|
@@ -359,7 +384,7 @@ modparam("presence", "db_update_period", 100)
|
|
|
than 0. When notifier_processes is less than or equal to 0 NOTIFY
|
|
|
requests are sent immediately.
|
|
|
|
|
|
- Default value is "5".
|
|
|
+ Default value is “5�.
|
|
|
|
|
|
Example 1.7. Set waitn_time parameter
|
|
|
...
|
|
@@ -376,7 +401,7 @@ modparam("presence", "waitn_time", 10)
|
|
|
Separate notifier processes are only run when subs_db_mode is 3 (DB
|
|
|
only mode).
|
|
|
|
|
|
- Default value is "10".
|
|
|
+ Default value is “10�.
|
|
|
|
|
|
Example 1.8. Set notifier_poll_rate parameter
|
|
|
...
|
|
@@ -396,7 +421,7 @@ modparam("presence", "notifier_poll_rate", 20)
|
|
|
NOTIFY requests can be sent on a dialog at the same time, there are
|
|
|
race conditions which result in CSeq re-use.
|
|
|
|
|
|
- Default value is "1".
|
|
|
+ Default value is “1�.
|
|
|
|
|
|
Example 1.9. Set notifier_processes parameter
|
|
|
...
|
|
@@ -408,7 +433,7 @@ modparam("presence", "notifier_processes", 2)
|
|
|
The prefix used when generating to_tag when sending replies for
|
|
|
SUBSCRIBE requests.
|
|
|
|
|
|
- Default value is "10".
|
|
|
+ Default value is “10�.
|
|
|
|
|
|
Example 1.10. Set to_tag_pref parameter
|
|
|
...
|
|
@@ -421,7 +446,7 @@ modparam("presence", "to_tag_pref", 'pres')
|
|
|
when sending a 200OK for a publish. It is used for forcing the client
|
|
|
to send an update before the old publish expires.
|
|
|
|
|
|
- Default value is "0".
|
|
|
+ Default value is “0�.
|
|
|
|
|
|
Example 1.11. Set expires_offset parameter
|
|
|
...
|
|
@@ -433,7 +458,7 @@ modparam("presence", "expires_offset", 10)
|
|
|
The maximum admissible expires value for PUBLISH/SUBSCRIBE message (in
|
|
|
seconds).
|
|
|
|
|
|
- Default value is "3600".
|
|
|
+ Default value is “3600�.
|
|
|
|
|
|
Example 1.12. Set max_expires parameter
|
|
|
...
|
|
@@ -447,7 +472,7 @@ modparam("presence", "max_expires", 3600)
|
|
|
|
|
|
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
|
|
|
...
|
|
@@ -459,12 +484,12 @@ modparam("presence", "max_expires", 3600)
|
|
|
The action to take when UA sends a expires value less then min_expires.
|
|
|
|
|
|
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
|
|
|
|
|
|
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
|
|
|
...
|
|
@@ -535,7 +560,7 @@ modparam("presence", "subs_db_mode", 1)
|
|
|
database or there are other external entities inserting data into the
|
|
|
presentity table.
|
|
|
|
|
|
- Default value is "1".
|
|
|
+ Default value is “1�.
|
|
|
|
|
|
Example 1.17. Set publ_cache parameter
|
|
|
...
|
|
@@ -548,7 +573,7 @@ modparam("presence", "publ_cache", 0)
|
|
|
This 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.18. Set subs_htable_size parameter
|
|
|
...
|
|
@@ -560,7 +585,7 @@ modparam("presence", "subs_htable_size", 11)
|
|
|
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.
|
|
|
|
|
|
- Default value is "9 (512)".
|
|
|
+ Default value is “9 (512)�.
|
|
|
|
|
|
Example 1.19. Set pres_htable_size parameter
|
|
|
...
|
|
@@ -575,7 +600,7 @@ modparam("presence", "pres_htable_size", 11)
|
|
|
empty NOTIFY to an message-summary event. This parameter is enabled by
|
|
|
default, thus addering to the standard.
|
|
|
|
|
|
- Default value is "1 ".
|
|
|
+ Default value is “1 �.
|
|
|
|
|
|
Example 1.20. Set send_fast_notify parameter
|
|
|
...
|
|
@@ -590,7 +615,7 @@ modparam("presence", "send_fast_notify", 0)
|
|
|
this check requires extra processing that should be avoided if this
|
|
|
feature is not supported by the clients.
|
|
|
|
|
|
- Default value is "0 ".
|
|
|
+ Default value is “0 �.
|
|
|
|
|
|
Example 1.21. Set enable_sphere_check parameter
|
|
|
...
|
|
@@ -605,7 +630,7 @@ modparam("presence", "enable_sphere_check", 1)
|
|
|
on. Disabling this will keep subscriptions active on unreliable
|
|
|
networks.
|
|
|
|
|
|
- Default value is "1".
|
|
|
+ Default value is “1�.
|
|
|
|
|
|
Example 1.22. Set timeout_rm_subs parameter
|
|
|
...
|
|
@@ -703,6 +728,21 @@ if(is_method("PUBLISH")) {
|
|
|
modparam("presence", "retrieve_order", 1)
|
|
|
...
|
|
|
|
|
|
+3.29. sip_uri_match (int)
|
|
|
+
|
|
|
+ The mode used when comparing uris.
|
|
|
+
|
|
|
+ Possible Values
|
|
|
+ * 0 : case sensitive
|
|
|
+ * 1 : case insensitive
|
|
|
+
|
|
|
+ Default value is “0�.
|
|
|
+
|
|
|
+ Example 1.29. Set sip_uri_match parameter
|
|
|
+ ...
|
|
|
+ modparam("presence", "sip_uri_match", 1)
|
|
|
+ ...
|
|
|
+
|
|
|
4. Functions
|
|
|
|
|
|
4.1. handle_publish([sender_uri])
|
|
@@ -711,7 +751,7 @@ modparam("presence", "retrieve_order", 1)
|
|
|
4.4. pres_refresh_watchers(uri, event, type[, file_uri, filename])
|
|
|
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
|
|
|
in memory cache and database, then calls functions to send NOTIFY
|
|
@@ -731,7 +771,7 @@ modparam("presence", "retrieve_order", 1)
|
|
|
|
|
|
The module sends an appropriate stateless reply in all cases.
|
|
|
|
|
|
- Example 1.29. handle_publish usage
|
|
|
+ Example 1.30. handle_publish usage
|
|
|
...
|
|
|
if(is_method("PUBLISH"))
|
|
|
{
|
|
@@ -743,7 +783,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
|
|
|
information in memory and database and calls functions to send NOTIFY
|
|
@@ -762,13 +802,13 @@ modparam("presence", "retrieve_order", 1)
|
|
|
|
|
|
The module sends an appropriate stateless reply in all cases.
|
|
|
|
|
|
- Example 1.30. handle_subscribe usage
|
|
|
+ Example 1.31. handle_subscribe usage
|
|
|
...
|
|
|
if(method=="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
|
|
|
'presence' of presentity. Both watcher_uri and presentity_uri are
|
|
@@ -779,7 +819,7 @@ if(method=="SUBSCRIBE")
|
|
|
|
|
|
This function can be used from REQUEST_ROUTE.
|
|
|
|
|
|
- Example 1.31. pres_auth_status usage
|
|
|
+ Example 1.32. pres_auth_status usage
|
|
|
...
|
|
|
if (method=="MESSAGE") {
|
|
|
pres_auth_status("$fu", $ru");
|
|
@@ -791,7 +831,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
|
|
|
watchers if a change in watchers authorization or in published state
|
|
@@ -815,12 +855,12 @@ if (method=="MESSAGE") {
|
|
|
|
|
|
This function can be used from ANY_ROUTE.
|
|
|
|
|
|
- Example 1.32. pres_refresh_watchers usage
|
|
|
+ Example 1.33. pres_refresh_watchers usage
|
|
|
...
|
|
|
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
|
|
|
status if a change in watchers authorization state occurred (i.e.,
|
|
@@ -833,7 +873,7 @@ pres_refresh_watchers("sip:[email protected]", "presence", 1);
|
|
|
|
|
|
This function can be used from ANY_ROUTE.
|
|
|
|
|
|
- Example 1.33. pres_update_watchers usage
|
|
|
+ Example 1.34. pres_update_watchers usage
|
|
|
...
|
|
|
pres_update_watchers("sip:[email protected]", "presence");
|
|
|
...
|
|
@@ -843,7 +883,7 @@ pres_update_watchers("sip:[email protected]", "presence");
|
|
|
5.1. refreshWatchers
|
|
|
5.2. cleanup
|
|
|
|
|
|
-5.1. refreshWatchers
|
|
|
+5.1. refreshWatchers
|
|
|
|
|
|
Triggers sending Notify messages to watchers if a change in watchers
|
|
|
authorization or in published state occurred.
|
|
@@ -873,7 +913,7 @@ pres_update_watchers("sip:[email protected]", "presence");
|
|
|
1
|
|
|
_empty_line_
|
|
|
|
|
|
-5.2. cleanup
|
|
|
+5.2. cleanup
|
|
|
|
|
|
Manually triggers the cleanup functions for the active_watchers,
|
|
|
presentity, and watchers tables. Useful if you have set clean_period
|
|
@@ -891,7 +931,7 @@ pres_update_watchers("sip:[email protected]", "presence");
|
|
|
|
|
|
6.1. presence.cleanup
|
|
|
|
|
|
-6.1. presence.cleanup
|
|
|
+6.1. presence.cleanup
|
|
|
|
|
|
Manually triggers the cleanup functions for the active_watchers,
|
|
|
presentity, and watchers tables. Useful if you have set clean_period
|
|
@@ -901,7 +941,85 @@ pres_update_watchers("sip:[email protected]", "presence");
|
|
|
|
|
|
Parameters: none
|
|
|
|
|
|
-7. Installation
|
|
|
+7. Pseudo Variables
|
|
|
+
|
|
|
+ 7.1. $subs(attr)
|
|
|
+ 7.2. $notify_reply(attr)
|
|
|
+
|
|
|
+7.1. $subs(attr)
|
|
|
+
|
|
|
+ Access the attributes of handled subscription. It must be used after a
|
|
|
+ successful call of “handle_subscription()� or in the following events.
|
|
|
+ * tm:local-request - before notify is sent
|
|
|
+ * present:notify-reply - after notify is sent
|
|
|
+
|
|
|
+ The “attr� can be:
|
|
|
+ * uri - subscription presentity uri
|
|
|
+ * pres_uri - alias for presentity uri
|
|
|
+ * to_user
|
|
|
+ * to_domain
|
|
|
+ * from_user
|
|
|
+ * from_domain
|
|
|
+ * watcher_username
|
|
|
+ * watcher_domain
|
|
|
+ * event
|
|
|
+ * event_id
|
|
|
+ * to_tag
|
|
|
+ * from_tag
|
|
|
+ * callid
|
|
|
+ * remote_cseq
|
|
|
+ * local_cseq
|
|
|
+ * contact
|
|
|
+ * local_contact
|
|
|
+ * record_route
|
|
|
+ * expires
|
|
|
+ * status
|
|
|
+ * reason
|
|
|
+ * version
|
|
|
+ * flags
|
|
|
+ * user_agent
|
|
|
+
|
|
|
+ Example 1.35. $subs(name) usage
|
|
|
+...
|
|
|
+if(handle_subscription())
|
|
|
+{
|
|
|
+ xlog("presentity=$subs(uri)\n");
|
|
|
+}
|
|
|
+...
|
|
|
+
|
|
|
+7.2. $notify_reply(attr)
|
|
|
+
|
|
|
+ Access the reply message received when notifying subscriber. It must be
|
|
|
+ used in the following events.
|
|
|
+ * present:notify-reply - after notify is sent
|
|
|
+
|
|
|
+ The “attr� can be any pseudo var that accesses attributes of msg
|
|
|
+
|
|
|
+ Example 1.36. $notify_reply(name) usage
|
|
|
+...
|
|
|
+event_route[presence:notify-reply]
|
|
|
+{
|
|
|
+ xlog("received message = $notify_reply($mb)\n");
|
|
|
+}
|
|
|
+...
|
|
|
+
|
|
|
+8. Events
|
|
|
+
|
|
|
+ 8.1. present:notify-reply
|
|
|
+
|
|
|
+8.1. present:notify-reply
|
|
|
+
|
|
|
+ Fired after notify reply is received or timeout.
|
|
|
+
|
|
|
+ Example 1.37. $notify_reply(name) usage
|
|
|
+...
|
|
|
+event_route[presence:notify-reply]
|
|
|
+{
|
|
|
+ xlog("received message = $notify_reply($mb)\n");
|
|
|
+}
|
|
|
+...
|
|
|
+
|
|
|
+9. Installation
|
|
|
|
|
|
The module requires 3 tables in the Kamailio database: "presentity",
|
|
|
"active_watchers" and "watchers". The SQL syntax to create them can be
|
|
@@ -935,7 +1053,7 @@ Chapter 2. Developer Guide
|
|
|
The module provides the following functions that can be used in other
|
|
|
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
|
|
|
one exported function -> add_event, which when called adds a new event
|
|
@@ -971,7 +1089,7 @@ typedef struct presence_api {
|
|
|
}presence_api_t;
|
|
|
...
|
|
|
|
|
|
-2. add_event
|
|
|
+2. add_event
|
|
|
|
|
|
Field type:
|
|
|
...
|
|
@@ -1014,16 +1132,17 @@ typedef struct pres_ev
|
|
|
free_body_t* free_body;
|
|
|
/* 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.
|
|
|
- * 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
|
|
|
+ * 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
|
|
|
* generated by the agg_nbody function.
|
|
|
* 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
|
|
|
-makes a
|
|
|
- * copy of the original body, it also has to register the aux_free_body() to
|
|
|
+ makes a
|
|
|
+ * copy of the original body, it also has to register the aux_free_body() t
|
|
|
+o
|
|
|
* free this "per watcher" body.
|
|
|
*/
|
|
|
aux_body_processing_t* aux_body_processing;
|
|
@@ -1034,7 +1153,7 @@ makes a
|
|
|
}pres_ev_t;
|
|
|
...
|
|
|
|
|
|
-3. get_rules_doc
|
|
|
+3. get_rules_doc
|
|
|
|
|
|
Filed type:
|
|
|
...
|
|
@@ -1047,7 +1166,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
|
|
|
functions described bellow.
|
|
|
|
|
|
-4. get_auth_status
|
|
|
+4. get_auth_status
|
|
|
|
|
|
This filed is a function to be called for a subscription request to
|
|
|
return the state for that subscription according to authorization
|
|
@@ -1062,7 +1181,7 @@ typedef int (get_rules_doc_t)(str* user, str* domain, str** rules_doc);
|
|
|
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
|
|
|
requires authorization, when constructing final body. The authorization
|
|
@@ -1074,7 +1193,7 @@ typedef int (is_allowed_t)(struct subscription* subs);
|
|
|
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
|
|
|
states. This function receives a body array and should return the final
|
|
@@ -1088,7 +1207,7 @@ typedef str* (agg_nbody_t)(str* pres_user, str* pres_domain,
|
|
|
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
|
|
|
the info from database before being inserted in Notify message body(if
|
|
@@ -1100,7 +1219,7 @@ str** body_array, int n, int off_index);
|
|
|
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
|
|
|
body for each watcher. E.g. if the XML body includes a 'version'
|
|
@@ -1114,7 +1233,7 @@ typedef void(free_body_t)(char* 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
|
|
|
function and allocates memory for the new modified body. Then, this
|
|
@@ -1129,7 +1248,7 @@ typedef str* (aux_body_processing_t)(struct subscription *subs, str* 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
|
|
|
body correctness check.
|
|
@@ -1138,7 +1257,7 @@ typedef void(free_body_t)(char* body);
|
|
|
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
|
|
|
Subscription requests.
|
|
@@ -1148,7 +1267,7 @@ typedef int (publ_handling_t)(struct sip_msg*);
|
|
|
typedef int (subs_handling_t)(struct sip_msg*);
|
|
|
..
|
|
|
|
|
|
-12. contains_event
|
|
|
+12. contains_event
|
|
|
|
|
|
Field type:
|
|
|
..
|
|
@@ -1161,7 +1280,7 @@ event_t* parsed_event);
|
|
|
found. If the second argument is an allocated event_t* structure it
|
|
|
fills it with the result of the parsing.
|
|
|
|
|
|
-13. get_event_list
|
|
|
+13. get_event_list
|
|
|
|
|
|
Field type:
|
|
|
...
|
|
@@ -1171,7 +1290,7 @@ typedef int (*get_event_list_t) (str** ev_list);
|
|
|
This function returns a string representation of the events registered
|
|
|
in presence module.( used for Allowed-Events header).
|
|
|
|
|
|
-14. update_watchers_status
|
|
|
+14. update_watchers_status
|
|
|
|
|
|
Field type:
|
|
|
...
|
|
@@ -1185,7 +1304,7 @@ str* rules_doc);
|
|
|
(used by presence_xml module when notified through an MI command of a
|
|
|
change in an xcap document).
|
|
|
|
|
|
-15. get_sphere
|
|
|
+15. get_sphere
|
|
|
|
|
|
Field type:
|
|
|
...
|
|
@@ -1196,12 +1315,12 @@ typedef char* (*pres_get_sphere_t)(str* pres_uri);
|
|
|
information if this has type RPID. If not found returns NULL. (the
|
|
|
return value is allocated in private memory and should be freed)
|
|
|
|
|
|
-16. get_presentity
|
|
|
+16. get_presentity
|
|
|
|
|
|
Field type:
|
|
|
...
|
|
|
-typedef str* (*pres_get_presentity_t)(str pres_uri, pres_ev_t *ev, str *etag, st
|
|
|
-r *contact);
|
|
|
+typedef str* (*pres_get_presentity_t)(str pres_uri, pres_ev_t *ev, str *etag, s
|
|
|
+tr *contact);
|
|
|
...
|
|
|
|
|
|
This function returns a pointer to a str containing an XML document
|
|
@@ -1212,7 +1331,7 @@ r *contact);
|
|
|
Once you are finished with the presentity document you must call
|
|
|
free_presentity to free the allocated memory.
|
|
|
|
|
|
-17. free_presentity
|
|
|
+17. free_presentity
|
|
|
|
|
|
Field type:
|
|
|
...
|