Hi community.
We experience the problem with malformed messages.
First of all, I want to say, that most of time kamailio works well and nothing happens that can drop sessions.
But from time-to-time something changes (may be in the network) and kamailio receives requests with malformed headers (To or From hfs).
Malformed messages were received only from asterisk server.
Sip debug on asterisk showed that messages were transmitted correctly and headers were nice.
But kamailio obtains changed (broken) packets or perhaps can't read them properly.
Nov 10 12:37:06 kamailio-name kamailio[965]: INFO: <script>: Going to NATMANAGE for BYE from sip:useragent7122@kamailio_address:5068 (IP=wss:client_address:62881) - R=sip:dialed_did_service@asterisk_address:50600 ID=1b0044070de406153bf0e4b84d6bb793@asterisk_address:50600
Nov 10 12:37:06 kamailio-name kamailio[965]: NOTICE: <script>: Relaying request to <null> - R=sip:dialed_did_service@asterisk_address:50600 ID=1b0044070de406153bf0e4b84d6bb793@asterisk_address:50600
Nov 10 12:37:06 kamailio-name kamailio[965]: ERROR: <core> [parser/parse_addr_spec.c:719]: parse_addr_spec(): unexpected char [<] in status 6: [<sip:useragent6] .
Nov 10 12:37:06 kamailio-name kamailio[965]: ERROR: <core> [parser/parse_from.c:75]: parse_from_header(): bad From header [<sip:useragent6<+.w>;tag=jja7l45gd1]
Nov 10 12:37:06 kamailio-name kamailio[965]: ERROR: dialog [dlg_cseq.c:89]: dlg_cseq_prepare_msg(): cannot parse FROM header
Nov 10 12:37:06 kamailio-name kamailio[937]: ERROR: <core> [parser/parse_addr_spec.c:719]: parse_addr_spec(): unexpected char [<] in status 6: [<sip:useragent6] .
Nov 10 12:37:06 kamailio-name kamailio[937]: ERROR: <core> [parser/parse_from.c:75]: parse_from_header(): bad From header [<sip:useragent6<+.w>;tag=jja7l45gd1]
Nov 10 12:37:06 kamailio-name kamailio[937]: ERROR: dialog [dlg_cseq.c:89]: dlg_cseq_prepare_msg(): cannot parse FROM header
Nov 10 12:37:06 kamailio-name kamailio[937]: ERROR: <core> [parser/parse_addr_spec.c:719]: parse_addr_spec(): unexpected char [<] in status 6: [<sip:useragent6] .
Nov 10 12:37:06 kamailio-name kamailio[937]: ERROR: <core> [parser/parse_from.c:75]: parse_from_header(): bad From header [<sip:useragent6<+.w>;tag=jja7l45gd1]
Nov 10 12:37:06 kamailio-name kamailio[937]: ERROR: uac [replace.c:783]: restore_uris_reply(): failed to find/parse FROM hdr
Nov 10 12:37:06 kamailio-name kamailio[937]: ERROR: <core> [parser/parse_addr_spec.c:719]: parse_addr_spec(): unexpected char [<] in status 6: [<sip:useragent6] .
Nov 10 12:37:06 kamailio-name kamailio[937]: ERROR: <core> [parser/parse_from.c:75]: parse_from_header(): bad From header [<sip:useragent6<+.w>;tag=jja7l45gd1]
Nov 10 12:37:06 kamailio-name kamailio[937]: ERROR: pv [pv_core.c:465]: pv_get_from_attr(): cannot parse From header
Nov 10 12:37:06 kamailio-name kamailio[937]: INFO: <script>: Skip manage DEVICE_STATE for BYE from <null> (IP=udp:asterisk_address:50600) with (200 - OK) - R=<null> ID=1b0044070de406153bf0e4b84d6bb793@asterisk_address:50600
Nov 10 12:37:06 kamailio-name kamailio[937]: INFO: <script>: ------------------------------------MANAGE BYE by DEVICE_STATE_BYE_MANAGE route - 200 - OK M=BYE IP=udp:asterisk_address:50600 ID=1b0044070de406153bf0e4b84d6bb793@asterisk_address:50600
Nov 10 12:37:06 kamailio-name kamailio[937]: ERROR: <core> [parser/parse_addr_spec.c:719]: parse_addr_spec(): unexpected char [<] in status 6: [<sip:useragent6] .
Nov 10 12:37:06 kamailio-name kamailio[937]: ERROR: <core> [parser/parse_from.c:75]: parse_from_header(): bad From header [<sip:useragent6<+.w>;tag=jja7l45gd1]
Nov 10 12:37:06 kamailio-name kamailio[937]: ERROR: pv [pv_core.c:465]: pv_get_from_attr(): cannot parse From header
Nov 10 12:37:06 kamailio-name kamailio[937]: ERROR: <core> [parser/parse_addr_spec.c:719]: parse_addr_spec(): unexpected char [<] in status 6: [<sip:useragent6] .
Nov 10 12:37:06 kamailio-name kamailio[937]: ERROR: <core> [parser/parse_from.c:75]: parse_from_header(): bad From header [<sip:useragent6<+.w>;tag=jja7l45gd1]
Nov 10 12:37:06 kamailio-name kamailio[937]: ERROR: rtpengine [rtpengine_funcs.c:331]: get_from_tag(): failed to parse From header
Nov 10 12:37:06 kamailio-name kamailio[937]: ERROR: rtpengine [rtpengine.c:2252]: rtpp_function_call(): can't get From tag
Nov 10 12:37:06 kamailio-name kamailio[937]: ERROR: <core> [parser/parse_addr_spec.c:719]: parse_addr_spec(): unexpected char [<] in status 6: [<sip:useragent6] .
Nov 10 12:37:06 kamailio-name kamailio[937]: ERROR: <core> [parser/parse_from.c:75]: parse_from_header(): bad From header [<sip:useragent6<+.w>;tag=jja7l45gd1]
Nov 10 12:37:06 kamailio-name kamailio[937]: ERROR: pv [pv_core.c:465]: pv_get_from_attr(): cannot parse From header
Nov 10 12:37:06 kamailio-name kamailio[937]: ERROR: <core> [parser/parse_addr_spec.c:719]: parse_addr_spec(): unexpected char [<] in status 6: [<sip:useragent6] .
Nov 10 12:37:06 kamailio-name kamailio[937]: ERROR: <core> [parser/parse_from.c:75]: parse_from_header(): bad From header [<sip:useragent6<+.w>;tag=jja7l45gd1]
Nov 10 12:37:06 kamailio-name kamailio[937]: ERROR: pv [pv_core.c:465]: pv_get_from_attr(): cannot parse From header
How the packet looks like:
ACK sip:tt7etmau@bb0pd5t63b26.invalid;alias=client_address~57573~6;transport=ws SIP/2.0
Via: SIP/2.0/UDP asterisk_address:50600;branch=z9hG4bK117106ca;rport
Route: <sip:kam2.domain.com:5068;nat=yes;transport=udp;r2=on;ftag=as06869a5d;lr=on;vsf=AAAAAEZZSVVDVV1VRBlUUkUpFQxdVUZYXiRCHU1RQl1HRVNaXhhAQ3RuLnR3aWxpby5jb20-;vst=AAAAAAAAAAAAAAAAAAAAAAAfBwQRQE8NBR9BChIFAwddCgADFEVDQlYudHdpbGlvLmNvbQ--;did=b0c.7331>,<sip:kam2.callision.com:5068;nat=yes;transport=ws;r2=on;ftag=as06869a5d;lr=on;vsf=AAAAAEZZSVVDVV1VRBlUUkUpFQxdVUZYXiRCHU1RQl1HRVNaXhhAQ3RuLnR3aWxpby5jb20-;vst=AAAAAAAAAAAAAAAAAAAAAAAfBwQRQE8NBR9BChIFAwddCgADFEVDQlYudHdpbGlvLmNvbQ--;did=b0c.7331>
Max-Forwards: 70
From: "19172423539" <sip:19172423539@asterisk_address:50600>;tag=as06869a5d
Contact: <sip:19172423539@asterisk_address:50600>
Call-ID: 629d5a132c194c536b5f5c1a2a3c6e32@asterisk_address:50600
CSeq: 102 ACK
User-Agent: asterisk PBX
Content-Length: 0
The transport is used to send messages between asterisk and kamailio is TCP.
Thanks in advance.