Hi,
I have a follow-up question related to this.
I would like to use a python lib for mysql db connections and some simple queries(beside what other kama module queries). I tried to make a db connection per process in kemi "child_init()" function. All queries work ok for first and 2'nd requests. However on
3'rd request received I get this error:
Thank you,
Stefan
Hello,
When writing kemi cfg (python in my case), is there any way to get rid of standard cfg shared variables and use kemi cfg variables instead?
E.g. Instead of $shv(blabla) (in standard config) can I use some global python var called 'blabla'? Is it seen and shared by all kamailio processes? Or I still need to use KSR.pv.get/set("$shv(blabla)") ?
the global python native variables are per process, so you can't replace $shv(...) with them. The python ones are more like $var(...) from kamailio.
However, instead of the generic KSR.pv.get/set(), you can use the alternative KEMI functions -- see them starting at:
- https://www.kamailio.org/docs/tutorials/devel/kamailio-kemi-framework/modules/#ksrpvxshv_get
Cheers,
Daniel
-- Daniel-Constantin Mierla (@ asipto.com) twitter.com/miconda -- linkedin.com/in/miconda Kamailio Consultancy and Development Services Kamailio Advanced Training -- asipto.com