<!-- Kamailio Project uses GitHub Issues only for bugs in the code or feature requests. Please use this template only for feature requests.
If you have questions about using Kamailio or related to its configuration file, ask on sr-users mailing list:
* http://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
If you have questions about developing extensions to Kamailio or its existing C code, ask on sr-dev mailing list:
* http://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Please try to fill this template as much as possible for any issue. It helps the developers to troubleshoot the issue.
If you submit a feature request (or enhancement) add the description of what you would like to be added.
If there is no content to be filled in a section, the entire section can be removed.
You can delete the comments from the template sections when filling.
You can delete next line and everything above before submitting (it is a comment). -->
Hello everyone, is module pua_json going to be implemented for KEMI framework? I've tried to use KSR.x.modf("pua_json_publish", "json_here") and I'm getting error
### python code ``` def ksr_xhttp_event(self, evmsg, evname): if evname == "xhttp:request": try: KSR.err("===== xhttp module triggered event: " + evname + "\n") if "/presence" in KSR.pv.get("$hu"): rb = json.loads(KSR.kx.get_body()) if rb["Event-Package"] == "message-summary": KSR.info("request received- " + rb["Call-ID"] + "update for: " + rb[ "From"] + "request body: " + json.dumps(rb) + "\n") KSR.x.modf("pua_json_publish", json.dumps(rb)); KSR.xhttp.xhttp_reply(200, "OK", "text/html", "<html><body>Entity state updated</body></html>") return 1 if "/RCP" in KSR.pv.get("$hu"): KSR.jsonrpcs.dispatch() return 1 else: KSR.xhttp.xhttp_reply(200, "OK", "text/html", "<html><body>Wrong URL</body></html>") return 1 except: KSR.err("===== unsupported " + evname + "\n") return -255 ```
#### Debugging Data
``` app_python [python_support.c:154]: python_handle_exception(): apy_exec: ksr_xhttp_event(xhttp:request): Unhandled exception in the Python code: RuntimeError: self is NULL ```
* **Kamailio Version** - output of `kamailio -v`
``` version: kamailio 5.4.5 (x86_64/linux) c46342 flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB poll method support: poll, epoll_lt, epoll_et, sigio_rt, select. id: c46342 compiled on 14:37:00 Apr 27 2021 with gcc 7.5.0 ```
* **Operating System**:
<!-- Details about the operating system, the type: Linux (e.g.,: Debian 8.4, Ubuntu 16.04, CentOS 7.1, ...), MacOS, xBSD, Solaris, ...; Kernel details (output of `uname -a`) -->
``` Linux ip-10-199-240-110 4.15.0-1057-aws #59-Ubuntu SMP Wed Dec 4 10:02:00 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux ```
Can you try with master branch? I pushed commit abbe518724d645b6f977ca526011285bc03c581c for it.
I also had to change a bit the function exported to kamailio.cfg, to add fixups for it to integrate properly with kemi exports, therefore I may consider backporting it to 5.5 branch if all works ok with master version, but not to 5.4 branch.
hi @miconda . I've built kamailio from master. Issue is still persist. ``` kamailio -v version: kamailio 5.6.0-dev0 (x86_64/linux) 77896d ```
`11(25346) DEBUG: xhttp [xhttp_mod.c:366]: xhttp_handler(): new fake msg created (667 bytes): <POST /presence/ HTTP/1.1 Via: SIP/2.0/TCP 10.199.240.110:44928 Host: 10.199.240.110:5099 User-Agent: curl/7.58.0 Accept: */* Content-Length: 465 Content-Type: application/x-www-form-urlencoded
{"Call-ID":"some_call_id","Event-Category":"presence","Event-Name":"update","Event-Package":"message-summary","Expires":"3600","From":"sip:af5db8d3d72da576a5a758dfe4311d14@10.199.240.110","From-User":"af5db8d3d72da576a5a758dfe4311d14","From-Realm":"10.199.240.110", "Messages-Waiting":"yes", "Message-Account":"sip:af5db8d3d72da576a5a758dfe4311d14@10.199.240.110:5099", "Messages-New":"110", "Messages-Saved":"0", "Messages-Urgent":"0", "Messages-Urgent-Saved":"0"}> 11(25346) DEBUG: <core> [core/parser/parse_fline.c:249]: parse_first_line(): first line type 1 (request) flags 2 11(25346) DEBUG: <core> [core/parser/msg_parser.c:677]: parse_msg(): SIP Request: 11(25346) DEBUG: <core> [core/parser/msg_parser.c:679]: parse_msg(): method: <POST> 11(25346) DEBUG: <core> [core/parser/msg_parser.c:681]: parse_msg(): uri: </presence/> 11(25346) DEBUG: <core> [core/parser/msg_parser.c:683]: parse_msg(): version: <HTTP/1.1> 11(25346) DEBUG: <core> [core/mem/q_malloc.c:374]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 64) called from core: core/parser/msg_parser.c: parse_headers(328) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:419]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 64) returns address 0x7f3baa1925a8 frag. 0x7f3baa192570 (size=64) on 1 -th hit 11(25346) DEBUG: <core> [core/parser/parse_hname2.c:301]: parse_sip_header_name(): parsed header name [Via] type 1 11(25346) DEBUG: <core> [core/mem/q_malloc.c:374]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 240) called from core: core/parser/msg_parser.c: get_hdr_field(118) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:419]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 240) returns address 0x7f3baa192650 frag. 0x7f3baa192618 (size=240) on 1 -th hit 11(25346) DEBUG: <core> [core/parser/parse_via.c:2639]: parse_via(): end of header reached, state=5 11(25346) DEBUG: <core> [core/parser/msg_parser.c:555]: parse_headers(): Via found, flags=2 11(25346) DEBUG: <core> [core/parser/msg_parser.c:557]: parse_headers(): this is the first via 11(25346) DEBUG: app_python [apy_kemi.c:232]: sr_apy_kemi_exec_func_ex(): execution of method: .err 11(25346) DEBUG: app_python [apy_kemi.c:264]: sr_apy_kemi_exec_func_ex(): param[1] for: err is str: ===== xhttp module triggered event: xhttp:request
11(25346) ERROR: <core> [core/kemi.c:95]: sr_kemi_core_err(): ===== xhttp module triggered event: xhttp:request 11(25346) DEBUG: app_python [apy_kemi.c:230]: sr_apy_kemi_exec_func_ex(): execution of method: get 11(25346) DEBUG: app_python [apy_kemi.c:264]: sr_apy_kemi_exec_func_ex(): param[1] for: get is str: $hu 11(25346) DEBUG: <core> [core/kemi.c:2894]: sr_kemi_pv_get_mode(): pv get: $hu 11(25346) DEBUG: <core> [core/pvapi.c:335]: pv_cache_add(): PV cache not initialized, doing it now 11(25346) DEBUG: <core> [core/mem/q_malloc.c:374]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 124) called from core: core/pvapi.c: pv_cache_add(349) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:419]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 128) returns address 0x7f3baa1927a8 frag. 0x7f3baa192770 (size=128) on 1 -th hit 11(25346) DEBUG: <core> [core/pvapi.c:371]: pv_cache_add(): pvar [$hu] added in cache 11(25346) DEBUG: app_python [apy_kemi.c:230]: sr_apy_kemi_exec_func_ex(): execution of method: get_body 11(25346) DEBUG: <core> [core/mem/q_malloc.c:374]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 64) called from core: core/parser/msg_parser.c: parse_headers(328) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:419]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 64) returns address 0x7f3baa192890 frag. 0x7f3baa192858 (size=64) on 1 -th hit 11(25346) DEBUG: <core> [core/parser/parse_hname2.c:301]: parse_sip_header_name(): parsed header name [Host] type 0 11(25346) DEBUG: <core> [core/mem/q_malloc.c:374]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 64) called from core: core/parser/msg_parser.c: parse_headers(328) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:419]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 64) returns address 0x7f3baa192938 frag. 0x7f3baa192900 (size=64) on 1 -th hit 11(25346) DEBUG: <core> [core/parser/parse_hname2.c:301]: parse_sip_header_name(): parsed header name [User-Agent] type 28 11(25346) DEBUG: <core> [core/mem/q_malloc.c:374]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 64) called from core: core/parser/msg_parser.c: parse_headers(328) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:419]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 64) returns address 0x7f3baa1929e0 frag. 0x7f3baa1929a8 (size=64) on 1 -th hit 11(25346) DEBUG: <core> [core/parser/parse_hname2.c:301]: parse_sip_header_name(): parsed header name [Accept] type 23 11(25346) DEBUG: <core> [core/mem/q_malloc.c:374]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 64) called from core: core/parser/msg_parser.c: parse_headers(328) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:419]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 64) returns address 0x7f3baa192a88 frag. 0x7f3baa192a50 (size=64) on 1 -th hit 11(25346) DEBUG: <core> [core/parser/parse_hname2.c:301]: parse_sip_header_name(): parsed header name [Content-Length] type 12 11(25346) DEBUG: <core> [core/parser/msg_parser.c:187]: get_hdr_field(): content_length=465 11(25346) DEBUG: <core> [core/mem/q_malloc.c:374]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 64) called from core: core/parser/msg_parser.c: parse_headers(328) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:419]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 64) returns address 0x7f3baa192b30 frag. 0x7f3baa192af8 (size=64) on 1 -th hit 11(25346) DEBUG: <core> [core/parser/parse_hname2.c:301]: parse_sip_header_name(): parsed header name [Content-Type] type 11 11(25346) DEBUG: <core> [core/mem/q_malloc.c:374]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 64) called from core: core/parser/msg_parser.c: parse_headers(328) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:419]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 64) returns address 0x7f3baa192bd8 frag. 0x7f3baa192ba0 (size=64) on 1 -th hit 11(25346) DEBUG: <core> [core/parser/msg_parser.c:91]: get_hdr_field(): found end of header 11(25346) DEBUG: <core> [core/mem/q_malloc.c:482]: qm_free(): qm_free(0x7f3baa0c8010, 0x7f3baa192bd8), called from core: core/parser/msg_parser.c: parse_headers(345) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:526]: qm_free(): freeing frag. 0x7f3baa192ba0 alloc'ed from core: core/parser/msg_parser.c: parse_headers(328) 11(25346) DEBUG: app_python [apy_kemi.c:232]: sr_apy_kemi_exec_func_ex(): execution of method: .info 11(25346) DEBUG: app_python [apy_kemi.c:264]: sr_apy_kemi_exec_func_ex(): param[1] for: info is str: request received- some_call_idupdate for: sip:af5db8d3d72da576a5a758dfe4311d14@10.199.240.110request body: {"From-Realm": "10.199.240.110", "Messages-Waiting": "yes", "From": "sip:af5db8d3d72da576a5a758dfe4311d14@10.199.240.110", "From-User": "af5db8d3d72da576a5a758dfe4311d14", "Expires": "3600", "Event-Name": "update", "Event-Category": "presence", "Messages-Urgent": "0", "Messages-Saved": "0", "Messages-Urgent-Saved": "0", "Message-Account": "sip:af5db8d3d72da576a5a758dfe4311d14@10.199.240.110:5099", "Call-ID": "some_call_id", "Event-Package": "message-summary", "Messages-New": "110"}
11(25346) INFO: <core> [core/kemi.c:105]: sr_kemi_core_info(): request received- some_call_idupdate for: sip:af5db8d3d72da576a5a758dfe4311d14@10.199.240.110request body: {"From-Realm": "10.199.240.110", "Messages-Waiting": "yes", "From": "sip:af5db8d3d72da576a5a758dfe4311d14@10.199.240.110", "From-User": "af5db8d3d72da576a5a758dfe4311d14", "Expires": "3600", "Event-Name": "update", "Event-Category": "presence", "Messages-Urgent": "0", "Messages-Saved": "0", "Messages-Urgent-Saved": "0", "Message-Account": "sip:af5db8d3d72da576a5a758dfe4311d14@10.199.240.110:5099", "Call-ID": "some_call_id", "Event-Package": "message-summary", "Messages-New": "110"} 11(25346) DEBUG: app_python [apy_kemi.c:230]: sr_apy_kemi_exec_func_ex(): execution of method: xhttp_reply 11(25346) DEBUG: app_python [apy_kemi.c:541]: sr_apy_kemi_exec_func_ex(): params[4] for: xhttp_reply are: [200] [OK] [text/html] [<html><body>Entity state updated</body></html>] 11(25346) DEBUG: <core> [core/mem/q_malloc.c:374]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 25) called from xhttp: xhttp_mod.c: xhttp_send_reply(394) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:419]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 32) returns address 0x7f3baa192208 frag. 0x7f3baa1921d0 (size=48) on 1 -th hit 11(25346) DEBUG: <core> [core/mem/q_malloc.c:374]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 57) called from core: core/data_lump_rpl.c: add_lump_rpl2(57) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:419]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 64) returns address 0x7f3baa192bd8 frag. 0x7f3baa192ba0 (size=64) on 1 -th hit 11(25346) DEBUG: <core> [core/mem/q_malloc.c:482]: qm_free(): qm_free(0x7f3baa0c8010, 0x7f3baa192208), called from xhttp: xhttp_mod.c: xhttp_send_reply(409) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:526]: qm_free(): freeing frag. 0x7f3baa1921d0 alloc'ed from xhttp: xhttp_mod.c: xhttp_send_reply(394) 11(25346) DEBUG: xhttp [xhttp_mod.c:410]: xhttp_send_reply(): response with content-type: text/html 11(25346) DEBUG: <core> [core/mem/q_malloc.c:374]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 78) called from core: core/data_lump_rpl.c: add_lump_rpl2(57) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:419]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 80) returns address 0x7f3baa192c80 frag. 0x7f3baa192c48 (size=80) on 1 -th hit 11(25346) DEBUG: xhttp [xhttp_mod.c:418]: xhttp_send_reply(): response with body: <html><body>Entity state updated</body></html> 11(25346) DEBUG: xhttp [xhttp_mod.c:420]: xhttp_send_reply(): sending out response: 200 OK 11(25346) DEBUG: <core> [core/mem/q_malloc.c:374]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 3) called from core: core/ut.c: as_asciiz(187) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:419]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 8) returns address 0x7f3baa192208 frag. 0x7f3baa1921d0 (size=48) on 1 -th hit 11(25346) DEBUG: <core> [core/msg_translator.c:162]: check_via_address(): (10.199.240.110, 10.199.240.110, 0) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:374]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 196) called from core: core/msg_translator.c: build_res_buf_from_sip_req(2496) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:419]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 200) returns address 0x7f3baa192d38 frag. 0x7f3baa192d00 (size=200) on 1 -th hit 11(25346) DEBUG: <core> [core/tcp_main.c:1590]: _tcpconn_find(): found connection by id: 2 11(25346) DEBUG: <core> [core/tcp_main.c:2471]: tcpconn_send_put(): send from reader (25346 (11)), reusing fd 11(25346) DEBUG: <core> [core/tcp_main.c:2706]: tcpconn_do_send(): sending... 11(25346) DEBUG: <core> [core/tcp_main.c:2739]: tcpconn_do_send(): after real write: c= 0x7f3b9eb239b8 n=195 fd=8 11(25346) DEBUG: <core> [core/tcp_main.c:2740]: tcpconn_do_send(): buf= HTTP/1.1 200 OK Sia: SIP/2.0/TCP 10.199.240.110:44928 Content-Type: text/html Server: kamailio (5.6.0-dev0 (x86_64/linux)) Content-Length: 46
<html><body>Entity state updated</body></html> 11(25346) DEBUG: <core> [core/parser/parse_fline.c:249]: parse_first_line(): first line type 1 (request) flags 0 11(25346) DEBUG: <core> [core/parser/msg_parser.c:677]: parse_msg(): SIP Request: 11(25346) DEBUG: <core> [core/parser/msg_parser.c:679]: parse_msg(): method: <HTTP/1.1> 11(25346) DEBUG: <core> [core/parser/msg_parser.c:681]: parse_msg(): uri: <200> 11(25346) DEBUG: <core> [core/parser/msg_parser.c:683]: parse_msg(): version: <OK> 11(25346) DEBUG: <core> [core/mem/q_malloc.c:374]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 64) called from core: core/parser/msg_parser.c: parse_headers(328) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:419]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 64) returns address 0x7f3baa192e68 frag. 0x7f3baa192e30 (size=64) on 1 -th hit 11(25346) DEBUG: <core> [core/parser/parse_hname2.c:301]: parse_sip_header_name(): parsed header name [Sia] type 0 11(25346) DEBUG: <core> [core/mem/q_malloc.c:374]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 64) called from core: core/parser/msg_parser.c: parse_headers(328) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:419]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 64) returns address 0x7f3baa192f10 frag. 0x7f3baa192ed8 (size=64) on 1 -th hit 11(25346) DEBUG: <core> [core/parser/parse_hname2.c:301]: parse_sip_header_name(): parsed header name [Content-Type] type 11 11(25346) DEBUG: <core> [core/mem/q_malloc.c:374]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 64) called from core: core/parser/msg_parser.c: parse_headers(328) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:419]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 64) returns address 0x7f3baa192fb8 frag. 0x7f3baa192f80 (size=64) on 1 -th hit 11(25346) DEBUG: <core> [core/parser/parse_hname2.c:301]: parse_sip_header_name(): parsed header name [Server] type 29 11(25346) DEBUG: <core> [core/mem/q_malloc.c:374]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 64) called from core: core/parser/msg_parser.c: parse_headers(328) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:419]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 64) returns address 0x7f3baa193060 frag. 0x7f3baa193028 (size=64) on 1 -th hit 11(25346) DEBUG: <core> [core/parser/parse_hname2.c:301]: parse_sip_header_name(): parsed header name [Content-Length] type 12 11(25346) DEBUG: <core> [core/parser/msg_parser.c:187]: get_hdr_field(): content_length=46 11(25346) DEBUG: <core> [core/mem/q_malloc.c:374]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 64) called from core: core/parser/msg_parser.c: parse_headers(328) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:419]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 64) returns address 0x7f3baa193108 frag. 0x7f3baa1930d0 (size=64) on 1 -th hit 11(25346) DEBUG: <core> [core/parser/msg_parser.c:91]: get_hdr_field(): found end of header 11(25346) DEBUG: <core> [core/mem/q_malloc.c:482]: qm_free(): qm_free(0x7f3baa0c8010, 0x7f3baa193108), called from core: core/parser/msg_parser.c: parse_headers(345) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:526]: qm_free(): freeing frag. 0x7f3baa1930d0 alloc'ed from core: core/parser/msg_parser.c: parse_headers(328) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:374]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 64) called from sl: sl_funcs.c: sl_reply_helper(245) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:419]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 64) returns address 0x7f3baa193108 frag. 0x7f3baa1930d0 (size=64) on 1 -th hit 11(25346) DEBUG: <core> [core/mem/q_malloc.c:374]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 48) called from sl: sl_funcs.c: sl_reply_helper(251) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:419]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 48) returns address 0x7f3baa1931b0 frag. 0x7f3baa193178 (size=48) on 1 -th hit 11(25346) DEBUG: <core> [core/mem/q_malloc.c:374]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 9) called from sl: sl_funcs.c: sl_reply_helper(260) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:419]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 16) returns address 0x7f3baa193248 frag. 0x7f3baa193210 (size=16) on 1 -th hit 11(25346) DEBUG: app_python [apy_kemi.c:106]: sr_kemi_config_engine_python(): execution of route type 513 with name [] returned -1 11(25346) DEBUG: <core> [core/mem/q_malloc.c:482]: qm_free(): qm_free(0x7f3baa0c8010, 0x7f3baa193248), called from sl: sl_funcs.c: sl_reply_helper(330) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:526]: qm_free(): freeing frag. 0x7f3baa193210 alloc'ed from sl: sl_funcs.c: sl_reply_helper(260) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:482]: qm_free(): qm_free(0x7f3baa0c8010, 0x7f3baa192e68), called from core: core/parser/hf.c: free_hdr_field_lst(217) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:526]: qm_free(): freeing frag. 0x7f3baa192e30 alloc'ed from core: core/parser/msg_parser.c: parse_headers(328) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:482]: qm_free(): qm_free(0x7f3baa0c8010, 0x7f3baa192f10), called from core: core/parser/hf.c: free_hdr_field_lst(217) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:526]: qm_free(): freeing frag. 0x7f3baa192ed8 alloc'ed from core: core/parser/msg_parser.c: parse_headers(328) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:482]: qm_free(): qm_free(0x7f3baa0c8010, 0x7f3baa192fb8), called from core: core/parser/hf.c: free_hdr_field_lst(217) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:526]: qm_free(): freeing frag. 0x7f3baa192f80 alloc'ed from core: core/parser/msg_parser.c: parse_headers(328) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:482]: qm_free(): qm_free(0x7f3baa0c8010, 0x7f3baa193060), called from core: core/parser/hf.c: free_hdr_field_lst(217) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:526]: qm_free(): freeing frag. 0x7f3baa193028 alloc'ed from core: core/parser/msg_parser.c: parse_headers(328) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:482]: qm_free(): qm_free(0x7f3baa0c8010, 0x7f3baa1931b0), called from core: core/parser/parse_cseq.c: free_cseq(99) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:526]: qm_free(): freeing frag. 0x7f3baa193178 alloc'ed from sl: sl_funcs.c: sl_reply_helper(251) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:482]: qm_free(): qm_free(0x7f3baa0c8010, 0x7f3baa193108), called from core: core/parser/hf.c: free_hdr_field_lst(217) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:526]: qm_free(): freeing frag. 0x7f3baa1930d0 alloc'ed from sl: sl_funcs.c: sl_reply_helper(245) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:482]: qm_free(): qm_free(0x7f3baa0c8010, 0x7f3baa192d38), called from sl: sl_funcs.c: sl_reply_helper(337) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:526]: qm_free(): freeing frag. 0x7f3baa192d00 alloc'ed from core: core/msg_translator.c: build_res_buf_from_sip_req(2496) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:482]: qm_free(): qm_free(0x7f3baa0c8010, 0x7f3baa192208), called from sl: sl_funcs.c: sl_send_reply_str(376) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:526]: qm_free(): freeing frag. 0x7f3baa1921d0 alloc'ed from core: core/ut.c: as_asciiz(187) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:617]: qm_realloc(): qm_realloc(0x7f3baa0c8010, (nil), 100) called from app_python: python_support.c: make_message(198) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:374]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 100) called from app_python: python_support.c: make_message(198) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:419]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 104) returns address 0x7f3baa192d38 frag. 0x7f3baa192d00 (size=104) on 1 -th hit 11(25346) DEBUG: <core> [core/mem/q_malloc.c:617]: qm_realloc(): qm_realloc(0x7f3baa0c8010, (nil), 1) called from app_python: python_support.c: python_handle_exception(94) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:374]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 1) called from app_python: python_support.c: python_handle_exception(94) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:419]: qm_malloc(): qm_malloc(0x7f3baa0c8010, 8) returns address 0x7f3baa192208 frag. 0x7f3baa1921d0 (size=48) on 1 -th hit 11(25346) DEBUG: <core> [core/mem/q_malloc.c:617]: qm_realloc(): qm_realloc(0x7f3baa0c8010, 0x7f3baa192208, 29) called from app_python: python_support.c: python_handle_exception(129) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:645]: qm_realloc(): realloc'ing frag 0x7f3baa1921d0 alloc'ed from app_python: python_support.c: python_handle_exception(94) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:659]: qm_realloc(): shrinking from 48 to 32 11(25346) DEBUG: <core> [core/mem/q_malloc.c:661]: qm_realloc(): shrinked successful 11(25346) DEBUG: <core> [core/mem/q_malloc.c:739]: qm_realloc(): returning pointer address: 0x7f3baa192208 11(25346) ERROR: app_python [python_support.c:154]: python_handle_exception(): apy_exec: ksr_xhttp_event(xhttp:request): Unhandled exception in the Python code: RuntimeError: self is NULL 11(25346) DEBUG: <core> [core/mem/q_malloc.c:482]: qm_free(): qm_free(0x7f3baa0c8010, 0x7f3baa192208), called from app_python: python_support.c: python_handle_exception(159) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:526]: qm_free(): freeing frag. 0x7f3baa1921d0 alloc'ed from app_python: python_support.c: python_handle_exception(94) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:482]: qm_free(): qm_free(0x7f3baa0c8010, 0x7f3baa192d38), called from app_python: python_support.c: python_handle_exception(162) 11(25346) DEBUG: <core> [core/mem/q_malloc.c:526]: qm_free(): freeing frag. 0x7f3baa192d00 alloc'ed from app_python: python_support.c: make_message(198) 11(25346) DEBUG: app_python [apy_kemi.c:106]: sr_kemi_config_engine_python(): execution of route type 513 with name [ksr_xhttp_event] returned -1`
Closed #2783.
The logs are not related to pua_json function, which is available as:
*| http://kamailio.org/docs/tutorials/devel/kamailio-kemi-framework/modules/#ks...
Instead, it seems that you process the HTTP replies somehow. Either Kamailio receives HTTP replies (which should not) or you have some modules/routing blocks handling local replies (e.g., siptrace, ...). Not sure if you attached all debug messages or selected them.
Anyhow, it is not related to pua_json missing exports to kemi. That was done, so I am closing this one.
Seems to be a usage configuration problem or receiving HTTP replies. For assisting further, you should email to sr-users@lists.kamailio.org providing all debug log messages and relevant parts of the config. If it proves to be a problem in the code, another issue can be opened.