Skip to content

Commit

Permalink
avpops: remove avp_printf() from docs
Browse files Browse the repository at this point in the history
(cherry picked from commit 6151c7a)
(cherry picked from commit ec61c89)
  • Loading branch information
razvancrainea committed Dec 5, 2016
1 parent 331ea23 commit 34c94d4
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 108 deletions.
91 changes: 32 additions & 59 deletions modules/avpops/README
Expand Up @@ -10,7 +10,7 @@ Ramona-Elena Modroiu

<ramona@rosdev.ro>

Copyright © 2004-2008 Voice Sistem SRL
Copyright 2004-2008 Voice Sistem SRL
Revision History
Revision $Revision: 5901 $ $Date$
__________________________________________________________
Expand Down Expand Up @@ -50,12 +50,11 @@ Ramona-Elena Modroiu
1.5.6. avp_pushto(destination,name)
1.5.7. avp_check(name,op_value)
1.5.8. avp_copy(old_name,new_name)
1.5.9. avp_printf(dest, format)
1.5.10. avp_subst(avps, subst)
1.5.11. avp_op(name,op_value)
1.5.12. is_avp_set(name)
1.5.13. avp_print()
1.5.14. avp_insert(avp_name, value, index)
1.5.9. avp_subst(avps, subst)
1.5.10. avp_op(name,op_value)
1.5.11. is_avp_set(name)
1.5.12. avp_print()
1.5.13. avp_insert(avp_name, value, index)

List of Examples

Expand All @@ -79,12 +78,11 @@ Ramona-Elena Modroiu
1.18. avp_pushto usage
1.19. avp_check usage
1.20. avp_copy usage
1.21. avp_printf usage
1.22. avp_subst usage
1.23. avp_op usage
1.24. is_avp_set usage
1.21. avp_subst usage
1.22. avp_op usage
1.23. is_avp_set usage
1.24. avp_print usage
1.25. avp_print usage
1.26. avp_print usage

Chapter 1. Admin Guide

Expand Down Expand Up @@ -181,7 +179,7 @@ modparam("avpops","use_domain",1)

Name of column containing the uuid (unique user id).

Default value is uuid.
Default value is "uuid".

Example 1.5. Set uuid_column parameter
...
Expand All @@ -192,7 +190,7 @@ modparam("avpops","uuid_column","uuid")

Name of column containing the username.

Default value is username.
Default value is "username".

Example 1.6. Set username_column parameter
...
Expand All @@ -203,7 +201,7 @@ modparam("avpops","username_column","username")

Name of column containing the domain name.

Default value is domain.
Default value is "domain".

Example 1.7. Set domain_column parameter
...
Expand All @@ -214,7 +212,7 @@ modparam("avpops","domain_column","domain")

Name of column containing the attribute name (AVP name).

Default value is attribute.
Default value is "attribute".

Example 1.8. Set attribute_column parameter
...
Expand All @@ -225,7 +223,7 @@ modparam("avpops","attribute_column","attribute")

Name of column containing the AVP value.

Default value is value.
Default value is "value".

Example 1.9. Set value_column parameter
...
Expand All @@ -236,7 +234,7 @@ modparam("avpops","value_column","value")

Name of column containing the AVP type.

Default value is type.
Default value is "type".

Example 1.10. Set type_column parameter
...
Expand All @@ -258,7 +256,7 @@ modparam("avpops","type_column","type")
+ 'value_type='('integer'|'string')
+ 'table='string

Default value is NULL.
Default value is "NULL".

Example 1.11. Set db_scheme parameter
...
Expand All @@ -270,7 +268,7 @@ modparam("avpops","db_scheme",

Allocated size for AVP variables.

Default value is 1024.
Default value is "1024".

Example 1.12. Set buf_size parameter
...
Expand Down Expand Up @@ -309,7 +307,7 @@ modparam("avpops", "buf_size", 1024)
and 's'), the rest have the meaning descriped in 'AVP
naming format' chapter.
* db_id - reference to a defined DB URL (a numerical id) -
see the db_url module parameter.
see the "db_url" module parameter.
* prefix - static string which will precede the names of the
AVPs populated by this function.

Expand Down Expand Up @@ -389,14 +387,14 @@ avp_db_delete("$ru","$avp(1)","3");
query returned an empty result set, and -1 for all other
types of errors
* dest - a list with AVP names where to store the result. The
format is $avp(name1);$avp(name2);.... If this parameter
is ommited, the result is stored in $avp(1);$avp(2);....
format is "$avp(name1);$avp(name2);...". If this parameter
is ommited, the result is stored in "$avp(1);$avp(2);...".
If the result gives many rows, then multiple AVPs with
corresponding name will be added. The value type of the AVP
(string or integer) will be derived from the type of the
columns.
* db_id - reference to a defined DB URL (a numerical id) -
see the db_url module parameter.
see the "db_url" module parameter.

This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
BRANCH_ROUTE, LOCAL_ROUTE and ONREPLY_ROUTE.
Expand Down Expand Up @@ -528,32 +526,7 @@ avp_copy("$avp(678)", "$avp(345)/g");
avp_copy("$avp(old)","$avp(new)/gd");
...

1.5.9. avp_printf(dest, format)

