<p></p>

<p>Hello everyone, is module pua_json going to be implemented for KEMI framework?<br>
I've tried to use KSR.x.modf("pua_json_publish", "json_here") and I'm getting error</p>
<h3>python code</h3>
<pre><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
</code></pre>
<h4>Debugging Data</h4>
<pre><code> 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
</code></pre>
<ul>
<li><strong>Kamailio Version</strong> - output of <code>kamailio -v</code></li>
</ul>
<pre><code>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
</code></pre>
<ul>
<li><strong>Operating System</strong>:</li>
</ul>

<pre><code>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
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/2783">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZNOPY3TPQPSLUBYKGLTTBYEDANCNFSM46ZCKUMQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABO7UZMJHQUNUL7HMSEVKHDTTBYEDA5CNFSM46ZCKUM2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4NX2UZRQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/2783",
"url": "https://github.com/kamailio/kamailio/issues/2783",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>