Skip to content

Commit

Permalink
qrouting: Add the "table_name" modparam
Browse files Browse the repository at this point in the history
  • Loading branch information
liviuchircu committed Feb 12, 2020
1 parent b9ab017 commit d05cf2a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
19 changes: 19 additions & 0 deletions modules/qrouting/doc/qrouting_admin.xml
Expand Up @@ -113,6 +113,25 @@ modparam("qrouting", "db_url", "mysql://opensips:opensipsrw@localhost/opensips")
</example>
</section>

<section id="param_table_name" xreflabel="table_name">
<title><varname>table_name</varname> (string)</title>
<para>
The name of the quality-based routing profiles table.
</para>
<para>
<emphasis>
Default value is <emphasis role='bold'>"qr_profiles"</emphasis>.
</emphasis>
</para>
<example>
<title>Set <varname>table_name</varname> parameter</title>
<programlisting format="linespecific">

modparam("qrouting", "table_name", "qr_profiles_bak")
</programlisting>
</example>
</section>

<section id="param_history_span" xreflabel="history_span">
<title><varname>history_span</varname> (integer)</title>
<para>
Expand Down
8 changes: 5 additions & 3 deletions modules/qrouting/qrouting.c
Expand Up @@ -110,10 +110,11 @@ static cmd_export_t cmds[] = {
};

static param_export_t params[] = {
{"history_span", INT_PARAM, &history_span},
{"sampling_interval", INT_PARAM, &sampling_interval},
{"history_span", INT_PARAM, &history_span},
{"sampling_interval", INT_PARAM, &sampling_interval},
{"event_bad_dst_threshold", INT_PARAM, &event_bad_dst_threshold},
{"db_url", STR_PARAM, &db_url.s},
{"db_url", STR_PARAM, &db_url.s},
{"table_name", STR_PARAM, &qr_profiles_table.s},
{0, 0, 0}
};

Expand Down Expand Up @@ -392,6 +393,7 @@ static int qr_check_db(void)
db_con_t *qr_db_hdl;

init_db_url(db_url, 0);
qr_profiles_table.len = strlen(qr_profiles_table.s);

/* test the db */
if (db_bind_mod(&db_url, &qr_dbf)) {
Expand Down

0 comments on commit d05cf2a

Please sign in to comment.