Kamailio-开源SIP软交换平台

中国第一个专注Kamailio SIP 软交换技术分享平台

用户工具

站点工具


uri_db_uri_operations_with_database_support_module_released

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

uri_db_uri_operations_with_database_support_module_released [2017/09/11 17:40] (当前版本)
james_zhu 创建
行 1: 行 1:
 +====== uri_db Module ======
  
 +==== Jan Janak ====
 +
 +FhG FOKUS\\ ​
 +
 +=== Edited by ===
 +
 +==== Jan Janak ====
 +
 +=== Edited by ===
 +
 +==== Bogdan-Andrei Iancu ====
 +
 +Copyright © 2003 FhG FOKUS
 +
 +Copyright © 2005 Voice Sistem SRL
 +
 +----
 +
 +**Table of Contents**
 +
 +  * **1. Admin Guide** ​
 +    * **1. Overview** ​
 +    * **2. Dependencies** ​
 +      * **2.1. Kamailio Modules** ​
 +      * **2.2. External Libraries or Applications** ​
 +    * **3. Parameters** ​
 +      * **3.1. db_url (string)** ​
 +      * **3.2. db_table (string)** ​
 +      * **3.3. user_column (string)** ​
 +      * **3.4. domain_column (string)** ​
 +      * **3.5. uriuser_column (string)** ​
 +      * **3.6. use_uri_table (integer)** ​
 +      * **3.7. use_domain (integer)** ​
 +    * **4. Functions** ​
 +      * **4.1. check_to()** ​
 +      * **4.2. check_from()** ​
 +      * **4.3. check_uri(uri)** ​
 +      * **4.4. does_uri_exist()** ​
 +
 +**List of Examples**
 +
 +  * **1.1. Set db_url parameter** ​
 +  * **1.2. Set uri_table parameter** ​
 +  * **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. check_uri usage** ​
 +  * **1.11. does_uri_exist usage** ​
 +
 +====== Chapter 1. Admin Guide ======
 +
 +**Table of Contents**
 +
 +  * **1. Overview** ​
 +  * **2. Dependencies** ​
 +    * **2.1. Kamailio Modules** ​
 +    * **2.2. External Libraries or Applications** ​
 +  * **3. Parameters** ​
 +    * **3.1. db_url (string)** ​
 +    * **3.2. db_table (string)** ​
 +    * **3.3. user_column (string)** ​
 +    * **3.4. domain_column (string)** ​
 +    * **3.5. uriuser_column (string)** ​
 +    * **3.6. use_uri_table (integer)** ​
 +    * **3.7. use_domain (integer)** ​
 +  * **4. Functions** ​
 +    * **4.1. check_to()** ​
 +    * **4.2. check_from()** ​
 +    * **4.3. check_uri(uri)** ​
 +    * **4.4. does_uri_exist()** ​
 +
 +===== 1. Overview =====
 +
 +Various checks related to SIP URI.
 +
 +===== 2. Dependencies =====
 +
 +==== 2.1. Kamailio Modules ====
 +
 +The following modules must be loaded before this module:
 +
 +  * a Kamailio database module . 
 +
 +==== 2.2. External Libraries or Applications ====
 +
 +The following libraries or applications must be installed before running Kamailio with this module loaded:
 +
 +  * None. 
 +
 +===== 3. Parameters =====
 +
 +==== 3.1. db_url (string) ====
 +
 +URL of the database to be used.
 +
 +If the db_url string is empty, the default database URL will be used.
 +
 +Default value is “mysql:​%%//​%%kamailioro:​kamailioro@localhost/​kamailio”.
 +
 +**Example 1.1. Set ''​db_url''​ parameter**
 +
 +<​code>​
 +...
 +modparam("​uri_db",​ "​db_url",​ "​mysql://​username:​password@localhost/​openser"​)
 +...
 +</​code>​
 +
 +\\ ==== 3.2. db_table (string) ====
 +
 +The DB table that should be used. Its possible to use the “subscriber” and “uri” table. If the “uri” table should be used, an additional parameter “use-uri-table”) must be set.
 +
 +Default value is “subscriber”.
 +
 +**Example 1.2. Set ''​uri_table''​ parameter**
 +
 +<​code>​
 +...
 +modparam("​uri_db",​ "​db_table",​ "​uri"​)
 +...
 +</​code>​
 +
 +\\ ==== 3.3. user_column (string) ====
 +
 +Column holding usernames in the table.
 +
 +Default value is “username”.
 +
 +**Example 1.3. Set ''​user_column''​ parameter**
 +
 +<​code>​
 +...
 +modparam("​uri_db",​ "​user_column",​ "​username"​)
 +...
 +</​code>​
 +
 +\\ ==== 3.4. domain_column (string) ====
 +
 +Column holding domain in the table.
 +
 +Default value is “domain”.
 +
 +**Example 1.4. Set ''​domain_column''​ parameter**
 +
 +<​code>​
 +...
 +modparam("​uri_db",​ "​domain_column",​ "​domain"​)
 +...
 +</​code>​
 +
 +\\ ==== 3.5. uriuser_column (string) ====
 +
 +Column holding URI username in the table.
 +
 +Default value is “uri_user”.
 +
 +**Example 1.5. Set ''​uriuser_column''​ parameter**
 +
 +<​code>​
 +...
 +modparam("​uri_db",​ "​uriuser_column",​ "​uri_user"​)
 +...
 +</​code>​
 +
 +\\ ==== 3.6. use_uri_table (integer) ====
 +
 +Specify if the “uri” table should be used for checkings instead of “subscriber” table. A non-zero value means true.
 +
 +Default value is “0 (false)”.
 +
 +**Example 1.6. Set ''​use_uri_table''​ parameter**
 +
 +<​code>​
 +...
 +modparam("​uri_db",​ "​use_uri_table",​ 1)
 +...
 +</​code>​
 +
 +\\ ==== 3.7. use_domain (integer) ====
 +
 +Specify if the domain part of the URI should be used to identify the users (along with username). This is useful in multi domain setups, a non-zero value means true.
 +
 +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.
 +
 +Default value is “0 (false)”.
 +
 +**Example 1.7. Set ''​use_domain''​ parameter**
 +
 +<​code>​
 +...
 +modparam("​uri_db",​ "​use_domain",​ 1)
 +...
 +</​code>​
 +
 +\\ ===== 4. Functions =====
 +
 +==== 4.1. check_to() ====
 +
 +Check “To” username against URI table (if use_uri_table is set) or digest credentials (no DB backend required).
 +
 +This function can be used from REQUEST_ROUTE.
 +
 +**Example 1.8. ''​check_to''​ usage**
 +
 +<​code>​
 +...
 +if (check_to()) {
 +        ...
 +};
 +...
 +</​code>​
 +
 +\\ ==== 4.2. check_from() ====
 +
 +Check “From” username against URI table (if use_uri_table is set) or digest credentials (no DB backend required).
 +
 +This function can be used from REQUEST_ROUTE.
 +
 +**Example 1.9. ''​check_from''​ usage**
 +
 +<​code>​
 +...
 +if (check_from()) {
 +        ...
 +};
 +...
 +</​code>​
 +
 +\\ ==== 4.3. check_uri(uri) ====
 +
 +Check the username from the given uri against URI table (if use_uri_table is set) or digest credentials (no DB backend required).
 +
 +Description of parameters:
 +
 +  * uri Has to be a valid SIP URI, used to extract the username from. The parameter can be a static or dynamic (with variables) string. ​
 +
 +This function can be used from REQUEST_ROUTE.
 +
 +**Example 1.10. ''​check_uri''​ usage**
 +
 +<​code>​
 +...
 +if (check_uri("​$var(uri)"​)) {
 +        ...
 +};
 +...
 +</​code>​
 +
 +\\ ==== 4.4. does_uri_exist() ====
 +
 +Check if username in the request URI belongs to an existing user.
 +
 +The checking is done against the URI table (if use_uri_table is set) or the subscriber table.
 +
 +This function can be used from REQUEST_ROUTE.
 +
 +**Example 1.11. ''​does_uri_exist''​ usage**
 +
 +<​code>​
 +...
 +if (does_uri_exist()) {
 +        ...
 +};
 +...
 +</​code>​
 +
 +\\
uri_db_uri_operations_with_database_support_module_released.txt · 最后更改: 2017/09/11 17:40 由 james_zhu