<h3>Description</h3>
<p>app_python and, in some places, app_python3 handles KEMI calls with 4 and more parameters incorrectly. It uses "or" operations instead of "and" and thus it will always tries to convert the call into a "str-str-str-str" invocation.</p>
<p>Also it's missing a "ssii" variant for calling e.g. KSR.htable.sht_setxi()</p>
<h4>Reproduction</h4>
<p>Try to call KSR.htable.sht_setxs() or KSR.htable.sht_setxi() with app_python.</p>
<h4>Log Messages</h4>
<pre><code>ERROR: app_python [apy_kemi.c:342]: sr_apy_kemi_exec_func_ex(): unable to retrieve str-str-str-str params 4
</code></pre>
<h3>Possible Solutions</h3>
<p>Clean up app_python and app_python3 by changing "or" to "and" in lines like this one:</p>
<pre><code> if(ket->ptypes[0]==SR_KEMIP_STR
                                || ket->ptypes[1]==SR_KEMIP_STR
                                || ket->ptypes[2]==SR_KEMIP_INT
                                || ket->ptypes[3]==SR_KEMIP_INT) 
</code></pre>
<p>Further, app_python lacks a "ssii" parameter handler so using KSR.htable.sht_setxi() is not possible.</p>
<p><strong>I could contribute a pull request if no core developer has time to fix it.</strong></p>
<h3>Additional Information</h3>
<ul>
<li><strong>Kamailio Version</strong> - output of <code>kamailio -v</code></li>
</ul>
<pre><code>version: kamailio 5.2.2 (x86_64/linux) 
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, 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
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: unknown 
compiled with gcc 5.3.1
</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/1944">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZLYWYOWE5XQIFP6I4LPTPGB7ANCNFSM4HKRKUVQ">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABO7UZKF2XF2WTEIOT645FLPTPGB7A5CNFSM4HKRKUV2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GRYIQMQ.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"KEMI: app_python and app_python3 handles function with 4 parameters and more incorrectly (#1944)"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1944"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/1944",
"url": "https://github.com/kamailio/kamailio/issues/1944",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>