Table of Contents
List of Examples
Table of Contents
This modules publishes information about "reg"-events according to to RFC 3680. This can be used distribute the registration-info status to the subscribed watchers.
This module "PUBLISH"es information when a new user registers at this server (e.g. when "save()" is called) to users, which have subscribed for the reg-info for this user.
This module can "SUBSCRIBE" for information at another server, so it will receive "NOTIFY"-requests, when the information about a user changes.
And finally, it can process received "NOTIFY" requests and it will update the local registry accordingly.
Use cases for this might be:
The default domain for the registered users to be used when constructing the uri for the registrar callback.
Default value is “NULL”.
Example 1.1. Set default_domain
parameter
... modparam("pua_reginfo", "default_domain", "kamailio.org") ...
Whether or not to generate PUBLISH requests.
Default value is “1” (enabled).
This function processes received "NOTIFY"-requests and updates the local registry accordingly.
This method does not create any SIP-Response, this has to be done by the script-writer.
The parameter has to correspond to user location table (domain) where to store the record.
Return codes:
2 - contacts successfully updated, but no more contacts online now.
1 - contacts successfully updated and at at least one contact still registered.
-1 - Invalid NOTIFY or other error (see log-file)
Example 1.5. reginfo_handle_notify
usage
... if(is_method("NOTIFY")) if (reginfo_handle_notify("location")) send_reply("202", "Accepted"); ...
This function will subscribe for reginfo-information at the given server URI.
Meaning of the parameters is as follows:
uri - SIP-URI of the server, where to subscribe, may contain pseudo-variables.
expires - Expiration date for this subscription, in seconds (default 3600)
Example 1.6. reginfo_subscribe
usage
... route { t_on_reply("1"); t_relay(); } reply_route[1] { if (t_check_status("200")) reginfo_subscribe("$ru"); } ...