Hi,
When installing kamailio from deb repository (https://deb.kamailio.org/) with debian 11 amd64. kamcmd autocompletion doesn't work.
Issue found with debian 11 on Kamailio v5.5.x and 5.6.x
OK via debian official repository.
Kamcli could be a replacement but such modules as LCR are not supported.
Thanks in advance,
It is a know issue with latest lib ncurses versions, if nobody commits to fix it, then this issue will be closed soon.
`kamcmd` is simply a binrpc client, that means `kamcmd cmd` can be replaced by `kamcli rpc cmd`, for example `kamcmd lcr.reload` can be replaced by `kamcli rpc lcr.reload`. For `kamcli` you need the `jsonrpcs` module.
@miconda can you please elaborate? Is the problem related to the jump from readline 7.0 to 8.X?
@linuxmaniac It used to work on Debian 10, not working anymore on Debian 11.
Example:
``` henning@teams-1~$ cat /etc/debian_version 11.5 henning@teams-1~$ sudo kamcmd kamcmd 1.5 Copyright 2006 iptelorg GmbH This is free software with ABSOLUTELY NO WARRANTY. For details type `warranty'. kamcmd> (tab entered) ^C henning@teams-1~$ dpkg -l |grep readline ii libreadline8:amd64 8.1-1 amd64 GNU readline and history libraries, run-time libraries ii readline-common 8.1-1 all GNU readline and history libraries, common files henning@teams-1-mn:~$
henning@kam03~$ cat /etc/debian_version 10.13 henning@kam03~$ sudo kamcmd kamcmd 1.5 Copyright 2006 iptelorg GmbH This is free software with ABSOLUTELY NO WARRANTY. For details type `warranty'. kamcmd> (tab entered) Display all 173 possibilities? (y or n) kamcmd> henning@kam03~$ dpkg -l |grep readline ii libreadline-dev:amd64 7.0-5 amd64 GNU readline and history libraries, development files ii libreadline5:amd64 5.2+dfsg-3+b13 amd64 GNU readline and history libraries, run-time libraries ii libreadline7:amd64 7.0-5 amd64 GNU readline and history libraries, run-time libraries rc php7.3-readline 7.3.14-1~deb10u1 amd64 readline module for PHP ii readline-common 7.0-5 all GNU readline and history libraries, common files ```
It seems to be a linking issue, interesting.
``` Debian 10: $ ldd /usr/sbin/kamcmd linux-vdso.so.1 (0x00007ffd8a1ed000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f11e0b82000) libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f11e0b68000) libreadline.so.7 => /lib/x86_64-linux-gnu/libreadline.so.7 (0x00007f11e091b000) libncurses.so.6 => /lib/x86_64-linux-gnu/libncurses.so.6 (0x00007f11e08f1000) libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (0x00007f11e08c3000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f11e08a2000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f11e06e0000) /lib64/ld-linux-x86-64.so.2 (0x00007f11e0ba5000)
Debian 11: $ ldd /usr/sbin/kamcmd linux-vdso.so.1 (0x00007ffd4bc6c000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fb3d1245000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fb3d1070000) /lib64/ld-linux-x86-64.so.2 (0x00007fb3d127e000) ```
Also do not work on ubuntu. The strange thing is that it compiles and links with readline, but aparently its not working.
``` henning@app01~/repositories/kamailio/utils/kamcmd$ make clean henning@app01~/repositories/kamailio/utils/kamcmd$ make msg
readline detected via pkg-config command completion enabled
henning@app01~/repositories/kamailio/utils/kamcmd$ make Q=0 config.mak included gcc -g -funroll-loops -Wcast-align -m64 -minline-all-stringops -falign-loops -ftree-vectorize -fno-strict-overflow -mtune=generic -pthread -DKSR_PTHREAD_MUTEX_SHARED -Wall -DNAME='"kamcmd"' -DSRNAME='"kamailio"' -DVERSION='"1.5"' -D__OS_linux -DRUN_DIR='"/var/run/kamailio/"' -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -I/usr/include/readline -DMOD_NAME="utils/kamcmd" -c kamcmd.c -o kamcmd.o -MMD -MP gcc -g -funroll-loops -Wcast-align -m64 -minline-all-stringops -falign-loops -ftree-vectorize -fno-strict-overflow -mtune=generic -pthread -DKSR_PTHREAD_MUTEX_SHARED -Wall -DNAME='"kamcmd"' -DSRNAME='"kamailio"' -DVERSION='"1.5"' -D__OS_linux -DRUN_DIR='"/var/run/kamailio/"' -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -I/usr/include/readline -DMOD_NAME="utils/kamcmd" -c parse_listen_id.c -o parse_listen_id.o -MMD -MP gcc -g -m64 -Wl,-O2 -Wl,-E -pthread -rdynamic "-ldl" -Wl,-Bsymbolic-functions kamcmd.o parse_listen_id.o -lresolv -lreadline -o kamcmd henning@app01~/repositories/kamailio/utils/kamcmd$ ldd ./kamcmd linux-vdso.so.1 (0x00007ffe653de000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f6054483000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6054291000) /lib64/ld-linux-x86-64.so.2 (0x00007f60544ca000) henning@app01~/repositories/kamailio/utils/kamcmd$ ./kamcmd -s /tmp/kamailio_ctl kamcmd 1.5 Copyright 2006 iptelorg GmbH This is free software with ABSOLUTELY NO WARRANTY. For details type `warranty'. kamcmd> ^C
```
It should be fixed by above commit, will also backport.
Closed #3284 as completed.