Hi.
I'm building small HTTP API using kemi lua on kamailio 5.1
version:

kamailio -v
version: kamailio 5.1.2 (x86_64/linux)
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, 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_LISTEN 16, 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 on 18:16:53 Apr 7 2018 with gcc 4.8.5

On the system
Linux CentOS-74-64-minimal 3.10.0-693.17.1.el7.x86_64 #1 SMP Thu Jan 25 20:13:58 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

When i sending xhttp_reply I getting wrong code that kamailio sends to the client instead of code I use
Im used as this exmaple as template
int xhttp_reply(int code, str "reason", str "ctype", str "body")
as classic (with code in string)

KSR.xhttp.xhttp_reply("200", "OK", application/json, "")

So in both cases I getting next trouble:

When i trying to set params to the xhttp_reply i getting this in the log (on debug layer)

DEBUG: app_lua [app_lua_sr.c:1500]: sr_kemi_lua_exec_func_ex(): param[0] for: xhttp_reply is int: 200
DEBUG: app_lua [app_lua_sr.c:1496]: sr_kemi_lua_exec_func_ex(): param[1] for: xhttp_reply is str: OK
DEBUG: app_lua [app_lua_sr.c:1496]: sr_kemi_lua_exec_func_ex(): param[2] for: xhttp_reply is str: application/json

but next string I shows
DEBUG: xhttp [xhttp_mod.c:443]: xhttp_send_reply(): sending out response: 161110576 OK

This first 3 digits at the reslonse I see
161 110576

Digits are random, as positive as negative (with "-" at the start)


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.