modules_k/uri_db/README
31ccf6a2
 uri_db Module
 
 Jan Janak
 
    FhG FOKUS
 
 Edited by
 
 Jan Janak
 
d77df08a
 Edited by
 
31ccf6a2
 Bogdan-Andrei Iancu
 
    Copyright � 2003 FhG FOKUS
 
    Copyright � 2005 voice-system.ro
d77df08a
    Revision History
0ded7f06
    Revision $Revision$ $Date: 2008-08-06 12:08:33 +0200
989206bd
                               (Mi, 06 Aug 2008) $
      __________________________________________________________
31ccf6a2
 
    Table of Contents
d77df08a
 
9fc784c6
    1. Admin Guide
31ccf6a2
 
         1.1. Overview
         1.2. Dependencies
 
37e4f522
               1.2.1. Kamailio Modules
31ccf6a2
               1.2.2. External Libraries or Applications
 
         1.3. Exported Parameters
 
               1.3.1. db_url (string)
22204e87
               1.3.2. db_table (string)
               1.3.3. user_column (string)
               1.3.4. domain_column (string)
               1.3.5. uriuser_column (string)
               1.3.6. use_uri_table (integer)
               1.3.7. use_domain (integer)
31ccf6a2
 
         1.4. Exported Functions
 
989206bd
               1.4.1. check_to()
               1.4.2. check_from()
               1.4.3. does_uri_exist()
31ccf6a2
 
    List of Examples
d77df08a
 
    1.1. Set db_url parameter
    1.2. Set uri_table parameter
22204e87
    1.3. Set user_column parameter
    1.4. Set domain_column parameter
    1.5. Set uriuser_column parameter
    1.6. Set use_uri_table parameter
    1.7. Set use_domain parameter
    1.8. check_to usage
    1.9. check_from usage
    1.10. does_uri_exist usage
31ccf6a2
 
9fc784c6
 Chapter 1. Admin Guide
31ccf6a2
 
 1.1. Overview
 
    Various checks related to SIP URI.
 
 1.2. Dependencies
 
37e4f522
 1.2.1. Kamailio Modules
31ccf6a2
 
    The following modules must be loaded before this module:
37e4f522
      * a Kamailio database module .
31ccf6a2
 
 1.2.2. External Libraries or Applications
 
    The following libraries or applications must be installed
37e4f522
    before running Kamailio with this module loaded:
31ccf6a2
      * None.
 
 1.3. Exported Parameters
 
 1.3.1. db_url (string)
 
    URL of the database to be used.
 
989206bd
    If the db_url string is empty, the default database URL will be
    used.
db73e47c
 
7e795dbe
    Default value is
989206bd
    "mysql://openserro:openserro@localhost/openser".
31ccf6a2
 
d77df08a
    Example 1.1. Set db_url parameter
31ccf6a2
 ...
989206bd
 modparam("uri_db", "db_url", "mysql://username:password@localhost/opense
 r")
31ccf6a2
 ...
 
22204e87
 1.3.2. db_table (string)
31ccf6a2
 
22204e87
    The DB table that should be used. Its possible to use the
7e795dbe
    "subscriber" and "uri" table. If the "uri" table should be
    used, an additional parameter (Section 1.3.6, "use_uri_table
    (integer)") must be set.
31ccf6a2
 
989206bd
    Default value is "subscriber".
31ccf6a2
 
d77df08a
    Example 1.2. Set uri_table parameter
31ccf6a2
 ...
22204e87
 modparam("uri_db", "db_table", "uri")
31ccf6a2
 ...
 
22204e87
 1.3.3. user_column (string)
31ccf6a2
 
22204e87
    Column holding usernames in the table.
31ccf6a2
 
989206bd
    Default value is "username".
31ccf6a2
 
22204e87
    Example 1.3. Set user_column parameter
31ccf6a2
 ...
22204e87
 modparam("uri_db", "user_column", "username")
31ccf6a2
 ...
 
22204e87
 1.3.4. domain_column (string)
31ccf6a2
 
22204e87
    Column holding domain in the table.
31ccf6a2
 
989206bd
    Default value is "domain".
31ccf6a2
 
22204e87
    Example 1.4. Set domain_column parameter
31ccf6a2
 ...
22204e87
 modparam("uri_db", "domain_column", "domain")
31ccf6a2
 ...
 
22204e87
 1.3.5. uriuser_column (string)
31ccf6a2
 
22204e87
    Column holding URI username in the table.
31ccf6a2
 
989206bd
    Default value is "uri_user".
31ccf6a2
 
22204e87
    Example 1.5. Set uriuser_column parameter
d77df08a
 ...
22204e87
 modparam("uri_db", "uriuser_column", "uri_user")
31ccf6a2
 ...
 
22204e87
 1.3.6. use_uri_table (integer)
31ccf6a2
 
989206bd
    Specify if the "uri" table should be used for checkings instead
    of "subscriber" table. A non-zero value means true.
31ccf6a2
 
989206bd
    Default value is "0 (false)".
31ccf6a2
 
22204e87
    Example 1.6. Set use_uri_table parameter
31ccf6a2
 ...
d1960b93
 modparam("uri_db", "use_uri_table", 1)
31ccf6a2
 ...
 
22204e87
 1.3.7. use_domain (integer)
31ccf6a2
 
    Specify if the domain part of the URI should be used to
a1747a8b
    identify the users (along with username). This is useful in
    multi domain setups, a non-zero value means true.
 
989206bd
    This parameter is only evaluated for calls to "does_uri_exist",
    all other functions checks the digest username and realm
    against the given username, if the "uri" table is used.
31ccf6a2
 
989206bd
    Default value is "0 (false)".
31ccf6a2
 
22204e87
    Example 1.7. Set use_domain parameter
31ccf6a2
 ...
d1960b93
 modparam("uri_db", "use_domain", 1)
31ccf6a2
 ...
 
 1.4. Exported Functions
 
d77df08a
 1.4.1.  check_to()
31ccf6a2
 
db73e47c
    Check To username against URI table (if use_uri_table is set)
    or digest credentials (no DB backend required).
31ccf6a2
 
bfcbd22f
    This function can be used from REQUEST_ROUTE.
 
22204e87
    Example 1.8. check_to usage
31ccf6a2
 ...
 if (check_to()) {
         ...
 };
 ...
 
d77df08a
 1.4.2.  check_from()
31ccf6a2
 
989206bd
    Check From username against URI table (if use_uri_table is set)
    or digest credentials (no DB backend required).
31ccf6a2
 
bfcbd22f
    This function can be used from REQUEST_ROUTE.
 
22204e87
    Example 1.9. check_from usage
31ccf6a2
 ...
 if (check_from()) {
         ...
 };
 ...
 
d77df08a
 1.4.3.  does_uri_exist()
31ccf6a2
 
    Check if username in the request URI belongs to an existing
    user.
 
db73e47c
    As the checking is done against URI table (if use_uri_table is
1defd2f7
    set) or subscriber table.
db73e47c
 
bfcbd22f
    This function can be used from REQUEST_ROUTE.
 
22204e87
    Example 1.10. does_uri_exist usage
31ccf6a2
 ...
 if (does_uri_exist()) {
         ...
 };
 ...