-
Notifications
You must be signed in to change notification settings - Fork 919
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sipcapture: "core parsing of SIP message failed" with tcp defragmented message #9
Comments
It looks like parameter +g.3gpp.icsi-ref has an invalid value -- the values for URI parameters must not be enclosed in double-quotes. Maybe you can paste full SIP message here in order to see exactly how the Contact body is. |
also will be good to know how you duplicate SIP messages: captagent, sip_trace ? |
I use the captagent with tcpdefrag on, the full message is this: INVITE sip:xxxxx00000000xx@10.x.x.x:5060;alias=10.x.x.x This part is missing in homer: X-RTP: mo. |
as Daniel already told, the URI parameter should not contain non escaped double quotes: URI parameters: Parameters affecting a request constructed from
The angle-bracket "<" and ">" and double-quote (") characters are delims = "<" | ">" | "#" | "%" | <"> ask your vendor to fix it or make a workaround in the captagent/sipcapture module |
I expect that the contact should be like: Contact: sip:xxxxxxxxxxxx@10.x.x.x:5060;alias=10.x.x.x Starting with +g.3gpp.icsi-ref, it should be header parameter, not uri -- the uri is enclosed in between < >. It might be that a node in the path is building the wrong Contact format. |
The contact from attached screenshot seems ok, do you still get troubles with it? |
yes.. the previous ( copy/paste) post not showing all symbols ( characters ) |
To understand properly, the invite in screenshot is coming to kamailio server and the one you pasted as text before is received by sipcapture node, mirrored by capture agent? You paste here data but don't give any description from where you took it and the context when it happens. It is hard to guess and therefore impossible to really help. |
the message is from kamailio sipcapture node who recieved it from captagent |
The problem is in the sip_captute table , column msg - the Length is too small in my case.. |
The code enabled by SIG_DEBUG inside signal handlers is async-signal-unsafe (see the signal-safetey(7) man page), as it calls at least syslog(3) and stdio functions. During a daemon shutdown via a SIGTERM, we got a crash in isatty(3) due to stack exhaustion from infinite nested calls within stdio coming from the syslog(3) in src/main.c:sig_usr(): #0 0x00007f691903fe6d in __isatty (fd=2) at ../sysdeps/posix/isatty.c:24 term = <error reading variable term (Cannot access memory at address 0x7fffa44f4fb0)> kamailio#1 0x00007f6918fc37bb in local_isatty (fd=<optimized out>) kamailio#2 __GI__IO_file_doallocate (fp=0x7f6919110680 <_IO_2_1_stderr_>) kamailio#3 0x00007f6918fd1700 in __GI__IO_doallocbuf ( kamailio#4 0x00007f6918fd0988 in _IO_new_file_overflow ( kamailio#5 0x00007f6918fcfa8f in _IO_new_file_xsputn (n=8, data=<optimized out>, kamailio#6 _IO_new_file_xsputn (f=0x7f6919110680 <_IO_2_1_stderr_>, 7 0x00007f6918fa41fb in _IO_vfprintf_internal ( kamailio#8 0x00007f6918fc32e8 in locked_vfxprintf ( kamailio#9 0x00007f6918fc3469 in __fxprintf (fp=0x7f6919110680 <_IO_2_1_stderr_>, kamailio#10 0x00007f6918fd3a50 in __malloc_assert ( kamailio#11 0x00007f6918fd5e6f in sysmalloc (nb=nb@entry=4112, kamailio#12 0x00007f6918fd72c9 in _int_malloc ( kamailio#13 0x00007f6918fd83e3 in __GI___libc_malloc (bytes=bytes@entry=4096) [ next calls nested until stack exhaustion ] #41030 0x00007f6918fc371c in __GI__IO_file_doallocate ( #41031 0x00007f6918fd1700 in __GI__IO_doallocbuf ( #41032 0x00007f6918fd0988 in _IO_new_file_overflow ( #41033 0x00007f6918fcfa8f in _IO_new_file_xsputn (n=8, data=<optimized out>, #41034 _IO_new_file_xsputn (f=0x7f6919110680 <_IO_2_1_stderr_>, #41035 0x00007f6918fa41fb in _IO_vfprintf_internal ( #41036 0x00007f6918fc32e8 in locked_vfxprintf ( #41037 0x00007f6918fc3469 in __fxprintf (fp=0x7f6919110680 <_IO_2_1_stderr_>, #41038 0x00007f6918fd3a50 in __malloc_assert ( #41039 0x00007f6918fd5e6f in sysmalloc (nb=nb@entry=4112, #41040 0x00007f6918fd72c9 in _int_malloc ( #41041 0x00007f6918fd83e3 in __GI___libc_malloc (bytes=bytes@entry=4096) #41042 0x00007f6918fc371c in __GI__IO_file_doallocate ( #41043 0x00007f6918fd1700 in __GI__IO_doallocbuf ( #41044 0x00007f6918fd0988 in _IO_new_file_overflow ( #41045 0x00007f6918fcfa8f in _IO_new_file_xsputn (n=8, data=<optimized out>, #41046 _IO_new_file_xsputn (f=0x7f6919110680 <_IO_2_1_stderr_>, #41047 0x00007f6918fa41fb in _IO_vfprintf_internal ( #41048 0x00007f6918fc32e8 in locked_vfxprintf ( #41049 0x00007f6918fc3469 in __fxprintf (fp=0x7f6919110680 <_IO_2_1_stderr_>, #41050 0x00007f6918fd3a50 in __malloc_assert ( #41051 0x00007f6918fd5e6f in sysmalloc (nb=nb@entry=8208, #41052 0x00007f6918fd72c9 in _int_malloc ( #41053 0x00007f6918fd91a2 in __libc_calloc (n=n@entry=1, #41054 0x00007f6918fcc0b3 in __GI___open_memstream ( #41055 0x00007f69190477e0 in __GI___vsyslog_chk (pri=189, flag=-1, #41056 0x00007f6919047d4c in __syslog (pri=<optimized out>, #41057 0x0000563a58b01c08 in sig_usr (signo=<optimized out>) at main.c:857 #41058 sig_usr (signo=<optimized out>) at main.c:816 #41059 <signal handler called> While this is certainly not easy to trigger, it's still not correct to leave enabled in production builds. It might be an acceptable tradeoff as a debugging aid, though. So we switch the the code to off by default, and swap the meaning of the macro to enable the unsafe debugging, to match.
# This is the 1st commit message: ss7ops: updated with relocation of lib/srutils to core/utils # This is the commit message #2: tmrec: updated with relocation of lib/srutils to core/utils # This is the commit message #3: topos: updated with relocation of lib/srutils to core/utils # This is the commit message #4: uac_redirect: updated with relocation of lib/srutils to core/utils # This is the commit message kamailio#5: usrloc: updated with relocation of lib/srutils to core/utils # This is the commit message kamailio#6: pkg: obs spec - removed lib/srutils from rpm pacaging # This is the commit message kamailio#7: core: crypto, utils - updated comments referencing srutils after relocation # This is the commit message kamailio#8: corex: declare nio specific globals in c file # This is the commit message kamailio#9: Makefile.defs: add -lm to linker flags - on some linux distros is not linked by default # This is the commit message kamailio#10: pipelimit: make error log debug in rpc command when pipe not found - error code is returned to rpc command # This is the commit message kamailio#11: tls: proper match of config profile by server id # This is the commit message kamailio#12: http_client: typo in variable name for network interface # This is the commit message kamailio#13: core: dprint - new flags for long engine json - a: prefix attribute names with application name - A: do not prefix message attribute with application name (when 'a' is set) # This is the commit message kamailio#14: sipdump: small whitespace fixes # This is the commit message kamailio#15: sipdump: option to run event_route[sipdump:msg] on rcv/snd messages - new modparam mode to control the behaviour, its values can be built from flags: - 1 - write to files (the existing behaviour), default - 2 - execute event route - inside event route, $sipdump(...) variable is available to get the buffer content and other related attributes - new modparam event_callback to set the KEMI function to be run instead of the event route # This is the commit message kamailio#16: sipdump: docs for mode and event_callback parameters # This is the commit message kamailio#17: sipdump: docs for event route sipdump:msg # This is the commit message kamailio#18: modules: readme files regenerated - sipdump ... [skip ci] # This is the commit message kamailio#19: sipdump: kemi functions to return buf and tag values # This is the commit message kamailio#20: seas: docs - removed mi_fifo from examples # This is the commit message kamailio#21: modules: readme files regenerated - seas ... [skip ci] # This is the commit message kamailio#22: textops: docs - proper example for append_body_part() with headers # This is the commit message kamailio#23: modules: readme files regenerated - textops ... [skip ci]
Contact: sip:xxxxxxxxxxxx@x.x.x.x:5060;alias=x.x.x.x
480942;+g.3gpp.icsi-ref="urn%3Aurn-7%3A3gpp-service>4(21951) ERROR: [receive.c:149]: receive_msg(): core parsing of SIP message failed (x.x.x.x:5060/1)
4(21951) ERROR: [parser/msg_parser.c:277]: get_hdr_field(): ERROR: get_hdr_field: bad body for <Contact: sip:x.x.x.x@x.x.x.x:5060;alias=x.x.x.x~48094~2;+g.3gpp.icsi-ref="urn%3Aurn-7%3A3gpp-service>(7)
4(21951) INFO: [parser/msg_parser.c:355]: parse_headers(): ERROR: bad header field [Contact: <sip:xxxxx]
4(21951) ERROR: [parser/msg_parser.c:705]: parse_msg(): ERROR: parse_msg: message=<INVITE sip:xxxxxxxxxxxx@x.x.x.x:5060;alias=x.x.x.x
50601 SIP/2.0The text was updated successfully, but these errors were encountered: