User Tools

Site Tools


cookbooks:devel:transformations

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
cookbooks:devel:transformations [2020/01/21 20:56]
henningw [Parameters List Transformations]
cookbooks:devel:transformations [2020/08/28 20:58]
miconda [{uri.tosocket}]
Line 1: Line 1:
-====== Kamailio SIP Server v5.4.x (devel): Transformations ======+====== Transformations ====== 
 + 
 +Version: Kamailio SIP Server v5.5.x (devel)
  
 <code> <code>
Line 161: Line 163:
  
 Decode base64 encoded PV, handling missing trailing padding characters, and return value. Decode base64 encoded PV, handling missing trailing padding characters, and return value.
 +
 +==== {s.encode.base64url} ====
 +
 +Return base64-url encoding of PV value
 +
 +==== {s.decode.base64url} ====
 +
 +Decode base64-url encoded PV and return value
 +
 +==== {s.encode.base64urlt} ====
 +
 +Return base64-url encoding of PV value without trailing padding characters('=').
 +
 +
 +==== {s.decode.base64urlt} ====
 +
 +Decode base64-url encoded PV, handling missing trailing padding characters, and return value.
 +
 +
 ==== {s.escape.common} ==== ==== {s.escape.common} ====
  
Line 314: Line 335:
 </code> </code>
  
 +==== {s.rmws} ====
 +
 +Remove occurrences of whitespace characters (' ', '\t, '\r', '\n').
 +
 +<code c>
 +$(var(x){s.rmws})
 +</code>
 ==== {s.corehash,n} ==== ==== {s.corehash,n} ====
  
Line 351: Line 379:
 </code> </code>
  
 +
 +==== {s.urlencode.param} ====
 +
 +Encode the value for URL param format.
 +
 +==== {s.urldecode.param} ====
 +
 +Decode the value from URL param format.
  
 ===== URI Transformations ===== ===== URI Transformations =====
Line 428: Line 464:
 <code> <code>
 "sip:test@127.0.0.1:5060;transport=udp"{uri.tosocket} => "udp:127.0.0.1:5060" "sip:test@127.0.0.1:5060;transport=udp"{uri.tosocket} => "udp:127.0.0.1:5060"
 +</code>
 +
 +==== {uri.suri} ====
 +
 +Return the simple URI for routing, keeping only schema, user, host, port and transport parameter. If user, port and transport are not in the original value, they are also not in the returned value.
 +
 +Example:
 +
 +<code c>
 +$var(ouri) = "sip:alice@server.com:5060;nat=yes;transport=tcp;line=xyz";
 +$var(suri) = $(var(ouri){uri.suri}); # => "sip:alice@server.com:5060;transport=tcp"
 </code> </code>
 ===== Parameters List Transformations ===== ===== Parameters List Transformations =====
cookbooks/devel/transformations.txt · Last modified: 2022/04/08 18:08 by miconda