NOTE: since OpenSIPS 1.3.0 the function has been moved to core
and it is an alias to pv_printf().

Prints the formatted string 'format' in the AVP 'dest'. The
'format' parameter can include any pseudo-variable defined in
OpenSIPS. The list with all pseudo-variables in OpenSIPS can be
found at: http://opensips.org/dokuwiki/.

Meaning of the parameters is as follows:
* dest - in which AVP should be stored the result. Parameter
syntax is:
+ name = ( avp_name | avp_alias )
* format - the formatted string to be printed in 'dest' AVP.

This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
BRANCH_ROUTE, LOCAL_ROUTE and ONREPLY_ROUTE.

Example 1.21. avp_printf usage
...
avp_printf("$avp(20)", "This is a $rm request with call-id $hdr(call-id)
");
...

1.5.10. avp_subst(avps, subst)
1.5.9. avp_subst(avps, subst)

Perl/sed-like subst applied to AVPs having string value.

Expand All @@ -579,7 +552,7 @@ avp_printf("$avp(20)", "This is a $rm request with call-id $hdr(call-id)
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
BRANCH_ROUTE, LOCAL_ROUTE and ONREPLY_ROUTE.

Example 1.22. avp_subst usage
Example 1.21. avp_subst usage
...
# if avp 678 has a string value in e-mail format, replace the
# domain part with the value of domain part from R-URI
Expand All @@ -597,7 +570,7 @@ avp_subst("$avp(678)/$avp(679)/g", "/(.*)@(.*)/\1@$rd/");
applied to all of them, after the first src_avp is processed,
it will be added in avp list and next processing will use it.

1.5.11. avp_op(name,op_value)
1.5.10. avp_op(name,op_value)

Different integer operations with avps.

Expand All @@ -624,13 +597,13 @@ avp_subst("$avp(678)/$avp(679)/g", "/(.*)@(.*)/\1@$rd/");
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
BRANCH_ROUTE, LOCAL_ROUTE and ONREPLY_ROUTE.

Example 1.23. avp_op usage
Example 1.22. avp_op usage
...
avp_op("$avp(678)", "add/345/g");
avp_op("$avp(number)","sub/$avp(number2)/d");
...

1.5.12. is_avp_set(name)
1.5.11. is_avp_set(name)

Check if any AVP with name is set.

Expand All @@ -643,32 +616,32 @@ avp_op("$avp(number)","sub/$avp(number2)/d");
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
BRANCH_ROUTE, LOCAL_ROUTE and ONREPLY_ROUTE.

Example 1.24. is_avp_set usage
Example 1.23. is_avp_set usage
...
if(is_avp_set("$avp(678)"))
log("AVP with integer id 678 exists\n");
...

1.5.13. avp_print()
1.5.12. avp_print()

Prints the list with all the AVPs from memory. This is only a
helper/debug function.

This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
BRANCH_ROUTE, LOCAL_ROUTE and ONREPLY_ROUTE.

Example 1.25. avp_print usage
Example 1.24. avp_print usage
...
avp_print();
...

1.5.14. avp_insert(avp_name, value, index)
1.5.13. avp_insert(avp_name, value, index)

This function inserts an avp value at a certain position
specified by the last parameter. If the index is greater than
the count of values the value will be inserted at the end.

Example 1.26. avp_print usage
Example 1.25. avp_print usage
...
avp_insert("avp(20)", "$hdr(From)", 2);
...
49 changes: 0 additions & 49 deletions modules/avpops/doc/avpops_admin.xml
Expand Up @@ -794,55 +794,6 @@ avp_check("$avp(foo)","fm/$avp(fm_avp)/g");
...
avp_copy("$avp(678)", "$avp(345)/g");
avp_copy("$avp(old)","$avp(new)/gd");
...
</programlisting>
</example>
</section>
<section>
<title>
<function moreinfo="none">avp_printf(dest, format)
</function>
</title>
<para>
NOTE: since &osips; 1.3.0 the function has been moved to core
and it is an alias to pv_printf().
</para>
<para>
Prints the formatted string 'format' in the AVP 'dest'. The
'format' parameter can include any pseudo-variable defined in
&osips;. The list with all pseudo-variables in &osips; can
be found at:
<ulink url="http://opensips.org/dokuwiki/">
http://opensips.org/dokuwiki/</ulink>.
</para>
<para>Meaning of the parameters is as follows:</para>
<itemizedlist>
<listitem>
<para><emphasis>dest</emphasis> - in which AVP should be
stored the result.
Parameter syntax is:
</para>
<itemizedlist>
<listitem><para><emphasis>
name = ( avp_name | avp_alias )
</emphasis></para></listitem>
</itemizedlist>
</listitem>
<listitem>
<para><emphasis>format</emphasis> - the formatted string
to be printed in 'dest' AVP.
</para>
</listitem>
</itemizedlist>
<para>
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
BRANCH_ROUTE, LOCAL_ROUTE and ONREPLY_ROUTE.
</para>
<example>
<title><function>avp_printf</function> usage</title>
<programlisting format="linespecific">
...
avp_printf("$avp(20)", "This is a $rm request with call-id $hdr(call-id)");
...
</programlisting>
</example>
Expand Down

0 comments on commit 34c94d4

Please sign in to comment.