Module: kamailio Branch: master Commit: 2cae9f8a301befb0a00f1831c9d5773924e35c10 URL: https://github.com/kamailio/kamailio/commit/2cae9f8a301befb0a00f1831c9d57739...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2017-07-25T19:41:05+02:00
dialplan: added documentation for dp_match() and dp_translate()
---
Modified: src/modules/dialplan/doc/dialplan_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/2cae9f8a301befb0a00f1831c9d57739... Patch: https://github.com/kamailio/kamailio/commit/2cae9f8a301befb0a00f1831c9d57739...
---
diff --git a/src/modules/dialplan/doc/dialplan_admin.xml b/src/modules/dialplan/doc/dialplan_admin.xml index 8153974401..073c2b24ed 100644 --- a/src/modules/dialplan/doc/dialplan_admin.xml +++ b/src/modules/dialplan/doc/dialplan_admin.xml @@ -394,6 +394,103 @@ modparam("dialplan", "match_dynamic", 1) <section> <title>Functions</title>
+ <section id="dialplan.p.dp_replace"> + <title> + <function moreinfo="none">dp_replace(dpid, inval, outvar)</function> + </title> + <para> + The function translates the input value 'inval' using the rules with dialplan + id 'dpid', storing the value in the variable 'outvar'. If the rule that was + applied has attributes, they are stored in the variable provided via the + module parameter 'attrs_pvar'. + </para> + <para> + The behavior is same as dp_translate("dpid", "inval/outvar"), but the + parameters have a more flexible format. + </para> + <para>Meaning of the parameters is as follows:</para> + <itemizedlist> + <listitem> + <para> + <emphasis>dpid</emphasis> - the dialplan id to match the rules and apply + the transformations. It can be a static string or a config variable + holding an integer value. + </para> + </listitem> + <listitem> + <para> + <emphasis>inval</emphasis> - input value. It can be a static or a + dynamic string. The dynamic string can contain config variables, + combined or not with static strings, that are evaluated at runtime. + </para> + </listitem> + <listitem> + <para> + <emphasis>outvar</emphasis> - output variable name. The value resulted + after applying the matching rule is stored in this variable. The name + must refer to a writable variable. + </para> + </listitem> + </itemizedlist> + <para> + This function can be used from ANY_ROUTE. + </para> + <example> + <title><function>dp_replace</function> usage</title> + <programlisting format="linespecific"> +... +dp_replace("240", "$rU", "$var(newru)"); +xlog("'$rU' was translated to '$var(newru)'\n"); +dp_replace("240", "+49$rU", "$var(newval)"); +... + </programlisting> + </example> + </section> + + <section id="dialplan.p.dp_match"> + <title> + <function moreinfo="none">dp_match(dpid, inval)</function> + </title> + <para> + The function matches the input value 'inval' using the rules with dialplan + id 'dpid'. If the rule that was applied has attributes, they are stored in + the variable provided via the module parameter 'attrs_pvar'. + </para> + <para> + The behavior is same as dp_translate("dpid", "inval"), but the + parameters have a more flexible format. + </para> + <para>Meaning of the parameters is as follows:</para> + <itemizedlist> + <listitem> + <para> + <emphasis>dpid</emphasis> - the dialplan id to match the rules and apply + the transformations. It can be a static string or a config variable + holding an integer value. + </para> + </listitem> + <listitem> + <para> + <emphasis>inval</emphasis> - input value. It can be a static or a + dynamic string. The dynamic string can contain config variables, + combined or not with static strings, that are evaluated at runtime. + </para> + </listitem> + </itemizedlist> + <para> + This function can be used from ANY_ROUTE. + </para> + <example> + <title><function>dp_match</function> usage</title> + <programlisting format="linespecific"> +... +dp_match("240", "+49$rU"); +xlog("the attributes associated with '+49$rU' are '$var(attrs)'\n"); +... + </programlisting> + </example> + </section> + <section id="dialplan.p.dp_translate"> <title> <function moreinfo="none">dp_translate(id, [src[/dest]])</function>