<p>Hi.<br>
I'm building small HTTP API using kemi lua on kamailio 5.1<br>
version:</p>
<p>kamailio -v<br>
version: kamailio 5.1.2 (x86_64/linux)<br>
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<br>
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB<br>
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.<br>
id: unknown<br>
compiled on 18:16:53 Apr  7 2018 with gcc 4.8.5</p>
<p>On the system<br>
Linux CentOS-74-64-minimal 3.10.0-693.17.1.el7.x86_64 <a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="31891578" data-permission-text="Issue title is private" data-url="https://github.com/kamailio/kamailio/issues/1" href="https://github.com/kamailio/kamailio/issues/1">#1</a> SMP Thu Jan 25 20:13:58 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux</p>
<p>When i sending xhttp_reply I getting wrong code that kamailio sends to the client instead of code I use<br>
Im used as this exmaple as template<br>
int xhttp_reply(int code, str "reason", str "ctype", str "body")<br>
as classic (with code in string)</p>
<p><code>KSR.xhttp.xhttp_reply("200", "OK", application/json, "")</code></p>
<p>So in both cases I getting next trouble:</p>
<p>When i trying to set params to the xhttp_reply i getting this in the log (on debug layer)</p>
<p>DEBUG: app_lua [app_lua_sr.c:1500]: sr_kemi_lua_exec_func_ex(): param[0] for: xhttp_reply is int: 200<br>
DEBUG: app_lua [app_lua_sr.c:1496]: sr_kemi_lua_exec_func_ex(): param[1] for: xhttp_reply is str: OK<br>
DEBUG: app_lua [app_lua_sr.c:1496]: sr_kemi_lua_exec_func_ex(): param[2] for: xhttp_reply is str: application/json</p>
<p>but next string I shows<br>
DEBUG: xhttp [xhttp_mod.c:443]: xhttp_send_reply(): sending out response: 161110576 OK</p>
<p>This first 3 digits at the reslonse I see<br>
<strong>161</strong> 110576</p>
<p>Digits are random, as positive as negative (with "-" at the start)</p>

<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/1544">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZTktdk-uzz0UQ29MVM50rKe48dR6ks5t1xdDgaJpZM4UM7oC">mute the thread</a>.<img src="https://github.com/notifications/beacon/AF36ZSY9BYnYKPZ3ci8VwqWbukPNR6XBks5t1xdDgaJpZM4UM7oC.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/1544","url":"https://github.com/kamailio/kamailio/issues/1544","name":"View Issue"},"description":"View this Issue on GitHub","publisher":{"@type":"Organization","name":"GitHub","url":"https://github.com"}}</script>
<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://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"KSR.xhttp.xhttp_reply code cant understand type (#1544)"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1544"}}}</script>
<script type="application/ld+json">{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"hideOriginalBody": "false",
"originator": "37567f93-e2a7-4e2a-ad37-a9160fc62647",
"title": "KSR.xhttp.xhttp_reply code cant understand type (#1544)",
"sections": [
{
"text": "",
"activityTitle": "**ovoshlook**",
"activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png",
"activitySubtitle": "@ovoshlook",
"facts": [
{
"name": "Repository: ",
"value": "kamailio/kamailio"
},
{
"name": "Issue #: ",
"value": 1544
}
]
}
],
"potentialAction": [
{
"name": "Add a comment",
"@type": "ActionCard",
"inputs": [
{
"isMultiLine": true,
"@type": "TextInput",
"id": "IssueComment",
"isRequired": false
}
],
"actions": [
{
"name": "Comment",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"kamailio/kamailio\",\n\"issueId\": 1544,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}"
}
]
},
{
"name": "Close issue",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueClose\",\n\"repositoryFullName\": \"kamailio/kamailio\",\n\"issueId\": 1544\n}"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/kamailio/kamailio/issues/1544"
}
],
"@type": "OpenUri",
"name": "View on GitHub"
},
{
"name": "Unsubscribe",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 338934274\n}"
}
],
"themeColor": "26292E"
}</script>