<html><head><meta http-equiv="content-type" content="text/html; charset=us-ascii"><style>body { line-height: 1.5; }body { font-size: 14px; font-family: ??; color: rgb(0, 0, 0); line-height: 1.5; }</style></head><body>
<div><span></span><div><span style="background-color: transparent;">Hello Kamailio community</span></div><div><br></div><div>kamailio v5.5.4</div><div>debian10</div><div><br></div><div>Lua Scripting Routing:</div><div><br></div><div>listen=tcp:127.0.0.1:5060</div><div>tcp_accept_no_cl=yes</div><div>loadmodule "xhttp.so"</div><div>loadmodule "app_lua.so"</div><div>modparam("app_lua", "load", "/etc/kamailio/kamailio.lua")</div><div>cfgengine "lua"</div><div><br></div><div>function ksr_xhttp_event()</div><div><span style="background-color: rgba(0, 0, 0, 0); color: rgb(0, 0, 0);">    </span>KSR.set_reply_no_connect()</div><div><span style="white-space:pre">    </span>KSR.set_reply_close()<span style="white-space:pre">        </span></div><div><span style="white-space:pre">      </span>KSR.xhttp.xhttp_reply(404, "Not Found", "text/plain", "Not Found")<span style="white-space:pre">     </span></div><div>end</div><div><br></div><div>curl http://127.0.0.1:5060 -vvv</div><div>* Expire in 0 ms for 6 (transfer 0x555d93fd9fb0)</div><div>*   Trying 127.0.0.1...</div><div>* TCP_NODELAY set</div><div>* Expire in 200 ms for 4 (transfer 0x555d93fd9fb0)</div><div>* Connected to 127.0.0.1 (127.0.0.1) port 5060 (#0)</div><div>> GET / HTTP/1.1</div><div>> Host: 127.0.0.1:5060</div><div>> User-Agent: curl/7.64.0</div><div>> Accept: */*</div><div>></div><div>< HTTP/1.1 404 Not Found</div><div>< Sia: SIP/2.0/TCP 127.0.0.1:54944</div><div>< Content-Type: text/plain</div><div>< Server: kamailio (5.4.4 (x86_64/linux))</div><div>< Content-Length: 9</div><div><</div><div>* Connection #0 to host 127.0.0.1 left intact</div><div><br></div><div>The output of curl is OK, but have some unexpected error in kamailio.log</div><div><br></div><div>ERROR: <core> [core/parser/parse_fline.c:271]: parse_first_line(): parse_first_line: bad message (offset: 16)</div><div>ERROR: <core> [core/parser/msg_parser.c:681]: parse_msg(): ERROR: parse_msg: message=<HTTP/1.1 404 Not Found#015#012Sia: SIP/2.0/TCP 127.0.0.1:54946#015#012Content-Type: text/plain#015#012Server: kamailio (5.4.4 (x86_64/linux))#015#012Content-Length: 9#015#012#015#012Not Found></div><div>ERROR: <core> [core/msg_translator.c:3235]: build_sip_msg_from_buf(): parsing failed</div><div><br></div><div>now change to Native Scripting Routing:</div><div>listen=tcp:127.0.0.1:5060</div><div>tcp_accept_no_cl=yes</div><div>loadmodule "xhttp.so"</div><div><br></div><div>event_route[xhttp:request] {</div><div><span style="white-space:pre">  </span>set_reply_close();</div><div><span style="white-space:pre">    </span>set_reply_no_connect();</div><div><span style="white-space:pre">       </span>xhttp_reply("404", "Not Found", "text/plain", "Not Found");</div><div><span style="white-space:pre">   </span>exit;</div><div>}</div><div><br></div><div>curl http://127.0.0.1:5060 -vvv</div><div><br></div><div>everything is ok.</div></div><div><br></div><div><br></div><div>here is the Navite config file:</div><div><div><span style="background-color: rgba(0, 0, 0, 0); color: rgb(0, 0, 0);">    </span>http://220.231.180.131:12296/kam/native/</div><div><br></div><div>here is the Lua config file:</div><div><span style="background-color: rgba(0, 0, 0, 0); color: rgb(0, 0, 0);">    </span>http://220.231.180.131:12296/kam/kemi/</div></div>
<div><br></div><hr style="width: 210px; height: 1px;" color="#b5c4df" size="1" align="left">
<div><span>hanxiaofang</span></div><div><span><br></span></div>
</body></html>