Hi,
I have problem with the conid variable, when I use in an event when closing a tcp
connection.
Simple kamailio.cfg:
debug=3
log_stderror=no
loadpath "/usr/lib64/kamailio/modules"
memdbg=5
memlog=5
log_facility=LOG_LOCAL3
listen=udp:10.10.8.94:5060
listen=tcp:10.10.8.94:5060
loadmodule "sl.so"
loadmodule "xlog.so"
loadmodule "pv.so"
loadmodule "tcpops.so"
request_route {
xlog("L_INFO", "Welcome TCP conn $conid\n");
exit;
}
event_route[tcp:closed] {
xlog("L_INFO", "Close TCP conn $conid\n");
}
Log:
kamailio DEBUG: <core> [core/ip_addr.c:577]: print_ip(): tcpconn_new: new tcp
connection: 10.10.9.64
kamailio DEBUG: <core> [core/tcp_main.c:1216]: tcpconn_new(): on port 38124, type
2, socket 34
kamailio DEBUG: <core> [core/tcp_main.c:1549]: tcpconn_add(): hashes:
3487:2267:2872, 19
kamailio DEBUG: <core> [core/io_wait.h:375]: io_watch_add(): processing
io_watch_add(0xb39c40, 34, 2, 0x14c2479867f0) - fd_no=28
kamailio DEBUG: <core> [core/io_wait.h:600]: io_watch_del(): DBG: io_watch_del
(0xb39c40, 34, -1, 0x0) fd_no=29 called
kamailio DEBUG: <core> [core/tcp_main.c:4557]: handle_tcpconn_ev(): sending to
child, events 2001
kamailio DEBUG: <core> [core/tcp_main.c:4227]: send2child(): selected tcp worker
idx:2 proc:14 pid:1203550 for activity on [tcp:10.10.8.94:5060], 0x14c2479867f0
kamailio DEBUG: <core> [core/tcp_read.c:1735]: handle_io(): received n=8
con=0x14c2479867f0, fd=6
kamailio DEBUG: <core> [core/tcp_read.c:284]: tcp_read_data(): EOF on connection
0x14c2479867f0 (state: 3, flags: 4118) - FD 6, bytes 218, rd-flags 10000
([10.10.9.64]:38124 -> [10.10.9.64]:5060)
kamailio DEBUG: <core> [core/tcp_read.c:1533]: tcp_read_req(): content-length=0
kamailio DEBUG: <core> [core/parser/parse_fline.c:249]: parse_first_line(): first
line type 1 (request) flags 1
kamailio DEBUG: <core> [core/parser/msg_parser.c:678]: parse_msg(): SIP Request:
kamailio DEBUG: <core> [core/parser/msg_parser.c:680]: parse_msg(): method:
<OPTIONS>
kamailio DEBUG: <core> [core/parser/msg_parser.c:682]: parse_msg(): uri:
<sip:100@localhost>
kamailio DEBUG: <core> [core/parser/msg_parser.c:684]: parse_msg(): version:
<SIP/2.0>
kamailio DEBUG: <core> [core/parser/parse_hname2.c:301]: parse_sip_header_name():
parsed header name [Via] type 1
kamailio DEBUG: <core> [core/parser/parse_via.c:1303]: parse_via_param(): Found
param type 232, <branch> = <z9hG4bKhjhs8ass877>; state=15
kamailio DEBUG: <core> [core/parser/parse_via.c:2639]: parse_via(): end of header
reached, state=5
kamailio DEBUG: <core> [core/parser/msg_parser.c:554]: parse_headers(): Via found,
flags=2
kamailio DEBUG: <core> [core/parser/msg_parser.c:556]: parse_headers(): this is the
first via
kamailio DEBUG: <core> [core/parser/parse_hname2.c:301]: parse_sip_header_name():
parsed header name [Call-ID] type 6
kamailio DEBUG: <core> [core/parser/parse_hname2.c:301]: parse_sip_header_name():
parsed header name [From] type 4
kamailio DEBUG: <core> [core/parser/parse_hname2.c:301]: parse_sip_header_name():
parsed header name [To] type 3
kamailio DEBUG: <core> [core/parser/parse_addr_spec.c:884]: parse_addr_spec(): end
of header reached, state=10
kamailio DEBUG: <core> [core/parser/msg_parser.c:172]: get_hdr_field(): <To>
[20]; uri=[sip:100@localhost]
kamailio DEBUG: <core> [core/parser/msg_parser.c:175]: get_hdr_field(): to body
(20)[<sip:100@localhost>
], to tag (0)[]
kamailio DEBUG: <core> [core/parser/parse_hname2.c:301]: parse_sip_header_name():
parsed header name [Content-Length] type 12
kamailio DEBUG: <core> [core/parser/msg_parser.c:186]: get_hdr_field():
content_length=0
kamailio DEBUG: <core> [core/parser/parse_hname2.c:301]: parse_sip_header_name():
parsed header name [CSeq] type 5
kamailio DEBUG: <core> [core/parser/msg_parser.c:153]: get_hdr_field(): cseq
<CSeq>: <63104> <OPTIONS>
kamailio DEBUG: <core> [core/receive.c:389]: receive_msg(): --- received sip
message - request - call-id: [ahoj423432432] - cseq: [63104 OPTIONS]
kamailio DEBUG: {1 ahoj423432432} <core> [core/receive.c:261]:
ksr_evrt_pre_routing(): event route core:pre-routing not defined
kamailio DEBUG: {1 ahoj423432432} <core> [core/receive.c:471]: receive_msg():
preparing to run routing scripts...
kamailio DEBUG: {1 ahoj423432432} <core> [core/tcp_main.c:1645]: _tcpconn_find():
found connection by id: 19
kamailio INFO: {1 ahoj423432432} <script>: Welcome TCP conn 19
kamailio DEBUG: {1 ahoj423432432} <core> [core/receive.c:529]: receive_msg():
request-route executed in: 47 usec
kamailio DEBUG: {1 ahoj423432432} <core> [core/usr_avp.c:637]: destroy_avp_list():
destroying list (nil)
kamailio DEBUG: {1 ahoj423432432} <core> [core/usr_avp.c:637]: destroy_avp_list():
destroying list (nil)
kamailio DEBUG: {1 ahoj423432432} <core> [core/usr_avp.c:637]: destroy_avp_list():
destroying list (nil)
kamailio DEBUG: {1 ahoj423432432} <core> [core/usr_avp.c:637]: destroy_avp_list():
destroying list (nil)
kamailio DEBUG: {1 ahoj423432432} <core> [core/usr_avp.c:637]: destroy_avp_list():
destroying list (nil)
kamailio DEBUG: {1 ahoj423432432} <core> [core/usr_avp.c:637]: destroy_avp_list():
destroying list (nil)
kamailio DEBUG: {1 ahoj423432432} <core> [core/xavp.c:640]: xavp_destroy_list():
destroying xavp list (nil)
kamailio DEBUG: {1 ahoj423432432} <core> [core/xavp.c:640]: xavp_destroy_list():
destroying xavp list (nil)
kamailio DEBUG: {1 ahoj423432432} <core> [core/xavp.c:640]: xavp_destroy_list():
destroying xavp list (nil)
kamailio DEBUG: {1 ahoj423432432} <core> [core/receive.c:628]: receive_msg():
cleaning up
kamailio DEBUG: <core> [core/tcp_read.c:1634]: tcp_read_req(): EOF after reading
complete request ([10.10.9.64]:38124 -> [10.10.9.64]:5060)
kamailio DEBUG: <core> [core/tcp_read.c:1653]: release_tcpconn(): releasing con
0x14c2479867f0, state -1, fd=6, id=19 ([10.10.9.64]:38124 -> [10.10.9.64]:5060)
kamailio DEBUG: <core> [core/tcp_read.c:1657]: release_tcpconn(): extra_data (nil)
kamailio DEBUG: <core> [core/tcp_main.c:3653]: handle_tcp_child(): reader response=
14c2479867f0, -1 from 2
kamailio DEBUG: <core> [core/tcp_main.c:3578]: tcp_emit_closed_event(): TCP closed
event creation triggered (reason: 0)
kamailio DEBUG: tcpops [tcpops.c:295]: tcpops_handle_tcp_closed(): received TCP closed
event
kamailio DEBUG: tcpops [tcpops.c:249]: tcpops_tcp_closed_run_route(): event reason id: 0
rt: 1
kamailio INFO: <script>: Close TCP conn <null>
Can you help me, where is issue?