Re: event_route[xhttp:request] is not executed

Federico Cabiddu via sr-users <[email protected]>
Newsgroups gmane.comp.voip.ser
Message-ID <CAFOaF_i6FYoJkF8vourvnZiqRpMR4RYqYJmdoN0pRh4pobSQzA@mail.gmail.com>
Hi,
try adding

tcp_accept_no_cl=yes

to your config. (
https://www.kamailio.org/wiki/cookbooks/devel/core#tcp_accept_no_cl)

Regards,

Federico

On Tue, Jun 3, 2025 at 8:26 PM Володимир Іванець via sr-users <
[email protected]> wrote:

> Hello!
>
> I'm doing some testing with http requests but got stuck at the
> beginning. event_route[xhttp:request] does not seem to be executed. I'm
> getting the following in the log with the most basic configuration. Am I
> missing something?
>
> Jun  3 20:50:35 kamailio-dev-2 kamailio[9148]: 13(9161) DEBUG: <core>
> [core/ip_addr.c:577]: print_ip(): tcpconn_new: new tcp connection: 127.0.0.1
> Jun  3 20:50:35 kamailio-dev-2 kamailio[9148]: 13(9161) DEBUG: <core>
> [core/tcp_main.c:1238]: tcpconn_new(): on port 46328, type 2, socket 23
> Jun  3 20:50:35 kamailio-dev-2 kamailio[9148]: 13(9161) DEBUG: <core>
> [core/tcp_main.c:1630]: tcpconn_add(): hashes: 1391:1425:2615, 2
> Jun  3 20:50:35 kamailio-dev-2 kamailio[9148]: 13(9161) DEBUG: <core>
> [core/io_wait.h:367]: io_watch_add(): processing io_watch_add(0xb22d80, 23,
> 2, 0x7f7a63877f30) - fd_no=17
> Jun  3 20:50:35 kamailio-dev-2 kamailio[9148]: 13(9161) DEBUG: <core>
> [core/io_wait.h:598]: io_watch_del(): DBG: io_watch_del (0xb22d80, 23, -1,
> 0x0) fd_no=18 called
> Jun  3 20:50:35 kamailio-dev-2 kamailio[9148]: 13(9161) DEBUG: <core>
> [core/tcp_main.c:4671]: handle_tcpconn_ev(): sending to child, events 1
> Jun  3 20:50:35 kamailio-dev-2 kamailio[9148]: 13(9161) DEBUG: <core>
> [core/tcp_main.c:4335]: send2child(): selected tcp worker idx:1 proc:10
> pid:9158 for activity on [tcp:127.0.0.1:8089], 0x7f7a63877f30
> Jun  3 20:50:35 kamailio-dev-2 kamailio[9148]: 10(9158) DEBUG: <core>
> [core/tcp_read.c:1782]: handle_io(): received n=8 con=0x7f7a63877f30, fd=6
> Jun  3 20:50:35 kamailio-dev-2 kamailio[9148]: 10(9158) DEBUG: <core>
> [core/tcp_read.c:627]: tcp_read_headers(): no clen, p=A
> Jun  3 20:50:35 kamailio-dev-2 kamailio[9148]: 10(9158) ERROR: <core>
> [core/tcp_read.c:1555]: tcp_read_req(): bad request, state=7, error=4 buf:
> Jun  3 20:50:35 kamailio-dev-2 kamailio[9148]: GET /TEST HTTP/1.1
> Jun  3 20:50:35 kamailio-dev-2 kamailio[9148]: Host: 127.0.0.1:8089
> Jun  3 20:50:35 kamailio-dev-2 kamailio[9148]: User-Agent: curl/7.43.0
> Jun  3 20:50:35 kamailio-dev-2 kamailio[9148]: Accept: */*
> Jun  3 20:50:35 kamailio-dev-2 kamailio[9148]: parsed:
> Jun  3 20:50:35 kamailio-dev-2 kamailio[9148]: GET /TEST HTTP/1.1
> Jun  3 20:50:35 kamailio-dev-2 kamailio[9148]: Host: 127.0.0.1:8089
> Jun  3 20:50:35 kamailio-dev-2 kamailio[9148]: User-Agent: curl/7.43.0
> Jun  3 20:50:35 kamailio-dev-2 kamailio[9148]: Accept: */*
> Jun  3 20:50:35 kamailio-dev-2 kamailio[9148]: 10(9158) DEBUG: <core>
> [core/tcp_read.c:1562]: tcp_read_req(): received from: port 46328
> Jun  3 20:50:35 kamailio-dev-2 kamailio[9148]: 10(9158) DEBUG: <core>
> [core/ip_addr.c:577]: print_ip(): received from: ip127.0.0.1
> Jun  3 20:50:35 kamailio-dev-2 kamailio[9148]: 10(9158) DEBUG: <core>
> [core/tcp_read.c:1704]: release_tcpconn(): releasing con 0x7f7a63877f30,
> state -2, fd=6, id=2 ([127.0.0.1]:46328 -> [127.0.0.1]:8089)
> Jun  3 20:50:35 kamailio-dev-2 kamailio[9148]: 10(9158) DEBUG: <core>
> [core/tcp_read.c:1705]: release_tcpconn(): extra_data (nil)
> Jun  3 20:50:35 kamailio-dev-2 kamailio[9148]: 13(9161) DEBUG: <core>
> [core/tcp_main.c:3745]: handle_tcp_child(): reader response= 7f7a63877f30,
> -2 from 1
> Jun  3 20:50:35 kamailio-dev-2 kamailio[9148]: 13(9161) DEBUG: <core>
> [core/tcp_main.c:3668]: tcp_emit_closed_event(): TCP closed event creation
> triggered (reason: 0)
> Jun  3 20:50:35 kamailio-dev-2 kamailio[9148]: 13(9161) DEBUG: <core>
> [core/tcp_main.c:3676]: tcp_emit_closed_event(): no callback registering
> for handling TCP closed event
>
>
>
>
> #!KAMAILIO
>
>
> children = 4
> tcp_children = 4
>
>
> debug=3
> log_stderror=yes
> memdbg=5
> memlog=5
>
>
> fork=yes
>
>
> #!substdef "!LOCAL_UDP!udp:127.0.0.1:5060!g"
> #!substdef "!LOCAL_HTTP!tcp:127.0.0.1:8089!g"
>
>
> listen=LOCAL_UDP
> listen=LOCAL_HTTP
>
>
> loadmodule "xlog.so"
> loadmodule "pv.so"
> loadmodule "ctl.so"
> loadmodule "sl.so"
> loadmodule "xhttp.so"
>
>
> event_route[xhttp:request] {
>     xhttp_reply("200", "OK", "text/html",
>         "<html><body>OK - [$si:$sp]</body></html>");
>
> }
>
>
> Thank you very much!
> __________________________________________________________
> Kamailio - Users Mailing List - Non Commercial Discussions --
> [email protected]
> To unsubscribe send an email to [email protected]
> Important: keep the mailing list in the recipients, do not reply only to
> the sender!
>

__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the sender!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.