Module: kamailio
Branch: master
Commit: 1a7ab6a5fc9b02f9e431e6d21f652de6283489c0
URL:
https://github.com/kamailio/kamailio/commit/1a7ab6a5fc9b02f9e431e6d21f652de…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-06-12T11:07:46+02:00
siputils: docs for functions encoding/decoding contact uri using params
---
Modified: src/modules/siputils/doc/siputils_admin.xml
---
Diff:
https://github.com/kamailio/kamailio/commit/1a7ab6a5fc9b02f9e431e6d21f652de…
Patch:
https://github.com/kamailio/kamailio/commit/1a7ab6a5fc9b02f9e431e6d21f652de…
---
diff --git a/src/modules/siputils/doc/siputils_admin.xml
b/src/modules/siputils/doc/siputils_admin.xml
index a430f85cc9..25336cc207 100644
--- a/src/modules/siputils/doc/siputils_admin.xml
+++ b/src/modules/siputils/doc/siputils_admin.xml
@@ -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>