This module translates a numerical prefix into a domain and updates accordingly the request URI. The module looks up at the R-URI part of a message and if the user part begins with an established prefix it will update the URI. Updating the uri consists of: remove the prefix from the user part of the uri and keep the rest as the user part of the new uri. The host and port are changed with the domain matched for the leading prefix and the domain in From URI. <prefix><userid><:password>@<mydomain.com> ... and the result will be: <userid><:password>@<domain[:port]>... Example 1.1. prefix-domain translation prefix=123, domain(FROM)=siphub.org entry in database: sdomain=siphub.org domain[123]=alpha.org domain[124]=beta.org domain[125]=gamma.org The RURI will be updated in the following way" sip:12391001@mydomain.com => sip:91001@alpha.org The prefix could be prefixed by other digits. These digits will not be used to look up the domain (the classic example, 00 used for international calls, then follows the country prefix). For more information on this, see 'prefix' parameter. * A sample config file is located in './doc/'. * MySQL script to create the database needed by PDT is located in '../../scripts/mysql/pdt-create.sql' The database is loaded by Kamailio only at start up time and only cache is used to lookup domains. Check the MI Functions for adding/deleting prefix-domain pairs or reloading from database at runtime. * Sample shell scripts to manage prefix-domain pairs are also l
| Parámetro | Tipo | Descripción |
|---|---|---|
| db_url | string | 3.2. db_table (string) 3.3. sdomain_column (string) 3.4. prefix_column (string) 3.5. domain_column (string) 3.6. prefix (string) 3.7. fetch_rows (integer) 3.8. char_list (string) 3.9. check_domain (in |
| db_table | string | 3.3. sdomain_column (string) 3.4. prefix_column (string) 3.5. domain_column (string) 3.6. prefix (string) 3.7. fetch_rows (integer) 3.8. char_list (string) 3.9. check_domain (integer) 3.10. mode (inte |
| sdomain_column | string | 3.4. prefix_column (string) 3.5. domain_column (string) 3.6. prefix (string) 3.7. fetch_rows (integer) 3.8. char_list (string) 3.9. check_domain (integer) 3.10. mode (integer) |
| prefix_column | string | 3.5. domain_column (string) 3.6. prefix (string) 3.7. fetch_rows (integer) 3.8. char_list (string) 3.9. check_domain (integer) 3.10. mode (integer) |
| domain_column | string | 3.6. prefix (string) 3.7. fetch_rows (integer) 3.8. char_list (string) 3.9. check_domain (integer) 3.10. mode (integer) |
| prefix | string | 3.7. fetch_rows (integer) 3.8. char_list (string) 3.9. check_domain (integer) 3.10. mode (integer) |
| fetch_rows | integer | 3.8. char_list (string) 3.9. check_domain (integer) 3.10. mode (integer) |
| char_list | string | 3.9. check_domain (integer) 3.10. mode (integer) |
| check_domain | integer | 3.10. mode (integer) |
| mode | integer | 3.1. db_url (string) |
| db_url | string | URL of the database table to be used. |
| db_table | string | Table name. |
| sdomain_column | string | Name of 'sdomain' column. |
| prefix_column | string | Name of 'prefix' column. |
| domain_column | string | Name of 'domain' column. |
| prefix | string | Default leading prefix who denotes what URI needs to be translated - if it is NULL the module will not check the R-URI against it and the PDT prefix is considered starting from the first digit. Otherw |
| fetch_rows | integer | Number of rows to be loaded in one step from database. |
| char_list | string | The list with characters allowed in prefix. |
| check_domain | integer | Module will check if destination domain is duplicated for same source domain (1 - check; 0 - don't check). |
| mode | integer | If set to 1, duplicated prefixes are ingnored and starting continues, if 0, then starting or loading fails. |
4.2. prefix2domain(rewrite_mode) 4.3. prefix2domain() 4.4. pd_translate(sdomain, rewrite_mode)
4.3. prefix2domain() 4.4. pd_translate(sdomain, rewrite_mode)
4.4. pd_translate(sdomain, rewrite_mode)
4.1. prefix2domain(rewrite_mode, multidomain_mode)
Build a new URI if it is necessary. Returns 1 when the translation was made or there was nothing to translate (user part of the URI is empty, it does not match the prefix parameter or there is no domain associated with a possible prefix from user par
The same as prefix2domain(rewrite_mode, "0"), that is without multidomain support, translation of URI being done regardless of the source domain. ... prefix2domain("2"); ...
The same as prefix2domain("0", "0"). ... prefix2domain(); ...
Translate R-URI based on source domain and longest prefix matching. Returns 1 when the translation was made or there was nothing to translate. Returns -1 in error cases.
Copyright © 2003 FhG FOKUS
Copyright © 2004 Voice Sistem SRL
Copyright © 2008 Elena-Ramona Modroiu