usrlocStandard User location module. The module keeps a user location table and provides access to the table to other modules. The module exports no functions that could be used directly from scripts. Jan Janak Copyright © 2003 FhG FOKUS
User location module. The module keeps a user location table and provides access to the table to other modules. The module exports no functions that could be used directly from scripts. The following modules must be loaded before this module:
Name of column containing usernames. Default value is "username". Name of column containing contacts. Default value is "contact". Name of column containing expires value. Default value is "expires". Name of column containing q values. Default value is "q". Name of column containing callid values. Default value is "callid". Name of column containing cseq numbers. Default value is "cseq". Name of column containing supported methods. Default value is "method". Name of column containing user-agent values. Default value is "user_agent". Name of column containing the source IP, port, and protocol from the REGISTER message. Default value is "received". URL of the database that should be used. Default value is "mysql://seri:heslo@localhost/ser". 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. Default value is 60. 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 four database accessing modes:
WarningIn 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. Default value is 0. 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 parameter 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. Meaning of the parameters is as follows:
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. Meaning of the parameters is as follows:
The function deletes all the contacts bound with the given Address Of Record. Meaning of the parameters is as follows:
The function returns pointer to record with given Address of Record. Meaning of the parameters is as follows:
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. Meaning of the parameters is as follows:
Unlock the specified domain previously locked by ul_lock_udomain. Meaning of the parameters is as follows:
Do some sanity checks - if all contacts have been removed, delete the entire record structure. Meaning of the parameters is as follows:
The function inserts a new contact in the given record with specified parameters. Meaning of the parameters is as follows:
The function deletes given contact from record. Meaning of the parameters is as follows:
The function tries to find contact with given Contact URI and returns pointer to structure representing the contact. Meaning of the parameters is as follows:
The function retrieves all contacts of all registered users and returns them in the caller-supplied buffer. If the buffer is too small, the function returns positive value indicating how much additional space would be necessary to accommodate all of them. Please note that the positive return value should be used only as a "hint", as there is no guarantee that during the time between two subsequent calls number of registered contacts will remain the same. If flag parameter is set to non-zero value then only contacts that have the specified flags set will be returned. It is, for example, possible to list only contacts that are behind NATi. Meaning of the parameters is as follows:
The function updates contact with new values. Meaning of the parameters is as follows:
|
Navigation |
||||