[SR-Users] KEMI - Set message body to Bytes / Prevent parsing PV?

Nick nick at nickvsnetworking.com
Sun Apr 11 05:23:03 CEST 2021

Hi all,

I'm trying in KEMI & Python to set a Pseudo Variable to the value of
another PV (simple enough) but the value of the PV is not a string or an

For example the SMSops
module has a PV called $smsbody which I need to set the message body to
equal in UAC, but I'm not able to load it to set it as the message body,

In my Python file I have:
smsbody = KSR.pv.get("$smsbody")

Which leads to:
kamailio[226069]: UnicodeDecodeError: 'utf-8' codec can't decode byte 0x91
in position 7: invalid start byte
kamailio[226069]:  2(226069) DEBUG: app_python3 [apy_kemi.c:112]:
sr_kemi_config_engine_python(): execution of route type 1 with no name
returned -1

*Is there a way to set a PV in Kemi without actually interpreting it?*

*Is there a way to run an arbitrary line of native Kamailio config from
Kemi like KSR.x.modf? *

In reality all I need to do is:
$uac_req(body) = $smsbody;

Would work fine in the native config, but the equivalent in Kemi tries to
parse the contents and fails, so can't set the body.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20210411/8277d618/attachment.htm>

More information about the sr-users mailing list