cookbooks:3.2.x:transformations
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
cookbooks:3.2.x:transformations [2011/10/18 16:52] – [Kamailio SIP Server v3.2.x: Transformations] miconda | cookbooks:3.2.x:transformations [2018/07/12 06:31] (current) – [{re.subst,expression}] gaaf | ||
---|---|---|---|
Line 6: | Line 6: | ||
</ | </ | ||
- | **Transformation** is basically a function that is applied to a pseudo-variable (PV) to get a special value from it. The value of PV is not altered. | + | **Transformation** is basically a function that is applied to a pseudo-variable (PV) to get a special value from it. The value of PV is not affected at all. |
Transformations are implemented by various modules, most of them being in **pv** module. | Transformations are implemented by various modules, most of them being in **pv** module. | ||
Line 177: | Line 177: | ||
</ | </ | ||
+ | ==== {s.replace, | ||
+ | |||
+ | Replace all occurrences of **match** with **repl**. The parameters can be pseudo-variables. | ||
+ | |||
+ | Example: | ||
+ | <code c> | ||
+ | $var(x) = " | ||
+ | $(var(x){s.replace, | ||
+ | </ | ||
+ | |||
+ | ==== {s.ftime, | ||
+ | |||
+ | |||
+ | Format the epoch in the pv according to the parameter. The parameter has to be strftime formatting string. | ||
+ | | ||
+ | <code c> | ||
+ | $(TS{s.ftime, | ||
+ | </ | ||
===== URI Transformations ===== | ===== URI Transformations ===== | ||
Line 189: | Line 207: | ||
==== {uri.host} ==== | ==== {uri.host} ==== | ||
- | (same as [b]{uri.domain}[/b]) | + | (same as **{uri.domain}**) |
Return the domain part | Return the domain part | ||
Line 322: | Line 340: | ||
===== To-Body Transformations ===== | ===== To-Body Transformations ===== | ||
- | <hi #c0c0c0>This transformation class is exported by **pv** module.</ | + | <fc #0000ff>This transformation class is exported by **pv** module.</ |
Access parts of a ToBody-like structure. | Access parts of a ToBody-like structure. | ||
Line 353: | Line 371: | ||
===== Regular Expression Transformations ===== | ===== Regular Expression Transformations ===== | ||
- | <hi #c0c0c0>This transformation class is exported by **textops** module.</ | + | <fc #0000ff>This transformation class is exported by **textops** module.</ |
==== {re.subst, | ==== {re.subst, | ||
- | Perform | + | Perform |
<code c> | <code c> | ||
Line 385: | Line 403: | ||
===== SQL Transformations ===== | ===== SQL Transformations ===== | ||
- | <hi #c0c0c0>The transformations in this class are exported by the **sqlops** module.</ | + | <fc #0000ff>The transformations in this class are exported by the **sqlops** module.</ |
==== {sql.val} ==== | ==== {sql.val} ==== | ||
Line 436: | Line 454: | ||
</ | </ | ||
- | * Test if whether is un-registration or not | + | * Test whether is un-registration or not |
< | < |
cookbooks/3.2.x/transformations.1318956738.txt.gz · Last modified: 2011/10/18 16:52 by miconda