← Volver al índice de módulos

pdt

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 pref
🛠️ Utilidades y Varios Kamailio 6.1 20 parámetros 8 funciones

Descripción general

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

Documentación oficial: https://www.kamailio.org/docs/modules/stable/modules/pdt.html
Código fuente: https://github.com/kamailio/kamailio/tree/master/src/modules/pdt

Parámetros de configuración

ParámetroTipoDescripció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.

Funciones exportadas

prefix2domain(rewrite_mode, multidomain_mode)

4.2. prefix2domain(rewrite_mode) 4.3. prefix2domain() 4.4. pd_translate(sdomain, rewrite_mode)

prefix2domain(rewrite_mode)

4.3. prefix2domain() 4.4. pd_translate(sdomain, rewrite_mode)

prefix2domain()

4.4. pd_translate(sdomain, rewrite_mode)

pd_translate(sdomain, rewrite_mode)

4.1. prefix2domain(rewrite_mode, multidomain_mode)

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

prefix2domain(rewrite_mode)

The same as prefix2domain(rewrite_mode, "0"), that is without multidomain support, translation of URI being done regardless of the source domain. ... prefix2domain("2"); ...

prefix2domain()

The same as prefix2domain("0", "0"). ... prefix2domain(); ...

pd_translate(sdomain, rewrite_mode)

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.

Autores y contribuidores

Elena-Ramona Modroiu <ramona@asipto.com>

Copyright © 2003 FhG FOKUS
Copyright © 2004 Voice Sistem SRL
Copyright © 2008 Elena-Ramona Modroiu

Módulos relacionados

auth_web3 auth_xkeys avp avpops benchmark blst call_control call_obj