Table of Contents
save(async_reply_route,
domain)
lookup(domain)
lookup_path_to_contact(uri)
unregister(domain)
assign_server_unreg(aysnc_reply_route,
domain, direction)
impu_registered(domain)
term_impu_registered(domain)
reg_fetch_contacts(domain, uri,
profile)
reg_free_contacts(profile)
can_subscribe_to_reg(domain)
subscribe_to_reg(domain)
can_publish_reg(domain)
publish_reg(domain)
List of Examples
default_expires
parameterdefault_expires_range
parametermin_expires
parametermax_expires
parametersubscription_default_expires
parametersubscription_expires_range
parametersubscription_min_expires
parametersubscription_max_expires
parameteruser_data_dtd
parameteruser_data_xsd
parametersupport_wildcardPSI
parameterscscf_name
parameterstore_profile_dereg
parametercxdx_dest_realm
parametercxdx_forced_peer
parametercxdx_forced_peer
parametercxdx_forced_peer
parameteruser_data_always
parametererror_reply_code
parametersave
usagelookup
usagelookup
usageunregister
usageimpu_registered
usageterm_impu_registered
usagereg_fetch_contacts
usagereg_free_contacts
usagecan_subscribe_to_reg
usagesubscribe_to_reg
usagecan_publish_reg
usagepublish_reg
usageTable of Contents
save(async_reply_route,
domain)
lookup(domain)
lookup_path_to_contact(uri)
unregister(domain)
assign_server_unreg(aysnc_reply_route,
domain, direction)
impu_registered(domain)
term_impu_registered(domain)
reg_fetch_contacts(domain, uri,
profile)
reg_free_contacts(profile)
can_subscribe_to_reg(domain)
subscribe_to_reg(domain)
can_publish_reg(domain)
publish_reg(domain)
This module contains REGISTER processing logic for the S-CSCF. The 'storage engine' of this module is provided by the ims_usrloc_scscf module:
The following modules must be loaded before this module:
CDP
CDP_AVP
TM
ims_usrloc_scscf
If the processed message contains neither Expires HFs nor expires contact parameters, this value will be used for newly created S-CSCF usrloc records. The parameter contains number of second to expire (for example use 3600 for one hour). If it is set to a lower value than the min_expires parameter then it will be ignored. This parameter can be modified via ser config framework. A random value in a specific interval can be selected by using the default_expires_range parameter
Default value is 3600.
Example 1.1. Set default_expires
parameter
... modparam("ims_registrar_scscf", "default_expires", 3600) ...
This parameter specifies that the expiry used for newly created S-CSCF usrloc records are not fixed(when default_expires applies), but a random value in the intervalrdq [default_expires-default_expires_range%, default_expires+default_expires_range%]. The value is between 0 and 100 and represent the maximum percentage from default_expires that will be subtracted or added when computing the value. Default in 0, meaning default_expires is left unmodified. This parameter can be modified via ser config framework.
Default value is 0.
Example 1.2. Set default_expires_range
parameter
... modparam("ims_registrar_scscf", "default_expires_range", 30) # +- 30% from default_expires ...
The minimum expires value of a Contact, values lower than this minimum will be automatically set to the minimum. Value 0 disables the checking. This parameter can be modified via ser config framework.
Default value is 60.
The maximum expires value of a Contact, values higher than this maximum will be automatically set to the maximum. Value 0 disables the checking. This parameter can be modified via ser config framework.
Default value is 0.
If the processed message contains neither Expires HFs nor expires contact parameters, this value will be used for newly created subscriptions. The parameter contains number of second to expire (for example use 3600 for one hour). If it is set to a lower value than the subscription_min_expires parameter then it will be ignored. A random value in a specific interval can be selected by using the subscription_expires_range parameter
Default value is 3600.
Example 1.5. Set subscription_default_expires
parameter
... modparam("ims_registrar_scscf", "subscription_default_expires", 3600) ...
This parameter specifies that the expiry used for newly created subscriptions are not fixed(when subscription_default_expires applies), but a random value in the interval [subscription_default_expires-subscription_expires_range%, subscription_default_expires+subscription_expires_range%]. The value is between 0 and 100 and represent the maximum percentage from subscription_default_expires that will be subtracted or added when computing the value. Default in 0, meaning subscription_default_expires is left unmodified.
Default value is 0.
Example 1.6. Set subscription_expires_range
parameter
... modparam("ims_registrar_scscf", "subscription_expires_range", 30) # +- 30% from subscription_expires_range ...
The minimum expires value of a subscription, values lower than this minimum will be automatically set to the minimum. Value 0 disables the checking.
Default value is 10.
Example 1.7. Set
subscription_min_expires
parameter
... modparam("subscription_min_expires", "min_expires", 1800) ...
The maximum expires value of a subscription, values higher than this maximum will be automatically set to the maximum. Value 0 disables the checking.
Default value is 1000000.
Example 1.8. Set
subscription_max_expires
parameter
... modparam("ims_registrar_scscf", "subscription_max_expires", 3600) ...
DTD to check the user data received in SAA (Server Assignment Answer).
Default value is NULL (none).
Example 1.9. Set user_data_dtd
parameter
... modparam("ims_registrar_scscf", "user_data_dtd", "/usr/local/etc/kamailio/CxDataType_Rel7.dtd") ...
XSD to check the user data received in SAA (Server Assignment Answer).
Default value is NULL (none).
Example 1.10. Set user_data_xsd
parameter
... modparam("ims_registrar_scscf", "user_data_xsd", "/usr/local/etc/kamailio/CxDataType_Rel7.xsd") ...
indicate support for wildcard PSI is subscription profile (SAA)
Default value is 0.
Example 1.11. Set support_wildcardPSI
parameter
... modparam("ims_registrar_scscf", "support_wildcardPSI", 1) ...
The name of the S-CSCF
Default value is sip:scscf.ims.smilecoms.com:6060.
Example 1.12. Set scscf_name
parameter
... modparam("ims_registrar_scscf", "scscf_name", "sip:scscf2.ims.smilecoms.com:6060") ...
Should the subscription profile be stored on de-registration
Default value 0.
Example 1.13. Set store_profile_dereg
parameter
... modparam("ims_registrar_scscf", "store_profile_dereg", 1) ...
Destination realm to be used in Diameter messages
Default value "ims.smilecoms.com"
Example 1.14. Set cxdx_dest_realm
parameter
... modparam("ims_registrar_scscf", "cxdx_dest_realm", "my.domain,org") ...
FQDN of Diameter Peer (HSS) to use for communication (SAR). If you use this, the routing defined in your diameter xml configuration file (CDP) will be ignored and as a result you will lose the benefits of load balancing and failover.
Default value NULL (none)
Example 1.15. Set cxdx_forced_peer
parameter
... modparam("ims_registrar_scscf", "cxdx_forced_peer", "hss.ims.smilecoms.com") ...
The parameter controls how lookup function processes multiple contacts. If there are multiple contacts for the given username in usrloc and this parameter is set to 1, Request-URI will be overwritten with the highest-q rated contact and the rest will be appended to sip_msg structure and can be later used by tm for forking. If the parameter is set to 0, only Request-URI will be overwritten with the highest-q rated contact and the rest will be left unprocessed. This parameter can be modified via Kamailio config framework.
Default value is 0 (disabled)
Example 1.16. Set cxdx_forced_peer
parameter
... modparam("ims_registrar_scscf", "append_branches", 1) ...
Tells if the contact filtering based on supported methods should be performed during lookup. It's enabled only if it has a non zero value.
Default value is 0 (disabled)
Example 1.17. Set cxdx_forced_peer
parameter
... modparam("ims_registrar_scscf", "method_filtering", 1) ...
If specified this will make the S-CSCF always request user data from HSS.
Default value is 0 (disabled)
Example 1.18. Set user_data_always
parameter
... modparam("ims_registrar_scscf", "user_data_always", 1) ...
In certain error conditions, the S-CSCF may not be able to process the request (e.g. in case of database failures). Per default and according to the Specs, the S-CSCF would return a 500 error in this case. However, according to the SIP-Specs for DNS-SRV, this won't trigger a failover, which may be desired.
This parameter let's you override the default 500 with another return-code (e.g. 503) in order to get the desired behaviour.
Default value is 500.
Example 1.19. Set error_reply_code
parameter
... modparam("ims_registrar_scscf", "error_reply_code", 503) ...
The function processes a REGISTER message. It can add, remove or modify usrloc records depending on Contact and Expires HFs in the REGISTER message. On success and when called from the REQUEST_ROUTE, 200 OK will be returned listing all contacts that are currently in usrloc. On an error, error message will be sent with a short description in reason phrase. In case of internal errors the function will return FALSE, otherwise a force to exit the cfg is file is actioned by returning 0 (asynchronous processing)
Meaning of the parameters is as follows:
async_reply_route- the route to execute after the save has completed. This is required because the save function is executed asynchronously (Diameter).
domain- Logical domain within registrar.
This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE
Example 1.20. save
usage
... if (!impu_registered("location")) { save("PRE_REG_SAR_REPLY","location"); } ...
This function extract the IMPU from the Request-URI and tries to find all registered contacts in usrloc. If there are no such contacts, -1 is returned. If there are, Request-URI will be rewritten with the contact that has the highest q value. The rest of the contacts will be appended to the sip msg structure (if append_branches is set) and can be later used by TM module for forking for example...
If the method filtering option is enabled, the lookup function will only return contacts that support the method of the request being processed (see allows header)
Meaning of the parameters is as follows:
domain - Logical domain within registrar.
Return codes:
-1 - Not found
-2 - Found, but method not allowed (check Allows header for INVITE, MESSAGE, etc).
-3 - Error occurred internally during processing
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE
Example 1.21. lookup
usage
... lookup("location"); switch ($retcode) { case -1: case -3: sl_send_reply("404", "Not Found"); exit; case -2: sl_send_reply("405", "Not Found"); exit; }; ...
This function take a URI and tries to find the contact in usrloc. If the contact is found and has a path set, then a path header is added to the SIP message so it can be loose routed.
Meaning of the parameters is as follows:
uri - URI of contact to lookup
Return codes:
1 - Success
-1 - Failure
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE
This function will remove all bindings for the IMPU found in the Request-URI.
Meaning of the parameters is as follows:
Domain- Logical domain within registrar.
This function can be used in REQUEST_ROUTE, FAILURE_ROUTE
This function checks if the IMPU in the To header is registered in usrloc.
Meaning of the parameters is as follows:
domain- Logical domain within registrar.
Return codes:
1 - True, IMPU exists in registered state in usrloc
-1 - False, IMPU not registered
This function can be used in REQUEST_ROUTE, FAILURE_ROUTE
Example 1.24. impu_registered
usage
... impu_registered("location"); switch ($retcode) { case -1: sl_send_reply("404", "Not Found"); exit; case 1: #true, continue with normal processing }; ...
This function checks if the IMPU in the Request-URI is registered in usrloc.
Meaning of the parameters is as follows:
domain- Logical domain within registrar.
Return codes:
1 - True, IMPU exists in registered state in usrloc
-1 - False, IMPU not registered
This function can be used in REQUEST_ROUTE, FAILURE_ROUTE
Example 1.25. term_impu_registered
usage
... term_impu_registered("location"); switch ($retcode) { case -1: sl_send_reply("404", "Not Found"); exit; case 1: #true, continue with normal processing }; ...
The function fetches the contacts for 'uri' from table 'domain' to pseudo-variable $imssulc(profile) [imssulc = ims scscf ulc].
Meaning of the parameters is as follows:
domain - Name of table that should be used for the lookup of contact addresses.
uri - The SIP URI address of the user which to fetch the contact addresses for. It can contain pseudo-variables that are evaluated at runtime.
profile - Name of $imssulc pseudo-variable profile that will store the fetched contacts. It is a static string.
This function can be used in REQUEST_ROUTE, FAILURE_ROUTE
Example 1.26. reg_fetch_contacts
usage
... reg_fetch_contacts("location", "$ru", "callee"); reg_fetch_contacts("location", "sip:user@kamailio.org", "caller"); ...
The function frees the contacts from pseudo-variable $ulc(profile). Should be called to release the content of a profile. Anyhow, fetching a new contact addresses set over a profile will release any existing data in that profile.
Meaning of the parameters is as follows:
profile - Name of $imssulc pseudo-variable profile that stores the contacts. It is a static string.
This function can be used in REQUEST_ROUTE, FAILURE_ROUTE
This function checks to see that a SUBSCRIBE request is authorised to subscribe to the particular identity. Only 3 entities can subscribe:
The user agent to it's own state
The P-CSCF specified in the path header for that user
Application Server (AS) not yet implemented
Meaning of the parameters is as follows:
domain - Logical domain within registrar.
This function can be used in REQUEST_ROUTE
Example 1.28. can_subscribe_to_reg
usage
... if (can_subscribe_to_reg("location")){ $var(ret)= subscribe_to_reg("location"); } ...
Save the subscription to the REG event for the UAC or the appropriate P-CSCF (in the path to the UAC).
Meaning of the parameters is as follows:
domain - Logical domain within registrar.
This function can be used in REQUEST_ROUTE
Example 1.29. subscribe_to_reg
usage
... if (can_subscribe_to_reg("location")){ $var(ret)= subscribe_to_reg("location"); } ...
This function checks to see that a PUBLISH request is authorised to publish for a particular identity. Only 3 entities can publish:
The user agent to it's own state
The P-CSCF specified in the path header for that user
Application Server (AS) not yet implemented
Meaning of the parameters is as follows:
domain - Logical domain within registrar.
This function can be used in REQUEST_ROUTE
Example 1.30. can_publish_reg
usage
... if (can_publish_reg("location")){ $var(ret)= publish_reg("location"); } ...
Save the publish to the REG event for the UAC or the appropriate P-CSCF (in the path to the UAC).
Meaning of the parameters is as follows:
domain - Logical domain within registrar.
This function can be used in REQUEST_ROUTE
Example 1.31. publish_reg
usage
... if (can_publish_reg("location")){ $var(ret)= publish_reg("location"); } ...
exported RPC commands.
2.1. |
Where can I find more about Kamailio? |
Take a look at https://www.kamailio.org/. |
|
2.2. |
Where can I post a question about this module? |
First at all check if your question was already answered on one of our mailing lists:
E-mails regarding any stable Kamailio release should be sent to
|
|
2.3. |
How can I report a bug? |
Please follow the guidelines provided at: https://github.com/kamailio/kamailio/issues. |