[OpenSIPS-Devel] [opensips] Added b64encode, b64decode, and xor string transformations (#565)
Jarrod Baumann
notifications at github.com
Wed Jul 1 22:40:28 CEST 2015
Here is an example of the string transformations in use:
## opensips.cfg specifics
```
modparam("cfgutils", "varset", "secret=s:90hf230fh209fh209")
route {
...
xlog("L_INFO", "Call-ID : $ci\n");
$var(xor) = $(ci{s.xor, $var(secret)});
xlog("L_INFO", "Call-ID XOR : $var(xor)\n");
$var(b64encoded) = $(var(xor){s.b64encode});
xlog("L_INFO", "Call-ID b64encoded : $var(b64encoded)\n");
$var(b64decoded) = $(var(b64encoded){s.b64decode});
xlog("L_INFO", "Call-ID b64decoded : $var(b64decoded)\n");
xlog("L_INFO", "Call-ID XOR : $(var(b64decoded){s.xor, $var(secret)})\n");
}
```
## log output
```
Jul 1 17:33:34 localhost opensips: Call-ID : ZjdiZDlmNTY2NDk4ZWNiYzNlNGVlNzA4ODM3NTFmNjg
Jul 1 17:33:34 localhost opensips: Call-ID XOR : cZ#014#017hw\#013&fi#013(,Y#004cn~#001?H}\(/d\w#034)#006}t#003&2t^~#014#017
Jul 1 17:33:34 localhost opensips: Call-ID b64encoded : Y1oMD2h3XAsmZmkLKCxZBGNufgE/SH1cKC9kXHccKQZ/fXQDJjJ0Xn4MDw==
Jul 1 17:33:34 localhost opensips: Call-ID b64decoded : cZ#014#017hw\#013&fi#013(,Y#004cn~#001?H}\(/d\w#034)#006}t#003&2t^~#014#017
Jul 1 17:33:34 localhost opensips: Call-ID XOR : ZjdiZDlmNTY2NDk4ZWNiYzNlNGVlNzA4ODM3NTFmNjg
```
You can view, comment on, or merge this pull request online at:
https://github.com/OpenSIPS/opensips/pull/565
-- Commit Summary --
* Added b64encode, b64decode, and xor string transformations
-- File Changes --
M transformations.c (96)
M transformations.h (3)
-- Patch Links --
https://github.com/OpenSIPS/opensips/pull/565.patch
https://github.com/OpenSIPS/opensips/pull/565.diff
---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/pull/565
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/devel/attachments/20150701/b966fdb7/attachment.htm>
More information about the Devel
mailing list