Skip to content

Commit

Permalink
doc: documentation for xavp_params_explode()
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Apr 19, 2015
1 parent 2b53f67 commit efa9b09
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 4 deletions.
33 changes: 29 additions & 4 deletions modules/pv/README
Expand Up @@ -41,6 +41,7 @@ Daniel-Constantin Mierla
4.3. is_int(pvar)
4.4. typeof(pvar, vtype)
4.5. not_empty(pvar)
4.6. xavp_params_explode(sparams, xname)

5. MI Commands

Expand All @@ -62,8 +63,9 @@ Daniel-Constantin Mierla
1.6. is_int() usage
1.7. typeof() usage
1.8. not_empty() usage
1.9. shv_set usage
1.10. shv_get usage
1.9. xavp_params_explode usage
1.10. shv_set usage
1.11. shv_get usage

Chapter 1. Admin Guide

Expand All @@ -88,6 +90,7 @@ Chapter 1. Admin Guide
4.3. is_int(pvar)
4.4. typeof(pvar, vtype)
4.5. not_empty(pvar)
4.6. xavp_params_explode(sparams, xname)

5. MI Commands

Expand Down Expand Up @@ -187,6 +190,7 @@ modparam("pv","avp_aliases","email=s:email_addr;tmp=i:100")
4.3. is_int(pvar)
4.4. typeof(pvar, vtype)
4.5. not_empty(pvar)
4.6. xavp_params_explode(sparams, xname)

4.1. pv_isset(pvar)

Expand Down Expand Up @@ -262,6 +266,27 @@ if (not_empty("$var(foo)")) {
}
...

4.6. xavp_params_explode(sparams, xname)

Convert a parameters string in xavp atributes.

The first parameter has to be a string in the format of SIP header
parameters (name1=value1;...;nameN=valueN). The second parameter is the
name of the root xavp to hold the pairs (nameX,valueX).

The values are stored as string type.

Function can be used from ANY ROUTE.

Example 1.9. xavp_params_explode usage
...
xavp_params_explode("a=b;c=d;e=d", "x");
# results in:
# $xavp(x=>a) = "b";
# $xavp(x=>c) = "d";
# $xavp(x=>e) = "f";
...

5. MI Commands

5.1. shv_set
Expand All @@ -285,7 +310,7 @@ if (not_empty("$var(foo)")) {
_value_
_empty_line_

Example 1.9. shv_set usage
Example 1.10. shv_set usage
...
$ kamctl fifo shv_set debug int 0
...
Expand All @@ -303,7 +328,7 @@ $ kamctl fifo shv_set debug int 0
_name_
_empty_line_

Example 1.10. shv_get usage
Example 1.11. shv_get usage
...
$ kamctl fifo shv_get debug
$ kamctl fifo shv_get
Expand Down
31 changes: 31 additions & 0 deletions modules/pv/doc/pv_admin.xml
Expand Up @@ -262,6 +262,37 @@ if (typeof("$var(foo)", "str")) {
if (not_empty("$var(foo)")) {
append_hf("X-Foo: $var(foo)\r\n");
}
...
</programlisting>
</example>
</section>
<section id="pv.f.xavp_params_explode">
<title>
<function moreinfo="none">xavp_params_explode(sparams, xname)</function>
</title>
<para>
Convert a parameters string in xavp atributes.
</para>
<para>
The first parameter has to be a string in the format of SIP header
parameters (name1=value1;...;nameN=valueN). The second parameter
is the name of the root xavp to hold the pairs (nameX,valueX).
</para>
<para>
The values are stored as string type.
</para>
<para>
Function can be used from ANY ROUTE.
</para>
<example>
<title><function>xavp_params_explode</function> usage</title>
<programlisting format="linespecific">
...
xavp_params_explode("a=b;c=d;e=d", "x");
# results in:
# $xavp(x=&gt;a) = "b";
# $xavp(x=&gt;c) = "d";
# $xavp(x=&gt;e) = "f";
...
</programlisting>
</example>
Expand Down

0 comments on commit efa9b09

Please sign in to comment.