[SR-Users] Malformed To header, or?

Tobias the_fx at hotmail.com
Fri Oct 28 21:14:47 CEST 2016


Hi!

Having some issues with Kamailio 4.3 reporting a malformed header, but I cannot seem to figure out what's wrong.

The problem seen is:
Oct 27 13:48:56  /usr/sbin/kamailio[13765]: ERROR: <core> [parser/parse_addr_spec.c:678]: parse_addr_spec(): ERROR: parse_to : unexpected char [#015] in status 6: <<+123456789 <sip:123456789 at 127.0.0.1;tag=as4aa27bd0>> .
Oct 27 13:48:56  /usr/sbin/kamailio[13765]: ERROR: <core> [parser/msg_parser.c:165]: get_hdr_field(): ERROR: get_hdr_field: bad to header
Oct 27 13:48:56  /usr/sbin/kamailio[13765]: INFO: <core> [parser/msg_parser.c:338]: parse_headers(): ERROR: bad header field [To: +123456789 <si]
Oct 27 13:48:56  /usr/sbin/kamailio[13765]: ERROR: tm [t_lookup.c:1050]: t_check_msg(): ERROR: reply cannot be parsed
Oct 27 13:48:56  /usr/sbin/kamailio[13765]: ERROR: <core> [parser/parse_addr_spec.c:678]: parse_addr_spec(): ERROR: parse_to : unexpected char [#015] in status 6: <<+123456789 <sip:123456789 at 127.0.0.1;tag=as4aa27bd0>> .
Oct 27 13:48:56  /usr/sbin/kamailio[13765]: ERROR: <core> [parser/msg_parser.c:165]: get_hdr_field(): ERROR: get_hdr_field: bad to header
Oct 27 13:48:56  /usr/sbin/kamailio[13765]: INFO: <core> [parser/msg_parser.c:338]: parse_headers(): ERROR: bad header field [To: +123456789 <si]
Oct 27 13:48:56  /usr/sbin/kamailio[13765]: ERROR: <core> [msg_translator.c:1457]: adjust_clen(): error parsing content-length
Oct 27 13:48:56  /usr/sbin/kamailio[13765]: ERROR: <core> [msg_translator.c:2214]: generate_res_buf_from_sip_res(): error while adjusting Content-Length
Oct 27 13:48:56  /usr/sbin/kamailio[13765]: ERROR: <core> [forward.c:760]: do_forward_reply(): building failed

And the To header seen at this point is:
To: +123456789 <sip:123456789 at 127.0.0.1>;tag=as24ed5606.

version: kamailio 4.3.4 (x86_64/linux)
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, DBG_QM_MALLOC, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown
compiled with gcc 4.7.2

I obviously understand Kamailio views this To header as malformed, but what I cannot understand is why? Is it as simple as the number +123456789 is not enclosed with ", i.e. it should be sent as "+123456789"?

A similar issue seen, which for some reason doesn't create an ERROR, is when Kamailio receives a reINVITE looking like this which it's supposed to proxy:
To: +123456789 <sip:123456789 at 127.0.0.1>;tag=SD1sf9001--45026-530b969-77c7543f-530b969.
which is rewritten into:
To: +123456789 <sip:123456789 at 127*0-)'.:/)&7'...0;user=phone>;tag=SD1sf9001--45026-530b969-77c7543f-530b969.
and sent out..


Thanks for your help,
/Tobias

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20161028/aa931e14/attachment.html>


More information about the sr-users mailing list