SIP Express Router v0.8.8 - Developer's Guide | ||
---|---|---|
<<< Previous | Basic Modules |
Support for location of users.
Module depends on: Optionaly mysql (if configured for persistence)
![]() | Usrloc is convenient module only. It's functions cannot be called from scripts directly (hence the ~ at the beginning) but are used by registrar module internally. This module will be utilized by more modules in the future and therefore it is standalone. Use registrar module functions if you need usrloc support in your scripts. |
user_col - Name of column containing usernames.
Type: string
Default: "user"
contact_col - Name of column containing contacts.
Type: string
Default: "contact"
expires_col - Name of column containing expires.
Type: string
Default: "expires"
q_col - Name of column containing q values.
Type: string
Default: "q"
callid_col - Name of column containing callids.
Type: string
Default: "callid"
cseq_col - Name of column containing cseq numbers.
Type: string
Default: "cseq"
method_col - Name of column containing supported methods.
Type: string
Default: "method"
db_url - URL of the database that should be used.
Type: string
Default: "sql://ser:heslo@localhost/ser"
timer_interval - Number of seconds between two timer runs. The module uses timer to delete expired contacts, synchronize with database and other tasks, that need to be run periodically.
Type: integer
Default: 60 seconds
db_mode - The usrloc module can utilize database for persistent contact storage. If you use database, your contacts will survive machine restarts or sw crashes. The disadvantage is that accessing database can be very time consuming. Therefore, usrloc module implements three database accessing modes:
0 - This disables database completely. Only memory will be used. Contacts will not survive restart. Use this value if you need a really fast usrloc and contact persistence is not necessarry or is provided by other means.
1 - Write-Through scheme. All changes to usrloc are immediately reflected in database too. This is very slow, but very reliable. Use this scheme if speed is not your priority but need to make sure that no registered contacts will be lost during crash or reboot.
2 - Write-Back scheme. This is a combination of previous two schemes. All changes are made to memory and database synchronization is done in the timer. The timer deletes all expired contacts and flushes all modified or new contacts to database. Use this scheme if you encounter high-load peaks and want them to process as fast as possible. The mode will not help at all if the load is high all the time. Also, latency of this mode is much lower than latency of mode 1, but slightly higher than latency of mode 0.
Type: integer
Default: 0
![]() | In case of crash or restart contacts that are in memory only and haven't been flushed yet will get lost. If you want minimize the risk, use shorter timer interval. |
The function registers a new domain. Domain is just another name for table used in registrar. The function is called from fixups in registrar. It gets name of the domain as a parameter and returns pointer to a new domain structure. The fixup than 'fixes' the parametr in registrar so that it will pass the pointer instead of the name every time save() or lookup() is called. Some usrloc functions get the pointer as parameter when called. For more details see implementation of save function in registrar.
name - Name of the domain (also called table) to be registered.
The function creates a new record structure and inserts it in the specified domain. The record is structure that contains all the contacts for belonging to the specified username.
domain - Pointer to domain returned by ul_register_udomain.
aor - Address of Record (aka username) of the new record (at this time the record will contain no contacts yet).
rec - The newly created record structure.
The function deletes all the contacts bound with the given Address Of Record.
domain - Pointer to domain returned by ul_register_udomain.
aor - Address of record (aka username) of the record, that should be deleted.
The function returns pointer to record with given Address of Record.
domain - Pointer to domain returned by ul_register_udomain.
aor - Address of Record of request record.
The function lock the specified domain, it means, that no other processes will be able to access during the time. This prevents race conditions. Scope of the lock is the specified domain, that means, that multiple domain can be accessed simultaneously, they don't block each other.
domain - Domain to be locked.
Unlock the specified domain previously locked by ul_lock_udomain.
domain - Domain to be unlocked.
Do some sanity checks - if all contacts have been removed, delete the entire record structure.
record - Record to be released.
The function inserts a new contact in the given record with specified parameters.
record - Record in which the contact should be inserted.
contact - Contact URL.
expires - Expires of the contact in absolute value.
q - q value of the contact.
callid - Call-ID of the REGISTER message that contained the contact.
cseq - CSeq of the REGISTER message that contained the contact.
cont - Pointer to newly created structure.
The function deletes given contact from record.
record - Record from which the contact should be removed.
contact - Contact to be deleted.
The function tries to find contact with given Contact URI and returns pointer to structure representing the contact.
record - Record to be searched for the contact.
contact - URI of the request contact.
The function updates contact with new values.
contact - Contact to be updated.
expires - New expires value.
q - New q value.
callid - New Call-ID.
cseq - New CSeq.
<<< Previous | Home | |
Transaction Module | Up |