Skip to content

Commit

Permalink
siputils: docs for functions encoding/decoding contact uri using params
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Jun 12, 2020
1 parent e2fd3c3 commit 1a7ab6a
Showing 1 changed file with 96 additions and 0 deletions.
96 changes: 96 additions & 0 deletions src/modules/siputils/doc/siputils_admin.xml
Expand Up @@ -1157,6 +1157,102 @@ if(is_first_hop()) { ... }
...
sip_p_charging_vector("g");
...
</programlisting>
</example>
</section>
<section id="siputils.f.contact_param_encode">
<title>
<function moreinfo="none">contact_param_encode(pname, saddr)</function>
</title>
<para>
This function encodes URI inside Contact headers by building a new
URI from 'saddr' parameter and adding a parameter with the name 'pname'
containing incoming URI encoded in Base64URL format.
</para>
<para>Meaning of the parameters is as follows:</para>
<itemizedlist>
<listitem>
<para><emphasis>pname</emphasis> - name of the new URI parameter to
hold the encoded incoming URI.
</para>
</listitem>
<listitem>
<para><emphasis>saddr</emphasis> - local server address, can be
host part, host-port part or host-port-params part.
</para>
</listitem>
</itemizedlist>
<para>
This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE.
</para>
<example>
<title><function>contact_param_encode</function> usage</title>
<programlisting format="linespecific">
...
if (is_method("REGISTER") and src_ip == 10.0.0.0/8) {
contact_param_encode("ksu", "1.2.3.4:5060;transport=tcp");
}
...
</programlisting>
</example>
</section>
<section id="siputils.f.contact_param_decode">
<title>
<function moreinfo="none">contact_param_decode(pname)</function>
</title>
<para>
This function decodes URI inside Contact headers by building a new
URI from 'pname' parameter, decoding its value from Base64URL.
</para>
<para>Meaning of the parameters is as follows:</para>
<itemizedlist>
<listitem>
<para><emphasis>pname</emphasis> - name of the incoming URI parameter
holding the encoded URI value.
</para>
</listitem>
</itemizedlist>
<para>
This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE.
</para>
<example>
<title><function>contact_param_decode</function> usage</title>
<programlisting format="linespecific">
...
if (is_method("REGISTER") and src_ip == 1.2.3.4) {
contact_param_decode("ksu");
}
...
</programlisting>
</example>
</section>
<section id="siputils.f.contact_param_decode_ruri">
<title>
<function moreinfo="none">contact_param_decode_uri(pname)</function>
</title>
<para>
This function decodes R-URI (request URI) by building a new
R-URI from 'pname' parameter, decoding its value from Base64URL.
</para>
<para>Meaning of the parameters is as follows:</para>
<itemizedlist>
<listitem>
<para><emphasis>pname</emphasis> - name of the incoming URI parameter
holding the encoded URI value.
</para>
</listitem>
</itemizedlist>
<para>
This function can be used from REQUEST_ROUTE.
</para>
<example>
<title><function>contact_param_decode_ruri</function> usage</title>
<programlisting format="linespecific">
...
if (is_method("INVITE") and src_ip == 1.2.3.4) {
contact_param_decode_ruri("ksu");
}
...
</programlisting>
</example>
</section>
Expand Down

0 comments on commit 1a7ab6a

Please sign in to comment.