Hello,
Just a quick follow-up: the problem does not appear anymore.
I was trying to use KEMI export KSR.pv.sets to assign integer values or None, which is
wrong.
(my first steps using KEMI...)
I was confused because after that a log with "%" works fine but not with
"format" (it triggers a "python_handle_exception").
(I still don't know why, but the cause was not the log itself but my incorrectly using
the KEMI export before that)
Regards,
Nicolas.
-----Message d'origine-----
DeĀ : Chaigneau, Nicolas <nicolas.chaigneau(a)capgemini.com>
Hello,
I'm trying to use python KEMI script with Kamailio (5.6.4).
This is python 2.7.5.
I have some weird behaviour with string formatting.
This works fine:
KSR.info("si: [%s]\n" % KSR.pv.get("$si"))
But with this:
KSR.info("si: {}\n".format(KSR.pv.get("$si")))
=> This works but only for 1/2 of the SIP requests. Otherwise I get the following
error:
1(111858) ERROR: PY2 {INVITE} app_python [python_support.c:154]:
python_handle_exception(): apy_exec: ksr_request_route((null)): Unhandled exception in the
Python code:
Traceback (most recent call last):
File "kamailio-routing-kemi.py", line 74, in ksr_request_route
KSR.info("si: {}\n".format( str(KSR.pv.get("$si")) ))
TypeError: an integer is required
What could be the problem ?
Regards,
Nicolas.
This message contains information that may be privileged or confidential and is the
property of the Capgemini Group. It is intended only for the person to whom it is
addressed. If you are not the intended recipient, you are not authorized to read, print,
retain, copy, disseminate, distribute, or use this message or any part thereof. If you
receive this message in error, please notify the sender immediately and delete all copies
of this message.