Table of Contents
List of Examples
hash_size
parameterts_store
usagets_append
usagets_append_to
usageTable of Contents
This module provides transaction storage for the Kamailio SIP Server Platform. It stores in an internal table transactions for a Request-URI (R-URI) and add branches to them later if new contacts for the AOR are added.
When the ts_store function is called, the module stores the current transaction R-URI URI, index and label. Two functions (ts_append and ts_append_to) provide the ability to add new branches either to a specific transaction or to all of the transactions stored for a given R-URI. If USRLOC's use_domain option is true, the domain part of the R-URI is used to store the transaction, otherwise only the username part is used.
When a transaction is destroyed by the TM module, it is removed from the module's table too.
The following modules must be loaded before this module:
REGISTRAR--registrar module-- used to lookup for new contacts and update the dset for the r-uri.
TM--transaction module-- used to send SIP requests.
USRLOC--usrloc module-- according to the value of use_domain option, domain part of the r-uri will be used to store the transaction.
SL
The size of the hash table internally used to keep the transaction. A larger table is much faster but consumes more memory. The hash size must be a power of two, otherwise it will be rounded down to the nearest power of two.
Default value is “2048”.
The method stores r-uri, tindex and tlabel of the current transaction.
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
The method add branches to all the stored transactions for the SIP ruri passed as parameter, performing a contact lookup on the table specified by the domain parameter. The method should be called when a REGISTER request is received.
Meaning of the parameters is as follows:
domain - Name of table that should be used for looking up new contacts for r-uri.
ruri - The r-uri for which we want to check existing transactions and add them new branches. Can be a static string value or a dynamic string with pseudo-variables.
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
The method add branches to the transaction identified by tindex and tlabel, performing a contacts lookup on the table specified by the domain parameter. The method should be called when a REGISTER request is received.
Meaning of the parameters is as follows:
tindex - internal index of transaction. Can be an integer or a pseudo-variable.
tlabel - internal label of transaction. Can be an integer or a pseudo-variable.
domain - Name of table that should be used for looking up new contacts for r-uri.
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
Example 1.4. ts_append_to
usage
... if (is_method("REGISTER")) { $var(tindex) = ... $var(tlabel) = ... ts_append_to("$var(tindex)", "$var(tlabel", "location"); } ...