From 1a7ab6a5fc9b02f9e431e6d21f652de6283489c0 Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Fri, 12 Jun 2020 11:07:16 +0200 Subject: [PATCH] siputils: docs for functions encoding/decoding contact uri using params --- src/modules/siputils/doc/siputils_admin.xml | 96 +++++++++++++++++++++ 1 file changed, 96 insertions(+) diff --git a/src/modules/siputils/doc/siputils_admin.xml b/src/modules/siputils/doc/siputils_admin.xml index a430f85cc9c..25336cc2073 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"); ... + + + +
+ + <function moreinfo="none">contact_param_encode(pname, saddr)</function> + + + 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. + + Meaning of the parameters is as follows: + + + pname - name of the new URI parameter to + hold the encoded incoming URI. + + + + saddr - local server address, can be + host part, host-port part or host-port-params part. + + + + + This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE. + + + <function>contact_param_encode</function> usage + +... +if (is_method("REGISTER") and src_ip == 10.0.0.0/8) { + contact_param_encode("ksu", "1.2.3.4:5060;transport=tcp"); +} +... + + +
+
+ + <function moreinfo="none">contact_param_decode(pname)</function> + + + This function decodes URI inside Contact headers by building a new + URI from 'pname' parameter, decoding its value from Base64URL. + + Meaning of the parameters is as follows: + + + pname - name of the incoming URI parameter + holding the encoded URI value. + + + + + This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE. + + + <function>contact_param_decode</function> usage + +... +if (is_method("REGISTER") and src_ip == 1.2.3.4) { + contact_param_decode("ksu"); +} +... + + +
+
+ + <function moreinfo="none">contact_param_decode_uri(pname)</function> + + + This function decodes R-URI (request URI) by building a new + R-URI from 'pname' parameter, decoding its value from Base64URL. + + Meaning of the parameters is as follows: + + + pname - name of the incoming URI parameter + holding the encoded URI value. + + + + + This function can be used from REQUEST_ROUTE. + + + <function>contact_param_decode_ruri</function> usage + +... +if (is_method("INVITE") and src_ip == 1.2.3.4) { + contact_param_decode_ruri("ksu"); +} +...