📄 lcr_user.sgml
字号:
<!-- Module User's Guide --><chapter> <chapterinfo> <revhistory> <revision> <revnumber>$Revision: 1.10 $</revnumber> <date>$Date: 2006/04/28 09:20:28 $</date> </revision> </revhistory> </chapterinfo> <title>User's Guide</title> <section> <title>Overview</title> <para> Least cost routing (LCR) module implements two related capabilities: </para> <para> <itemizedlist> <listitem> <para> sequential forwarding of a request to one or more gateways (functions load_gws and next_gw) </para> </listitem> <listitem> <para> sequential forwarding to contacts if they don't share the the same qvalue (functions load_contacts and next_contacts). </para> </listitem> </itemizedlist> </para> <para> Gateway selection is based on caller's RPID URI (if available in caller's RPID AVP after authentication) or From URI and user part of Request-URI (telephone number). A gateway matches a request if user part of Request-URI and "From" URI match the prefix and From pattern of the gateway. Matching gateways are then ordered for forwarding purpose (1) according to longest user part match, (2) according to gateway's priority, and (3) randomly. </para> <para> Each gateway belongs to a gateway group either alone or among other gateways. All gateways in a group share the same priority. </para> <para> Gateway and routing information is kept in two tables: gw and lcr. </para> <para> When a gateway is selected, the Request-URI user part is stripped by the number of digits specified in the strip parameter. Subsequently, the Request-URI is rewritten with information from gw table: URI scheme, prefix, IP address, port, and transport protocol. Valid URI scheme values are NULL = sip, 1 = sip and 2 = sips. Prefix is appended in front of Request-URI user part. Currently valid transport protocol values are NULL = none, 1 = udp, 2 = tcp, and 3 = tls. </para> <para> Table lcr contains prefix of user part of Request-URI, From URI, gateway group id, and priority. From URI can contain special characters % and _ matching any number of any characters and any one character, respectively, if db_mod parameter is set to 0. If db_mod parameter is set to 1, then From URI is a regular expression. </para> <para> In addition to gw and lcr tables there is third table gw_grp that is used to associate names with gateway group ids. </para> </section> <section> <title>Dependencies</title> <section> <title>&ser; modules</title> <para> The following modules must be loaded before this module: <itemizedlist> <listitem> <para> <emphasis>TM module</emphasis> </para> </listitem> <listitem> <para> <emphasis>A database module like mysql, postgres or dbtext</emphasis>. </para> </listitem> </itemizedlist> </para> </section> <section> <title>External libraries or applications</title> <para> The following libraries or applications must be installed before running &ser; with this module: <itemizedlist> <listitem> <para> <emphasis>none</emphasis>. </para> </listitem> </itemizedlist> </para> </section> </section> <section> <title>Exported Parameters</title> <section> <title><varname>db_url</varname> (string)</title> <para> &url; of the database table to be used. </para> <para> <emphasis> Default value is <quote>mysql://openserro:openserro@localhost/openser</quote>. </emphasis> </para> <example> <title>Setting <varname>db_url</varname> module parameter</title> <programlisting format="linespecific">...modparam("lcr","db_url","mysql://muser:pwd@localhost/openser")...</programlisting> </example> </section><section> <title><varname>gw_table</varname> (string)</title> <para> Name of the table holding the gateways definitions. </para> <para> <emphasis> Default value is <quote>gw</quote>. </emphasis> </para> <example> <title>Setting <varname>gw_table</varname> module parameter</title> <programlisting format="linespecific">...modparam("lcr","gw_table","gw")...</programlisting> </example> </section><section> <title><varname>gw_name_column</varname> (string)</title> <para> Name of the column holding the gateway name. </para> <para> <emphasis> Default value is <quote>gw_name</quote>. </emphasis> </para> <example> <title>Setting <varname>gw_name_column</varname> module parameter</title> <programlisting format="linespecific">...modparam("lcr","gw_name_column","gw_name")...</programlisting> </example> </section><section> <title><varname>ip_addr_column</varname> (string)</title> <para> Name of the column holding the IP address of the gateway. </para> <para> <emphasis> Default value is <quote>ip_addr</quote>. </emphasis> </para> <example> <title>Setting <varname>ip_addr_column</varname> module parameter</title> <programlisting format="linespecific">...modparam("lcr","ip_addr_column","ip_addr")...</programlisting> </example> </section><section> <title><varname>port_column</varname> (string)</title> <para> Name of the column holding the port number of the gateway. </para> <para> <emphasis> Default value is <quote>port</quote>. </emphasis> </para> <example> <title>Setting <varname>port_column</varname> module parameter</title> <programlisting format="linespecific">...modparam("lcr","port_column","port")...</programlisting> </example> </section><section> <title><varname>uri_scheme_column</varname> (string)</title> <para> Name of the column holding the uri scheme of the gateway. </para> <para> <emphasis> Default value is <quote>uri_scheme</quote>. </emphasis> </para> <example> <title>Setting <varname>uri_scheme_column</varname> module parameter</title> <programlisting format="linespecific">...modparam("lcr","uri_scheme_column","scheme")...</programlisting> </example> </section><section> <title><varname>transport_column</varname> (string)</title> <para> Name of the column holding the transport type to be used for the gateway. </para> <para> <emphasis> Default value is <quote>transport</quote>. </emphasis> </para> <example> <title>Setting <varname>transport_column</varname> module parameter</title> <programlisting format="linespecific">...modparam("lcr","transport_column","transport")...</programlisting> </example> </section><section> <title><varname>grp_id_column</varname> (string)</title> <para> Name of the column holding the group ID. </para> <para> <emphasis> Default value is <quote>grp_id</quote>. </emphasis> </para> <example> <title>Setting <varname>grp_id_column</varname> module parameter</title> <programlisting format="linespecific">...modparam("lcr","grp_id_column","grp_id")...</programlisting> </example> </section><section> <title><varname>lcr_table</varname> (string)</title> <para> Name of the table holding the LCR rules. </para> <para> <emphasis> Default value is <quote>lcr</quote>. </emphasis> </para> <example> <title>Setting <varname>lcr_table</varname> module parameter</title> <programlisting format="linespecific">...modparam("lcr","lcr_table","lcr")...</programlisting> </example> </section><section> <title><varname>strip_column</varname> (string)</title> <para> Name of the column holding the number of digits to strip from the RURI before applying the prefix. </para> <para> <emphasis> Default value is <quote>strip</quote>. </emphasis> </para> <example> <title>Setting <varname>strip_column</varname> module parameter</title> <programlisting format="linespecific">...modparam("lcr","strip_column","strip")...</programlisting> </example> </section><section> <title><varname>prefix_column</varname> (string)</title> <para> Name of the column holding the RURI(destination) prefix. </para> <para> <emphasis> Default value is <quote>prefix</quote>. </emphasis> </para> <example> <title>Setting <varname>prefix_column</varname> module parameter</title> <programlisting format="linespecific">...modparam("lcr","prefix_column","prefix")...</programlisting> </example> </section><section> <title><varname>from_uri_column</varname> (string)</title> <para> Name of the column holding the FROM (source) URI. </para> <para> <emphasis> Default value is <quote>from_uri</quote>. </emphasis> </para> <example> <title>Setting <varname>from_uri_column</varname> module parameter</title> <programlisting format="linespecific">...modparam("lcr","from_uri_column","from_uri")...</programlisting> </example> </section><section> <title><varname>priority_column</varname> (string)</title> <para> Name of the column holding the priority of the rule. </para> <para> <emphasis> Default value is <quote>priority</quote>. </emphasis> </para> <example> <title>Setting <varname>priority_column</varname> module parameter </title> <programlisting format="linespecific">...modparam("lcr","priority_column","priority")...</programlisting> </example> </section><section> <title><varname>gw_uri_avp</varname> (string)</title> <para> Overrides the name of the AVP containing URI scheme, host, port, and transport of a gateway. If the string name of the AVP contains only digits, the name of the AVP is integer value of the string. </para> <para> <emphasis> Default value is <quote>1400</quote>. </emphasis> </para> <example> <title>Setting <varname>gw_uri_avp</varname> module parameter</title> <programlisting format="linespecific">...modparam("lcr","gw_uri_avp","1400")...</programlisting> </example> </section><section> <title><varname>ruri_user_avp</varname> (string)</title> <para> Overrides the name of the AVP containing user part of Request-URI after the first next_gw() call. If the string name of the AVP contains only digits, the name of the AVP is integer value of the string. </para> <para> <emphasis> Default value is <quote>1402</quote>. </emphasis> </para> <example> <title>Setting <varname>ruri_user_avp</varname> module parameter</title> <programlisting format="linespecific">...modparam("lcr","ruri_user_avp","500")...</programlisting> </example> </section><section> <title><varname>contact_avp</varname> (string)</title> <para> Overrides the name of the AVP containing the contact. If the string
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -