Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KEMI: app_python and app_python3 handles function with 4 parameters and more incorrectly #1944

Closed
towe75 opened this issue May 3, 2019 · 2 comments

Comments

@towe75
Copy link
Contributor

towe75 commented May 3, 2019

Description

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.

Also it's missing a "ssii" variant for calling e.g. KSR.htable.sht_setxi()

Reproduction

Try to call KSR.htable.sht_setxs() or KSR.htable.sht_setxi() with app_python.

Log Messages

ERROR: app_python [apy_kemi.c:342]: sr_apy_kemi_exec_func_ex(): unable to retrieve str-str-str-str params 4

Possible Solutions

Clean up app_python and app_python3 by changing "or" to "and" in lines like this one:

 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) 

Further, app_python lacks a "ssii" parameter handler so using KSR.htable.sht_setxi() is not possible.

I could contribute a pull request if no core developer has time to fix it.

Additional Information

  • Kamailio Version - output of kamailio -v
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
miconda added a commit that referenced this issue May 3, 2019
miconda added a commit that referenced this issue May 3, 2019
@miconda
Copy link
Member

miconda commented May 3, 2019

Can you try with latest master or 5.2 branch?

The "ssii" parameter handler seemed ok, missing was "sssi"/

Anyhow, if still an issue, reopen.

@miconda miconda closed this as completed May 3, 2019
@towe75
Copy link
Contributor Author

towe75 commented May 3, 2019

Perfect, thank you.

miconda added a commit that referenced this issue Sep 24, 2019
- GH #1944

(cherry picked from commit cbec7f9)
(cherry picked from commit 42117d1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants