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@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@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@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@127.0.0.1;tag=SD1sf9001--45026-530b969-77c7543f-530b969. which is rewritten into: To: +123456789 sip:123456789@127*0-)'.:/)&7'...0;user=phone;tag=SD1sf9001--45026-530b969-77c7543f-530b969. and sent out..
Thanks for your help, /Tobias
Hello,
the to header doesn't have the ending '>' after its uri:
<<+123456789 sip:123456789@127.0.0.1;tag=as4aa27bd0>
The first << and last >> are from the log messages, but before ;tag=, it has to be another >, to close the one started before <sip:
Cheers, Daniel
On 28/10/16 21:14, Tobias wrote:
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@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@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@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@127.0.0.1;tag=SD1sf9001--45026-530b969-77c7543f-530b969. which is rewritten into: To: +123456789 sip:123456789@127*0-)'.:/)&7'...0;user=phone;tag=SD1sf9001--45026-530b969-77c7543f-530b969. and sent out..
Thanks for your help, /Tobias
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Hi Daniel,
Thanks for your quick response. Makes totally sense, I'll need to debug why I'm getting that malformed header.
Do you think my second question is related? I cannot see the same malformed data in the example where the to-header is rewritten, it just looks like Kamailio adds ";user=phone" but the ip address is all obfuscated:
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@127.0.0.1;tag=SD1sf9001--45026-530b969-77c7543f-530b969. which is rewritten into: To: +123456789 sip:123456789@127*0-)'.:/)&7'...0;user=phone;tag=SD1sf9001--45026-530b969-77c7543f-530b969. and sent out..
Thanks, /Tobias
________________________________ From: sr-users sr-users-bounces@lists.sip-router.org on behalf of Daniel-Constantin Mierla miconda@gmail.com Sent: Monday, October 31, 2016 9:07 AM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Malformed To header, or?
Hello,
the to header doesn't have the ending '>' after its uri:
<<+123456789 sip:123456789@127.0.0.1;tag=as4aa27bd0sip:123456789@127.0.0.1;tag=as4aa27bd0>
The first << and last >> are from the log messages, but before ;tag=, it has to be another >, to close the one started before <sip:
Cheers, Daniel
On 28/10/16 21:14, Tobias wrote: 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@127.0.0.1;tag=as4aa27bd0sip:123456789@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@127.0.0.1;tag=as4aa27bd0sip:123456789@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@127.0.0.1sip:123456789@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@127.0.0.1;tag=SD1sf9001--45026-530b969-77c7543f-530b969. which is rewritten into: To: +123456789 sip:123456789@127*0-)'.:/)&7'...0;user=phone;tag=SD1sf9001--45026-530b969-77c7543f-530b969. and sent out..
Thanks for your help, /Tobias
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.orgmailto:sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Daniel-Constantin Mierla http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - http://www.asipto.com
Hello,
kamailio is not adding user=phone to To header by itself, it has to be something in the kamailio.cfg. What do you use to change the To? Or for changing From in initial INVITE?
Cheers, Daniel
On 01/11/16 20:35, Tobias wrote:
Hi Daniel,
Thanks for your quick response. Makes totally sense, I'll need to debug why I'm getting that malformed header.
Do you think my second question is related? I cannot see the same malformed data in the example where the to-header is rewritten, it just looks like Kamailio adds ";user=phone" but the ip address is all obfuscated:
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@127.0.0.1;tag=SD1sf9001--45026-530b969-77c7543f-530b969. which is rewritten into: To: +123456789 sip:123456789@127*0-)'.:/)&7'...0;user=phone;tag=SD1sf9001--45026-530b969-77c7543f-530b969. and sent out..
Thanks, /Tobias
*From:* sr-users sr-users-bounces@lists.sip-router.org on behalf of Daniel-Constantin Mierla miconda@gmail.com *Sent:* Monday, October 31, 2016 9:07 AM *To:* Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Malformed To header, or?
Hello,
the to header doesn't have the ending '>' after its uri:
<<+123456789 sip:123456789@127.0.0.1;tag=as4aa27bd0>
The first << and last >> are from the log messages, but before ;tag=, it has to be another >, to close the one started before <sip:
Cheers, Daniel
On 28/10/16 21:14, Tobias wrote:
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@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@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@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@127.0.0.1;tag=SD1sf9001--45026-530b969-77c7543f-530b969. which is rewritten into: To: +123456789 sip:123456789@127*0-)'.:/)&7'...0;user=phone;tag=SD1sf9001--45026-530b969-77c7543f-530b969. and sent out..
Thanks for your help, /Tobias
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Daniel-Constantin Mierla http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - http://www.asipto.com
Hello!
Correct, we're using uac_replace_from() when passing along the initial INVITE. That INVITE looks good so it's not until this reINVITE that the header is scrambled.
Kind regards,
/Tobias
________________________________ From: Daniel-Constantin Mierla miconda@gmail.com Sent: Wednesday, November 2, 2016 10:12 AM To: Tobias; Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Malformed To header, or?
Hello,
kamailio is not adding user=phone to To header by itself, it has to be something in the kamailio.cfg. What do you use to change the To? Or for changing From in initial INVITE?
Cheers, Daniel
On 01/11/16 20:35, Tobias wrote:
Hi Daniel,
Thanks for your quick response. Makes totally sense, I'll need to debug why I'm getting that malformed header.
Do you think my second question is related? I cannot see the same malformed data in the example where the to-header is rewritten, it just looks like Kamailio adds ";user=phone" but the ip address is all obfuscated:
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@127.0.0.1sip:123456789@127.0.0.1;tag=SD1sf9001--45026-530b969-77c7543f-530b969. which is rewritten into: To: +123456789 sip:123456789@127*0-)'.:/)&7'...0;user=phonesip:123456789@127*0-)'.:/)&7'...0;user=phone;tag=SD1sf9001--45026-530b969-77c7543f-530b969. and sent out..
Thanks, /Tobias
________________________________ From: sr-users sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org on behalf of Daniel-Constantin Mierla miconda@gmail.commailto:miconda@gmail.com Sent: Monday, October 31, 2016 9:07 AM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Malformed To header, or?
Hello,
the to header doesn't have the ending '>' after its uri:
<<+123456789 sip:123456789@127.0.0.1;tag=as4aa27bd0sip:123456789@127.0.0.1;tag=as4aa27bd0>
The first << and last >> are from the log messages, but before ;tag=, it has to be another >, to close the one started before <sip:
Cheers, Daniel
On 28/10/16 21:14, Tobias wrote: 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@127.0.0.1;tag=as4aa27bd0sip:123456789@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@127.0.0.1;tag=as4aa27bd0sip:123456789@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@127.0.0.1sip:123456789@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@127.0.0.1;tag=SD1sf9001--45026-530b969-77c7543f-530b969. which is rewritten into: To: +123456789 sip:123456789@127*0-)'.:/)&7'...0;user=phone;tag=SD1sf9001--45026-530b969-77c7543f-530b969. and sent out..
Thanks for your help, /Tobias
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.orgmailto:sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Daniel-Constantin Mierla http://twitter.com/#!/micondahttp://twitter.com/#%21/miconda - http://www.linkedin.com/in/miconda Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - http://www.asipto.com
-- Daniel-Constantin Mierla http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - http://www.asipto.com
Hello,
are the From/To headers changed by the endpoint? Or the are the same as in the initial INVITE/200ok?
Cheers, Daniel
On 02/11/16 14:57, Tobias wrote:
Hello!
Correct, we're using uac_replace_from() when passing along the initial INVITE. That INVITE looks good so it's not until this reINVITE that the header is scrambled.
Kind regards,
/Tobias
*From:* Daniel-Constantin Mierla miconda@gmail.com *Sent:* Wednesday, November 2, 2016 10:12 AM *To:* Tobias; Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Malformed To header, or?
Hello,
kamailio is not adding user=phone to To header by itself, it has to be something in the kamailio.cfg. What do you use to change the To? Or for changing From in initial INVITE?
Cheers, Daniel
On 01/11/16 20:35, Tobias wrote:
Hi Daniel,
Thanks for your quick response. Makes totally sense, I'll need to debug why I'm getting that malformed header.
Do you think my second question is related? I cannot see the same malformed data in the example where the to-header is rewritten, it just looks like Kamailio adds ";user=phone" but the ip address is all obfuscated:
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@127.0.0.1;tag=SD1sf9001--45026-530b969-77c7543f-530b969. which is rewritten into: To: +123456789 sip:123456789@127*0-)'.:/)&7'...0;user=phone;tag=SD1sf9001--45026-530b969-77c7543f-530b969. and sent out..
Thanks, /Tobias
*From:* sr-users sr-users-bounces@lists.sip-router.org on behalf of Daniel-Constantin Mierla miconda@gmail.com *Sent:* Monday, October 31, 2016 9:07 AM *To:* Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Malformed To header, or?
Hello,
the to header doesn't have the ending '>' after its uri:
<<+123456789 sip:123456789@127.0.0.1;tag=as4aa27bd0>
The first << and last >> are from the log messages, but before ;tag=, it has to be another >, to close the one started before <sip:
Cheers, Daniel
On 28/10/16 21:14, Tobias wrote:
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@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@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@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@127.0.0.1;tag=SD1sf9001--45026-530b969-77c7543f-530b969. which is rewritten into: To: +123456789 sip:123456789@127*0-)'.:/)&7'...0;user=phone;tag=SD1sf9001--45026-530b969-77c7543f-530b969. and sent out..
Thanks for your help, /Tobias
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Daniel-Constantin Mierla http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - http://www.asipto.com
-- Daniel-Constantin Mierla http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - http://www.asipto.com
Hi,
The To-header in the reINVITE is changed by the endpoint as far as I can see (if I understand your question correctly), i.e. something like this:
1) INVITE from endpoint to Kamailio
2) Kamailio performs uac_replace_from()
3) INVITE from Kamailio to endpoint (From-header modified)
4) dialogue goes on..
5) reINVITE from endpoint to Kamailio (To-header modified using data from modified From-header in step #3)
6) reINVITE from Kamailio to endpoint, ip-address becomes scrambled
I can send you the whole SIP conversation if it helps.
Kind regards,
/Tobias
________________________________ From: Daniel-Constantin Mierla miconda@gmail.com Sent: Thursday, November 3, 2016 9:57 AM To: Tobias; Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Malformed To header, or?
Hello,
are the From/To headers changed by the endpoint? Or the are the same as in the initial INVITE/200ok?
Cheers, Daniel
On 02/11/16 14:57, Tobias wrote:
Hello!
Correct, we're using uac_replace_from() when passing along the initial INVITE. That INVITE looks good so it's not until this reINVITE that the header is scrambled.
Kind regards,
/Tobias
________________________________ From: Daniel-Constantin Mierla miconda@gmail.commailto:miconda@gmail.com Sent: Wednesday, November 2, 2016 10:12 AM To: Tobias; Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Malformed To header, or?
Hello,
kamailio is not adding user=phone to To header by itself, it has to be something in the kamailio.cfg. What do you use to change the To? Or for changing From in initial INVITE?
Cheers, Daniel
On 01/11/16 20:35, Tobias wrote:
Hi Daniel,
Thanks for your quick response. Makes totally sense, I'll need to debug why I'm getting that malformed header.
Do you think my second question is related? I cannot see the same malformed data in the example where the to-header is rewritten, it just looks like Kamailio adds ";user=phone" but the ip address is all obfuscated:
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@127.0.0.1sip:123456789@127.0.0.1;tag=SD1sf9001--45026-530b969-77c7543f-530b969. which is rewritten into: To: +123456789 sip:123456789@127*0-)'.:/)&7'...0;user=phonesip:123456789@127*0-%29%27.:/%29&7%27...0;user=phone;tag=SD1sf9001--45026-530b969-77c7543f-530b969. and sent out..
Thanks, /Tobias
________________________________ From: sr-users sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org on behalf of Daniel-Constantin Mierla miconda@gmail.commailto:miconda@gmail.com Sent: Monday, October 31, 2016 9:07 AM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Malformed To header, or?
Hello,
the to header doesn't have the ending '>' after its uri:
<<+123456789 sip:123456789@127.0.0.1;tag=as4aa27bd0sip:123456789@127.0.0.1;tag=as4aa27bd0>
The first << and last >> are from the log messages, but before ;tag=, it has to be another >, to close the one started before <sip:
Cheers, Daniel
On 28/10/16 21:14, Tobias wrote: 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@127.0.0.1;tag=as4aa27bd0sip:123456789@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@127.0.0.1;tag=as4aa27bd0sip:123456789@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@127.0.0.1sip:123456789@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@127.0.0.1;tag=SD1sf9001--45026-530b969-77c7543f-530b969. which is rewritten into: To: +123456789 sip:123456789@127*0-)'.:/)&7'...0;user=phone;tag=SD1sf9001--45026-530b969-77c7543f-530b969. and sent out..
Thanks for your help, /Tobias
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.orgmailto:sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Daniel-Constantin Mierla http://twitter.com/#!/micondahttp://twitter.com/#%21/miconda - http://www.linkedin.com/in/miconda Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - http://www.asipto.com
-- Daniel-Constantin Mierla http://twitter.com/#!/micondahttp://twitter.com/#%21/miconda - http://www.linkedin.com/in/miconda Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - http://www.asipto.com
-- Daniel-Constantin Mierla http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - http://www.asipto.com
Hello,
the question is if the value in the step 5 is the same as in step 3, or the endpoint does further modifications (changing what it received in step 3)?
Cheers, Daniel
On 03/11/16 10:20, Tobias wrote:
Hi,
The To-header in the reINVITE is changed by the endpoint as far as I can see (if I understand your question correctly), i.e. something like this:
INVITE from endpoint to Kamailio
Kamailio performs uac_replace_from()
INVITE from Kamailio to endpoint (From-header modified)
dialogue goes on..
reINVITE from endpoint to Kamailio (To-header modified using data
from modified From-header in step #3)
- reINVITE from Kamailio to endpoint, ip-address becomes scrambled
I can send you the whole SIP conversation if it helps.
Kind regards,
/Tobias
*From:* Daniel-Constantin Mierla miconda@gmail.com *Sent:* Thursday, November 3, 2016 9:57 AM *To:* Tobias; Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Malformed To header, or?
Hello,
are the From/To headers changed by the endpoint? Or the are the same as in the initial INVITE/200ok?
Cheers, Daniel
On 02/11/16 14:57, Tobias wrote:
Hello!
Correct, we're using uac_replace_from() when passing along the initial INVITE. That INVITE looks good so it's not until this reINVITE that the header is scrambled.
Kind regards,
/Tobias
*From:* Daniel-Constantin Mierla miconda@gmail.com *Sent:* Wednesday, November 2, 2016 10:12 AM *To:* Tobias; Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Malformed To header, or?
Hello,
kamailio is not adding user=phone to To header by itself, it has to be something in the kamailio.cfg. What do you use to change the To? Or for changing From in initial INVITE?
Cheers, Daniel
On 01/11/16 20:35, Tobias wrote:
Hi Daniel,
Thanks for your quick response. Makes totally sense, I'll need to debug why I'm getting that malformed header.
Do you think my second question is related? I cannot see the same malformed data in the example where the to-header is rewritten, it just looks like Kamailio adds ";user=phone" but the ip address is all obfuscated:
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@127.0.0.1;tag=SD1sf9001--45026-530b969-77c7543f-530b969. which is rewritten into: To: +123456789 sip:123456789@127*0-)'.:/)&7'...0;user=phone;tag=SD1sf9001--45026-530b969-77c7543f-530b969. and sent out..
Thanks, /Tobias
*From:* sr-users sr-users-bounces@lists.sip-router.org on behalf of Daniel-Constantin Mierla miconda@gmail.com *Sent:* Monday, October 31, 2016 9:07 AM *To:* Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Malformed To header, or?
Hello,
the to header doesn't have the ending '>' after its uri:
<<+123456789 sip:123456789@127.0.0.1;tag=as4aa27bd0>
The first << and last >> are from the log messages, but before ;tag=, it has to be another >, to close the one started before <sip:
Cheers, Daniel
On 28/10/16 21:14, Tobias wrote:
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@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@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@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@127.0.0.1;tag=SD1sf9001--45026-530b969-77c7543f-530b969. which is rewritten into: To: +123456789 sip:123456789@127*0-)'.:/)&7'...0;user=phone;tag=SD1sf9001--45026-530b969-77c7543f-530b969. and sent out..
Thanks for your help, /Tobias
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Daniel-Constantin Mierla http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - http://www.asipto.com
-- Daniel-Constantin Mierla http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - http://www.asipto.com
-- Daniel-Constantin Mierla http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - http://www.asipto.com
Hi,
This is what it looks like.
Initial INVITE after passing Kamailio: From: +num_1 sip:+num_1@localip;tag=SD1sf9001--45026-530b969-77c7543f-530b969. To: sip:+num_2@localip:5060;user=phone.
Incoming reINVITE: From: sip:+num_2@remoteip:5060;user=phone;tag=SD1sf9099-32997070347920161028161732. To: +num_1 sip:num_1@localip;tag=SD1sf9001--45026-530b969-77c7543f-530b969.
Kind regards, /Tobias
________________________________ From: Daniel-Constantin Mierla miconda@gmail.com Sent: Thursday, November 3, 2016 1:59 PM To: Tobias; Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Malformed To header, or?
Hello,
the question is if the value in the step 5 is the same as in step 3, or the endpoint does further modifications (changing what it received in step 3)?
Cheers, Daniel
On 03/11/16 10:20, Tobias wrote:
Hi,
The To-header in the reINVITE is changed by the endpoint as far as I can see (if I understand your question correctly), i.e. something like this:
1) INVITE from endpoint to Kamailio
2) Kamailio performs uac_replace_from()
3) INVITE from Kamailio to endpoint (From-header modified)
4) dialogue goes on..
5) reINVITE from endpoint to Kamailio (To-header modified using data from modified From-header in step #3)
6) reINVITE from Kamailio to endpoint, ip-address becomes scrambled
I can send you the whole SIP conversation if it helps.
Kind regards,
/Tobias
________________________________ From: Daniel-Constantin Mierla miconda@gmail.commailto:miconda@gmail.com Sent: Thursday, November 3, 2016 9:57 AM To: Tobias; Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Malformed To header, or?
Hello,
are the From/To headers changed by the endpoint? Or the are the same as in the initial INVITE/200ok?
Cheers, Daniel
On 02/11/16 14:57, Tobias wrote:
Hello!
Correct, we're using uac_replace_from() when passing along the initial INVITE. That INVITE looks good so it's not until this reINVITE that the header is scrambled.
Kind regards,
/Tobias
________________________________ From: Daniel-Constantin Mierla miconda@gmail.commailto:miconda@gmail.com Sent: Wednesday, November 2, 2016 10:12 AM To: Tobias; Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Malformed To header, or?
Hello,
kamailio is not adding user=phone to To header by itself, it has to be something in the kamailio.cfg. What do you use to change the To? Or for changing From in initial INVITE?
Cheers, Daniel
On 01/11/16 20:35, Tobias wrote:
Hi Daniel,
Thanks for your quick response. Makes totally sense, I'll need to debug why I'm getting that malformed header.
Do you think my second question is related? I cannot see the same malformed data in the example where the to-header is rewritten, it just looks like Kamailio adds ";user=phone" but the ip address is all obfuscated:
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@127.0.0.1sip:123456789@127.0.0.1;tag=SD1sf9001--45026-530b969-77c7543f-530b969. which is rewritten into: To: +123456789 sip:123456789@127*0-)'.:/)&7'...0;user=phonesip:123456789@127*0-%29%27.:/%29&7%27...0;user=phone;tag=SD1sf9001--45026-530b969-77c7543f-530b969. and sent out..
Thanks, /Tobias
________________________________ From: sr-users sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org on behalf of Daniel-Constantin Mierla miconda@gmail.commailto:miconda@gmail.com Sent: Monday, October 31, 2016 9:07 AM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Malformed To header, or?
Hello,
the to header doesn't have the ending '>' after its uri:
<<+123456789 sip:123456789@127.0.0.1;tag=as4aa27bd0sip:123456789@127.0.0.1;tag=as4aa27bd0>
The first << and last >> are from the log messages, but before ;tag=, it has to be another >, to close the one started before <sip:
Cheers, Daniel
On 28/10/16 21:14, Tobias wrote: 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@127.0.0.1;tag=as4aa27bd0sip:123456789@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@127.0.0.1;tag=as4aa27bd0sip:123456789@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@127.0.0.1sip:123456789@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@127.0.0.1;tag=SD1sf9001--45026-530b969-77c7543f-530b969. which is rewritten into: To: +123456789 sip:123456789@127*0-)'.:/)&7'...0;user=phone;tag=SD1sf9001--45026-530b969-77c7543f-530b969. and sent out..
Thanks for your help, /Tobias
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.orgmailto:sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Daniel-Constantin Mierla http://twitter.com/#!/micondahttp://twitter.com/#%21/miconda - http://www.linkedin.com/in/miconda Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - http://www.asipto.com
-- Daniel-Constantin Mierla http://twitter.com/#!/micondahttp://twitter.com/#%21/miconda - http://www.linkedin.com/in/miconda Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - http://www.asipto.com
-- Daniel-Constantin Mierla http://twitter.com/#!/micondahttp://twitter.com/#%21/miconda - http://www.linkedin.com/in/miconda Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - http://www.asipto.com
-- Daniel-Constantin Mierla http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - http://www.asipto.com
Hi Tobias,
so, the INVITE going out from your Kamailio is: To: sip:+num_2@localip:5060;user=phone.
but the From in the Re-INVITE is: From: sip:+num_2@remoteip:5060;user=phone;tag=SD1sf9099- 32997070347920161028161732.
?? Or is the To-Header rewritten as well on your Proxy?
The remote server should not change the From-Header in the Re-INVITE, but take the URI from the To-Header. Adding the encoded "From" Header to RR will only work, if the headers are correct according to RFC3261.
Thanks, Carsten
2016-11-03 14:08 GMT+01:00 Tobias the_fx@hotmail.com:
Hi,
This is what it looks like.
Initial INVITE after passing Kamailio: From: +num_1 sip:+num_1@localip;tag=SD1sf9001--45026-530b969- 77c7543f-530b969. To: sip:+num_2@localip:5060;user=phone.
Incoming reINVITE: From: sip:+num_2@remoteip:5060;user=phone;tag=SD1sf9099- 32997070347920161028161732. To: +num_1 sip:num_1@localip;tag=SD1sf9001--45026-530b969- 77c7543f-530b969.
Kind regards, /Tobias
*From:* Daniel-Constantin Mierla miconda@gmail.com *Sent:* Thursday, November 3, 2016 1:59 PM
*To:* Tobias; Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Malformed To header, or?
Hello,
the question is if the value in the step 5 is the same as in step 3, or the endpoint does further modifications (changing what it received in step 3)?
Cheers, Daniel
On 03/11/16 10:20, Tobias wrote:
Hi,
The To-header in the reINVITE is changed by the endpoint as far as I can see (if I understand your question correctly), i.e. something like this:
INVITE from endpoint to Kamailio
Kamailio performs uac_replace_from()
INVITE from Kamailio to endpoint (From-header modified)
dialogue goes on..
reINVITE from endpoint to Kamailio (To-header modified using data from
modified From-header in step #3)
- reINVITE from Kamailio to endpoint, ip-address becomes scrambled
I can send you the whole SIP conversation if it helps.
Kind regards,
/Tobias
*From:* Daniel-Constantin Mierla miconda@gmail.com miconda@gmail.com *Sent:* Thursday, November 3, 2016 9:57 AM *To:* Tobias; Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Malformed To header, or?
Hello,
are the From/To headers changed by the endpoint? Or the are the same as in the initial INVITE/200ok?
Cheers, Daniel
On 02/11/16 14:57, Tobias wrote:
Hello!
Correct, we're using uac_replace_from() when passing along the initial INVITE. That INVITE looks good so it's not until this reINVITE that the header is scrambled.
Kind regards,
/Tobias
*From:* Daniel-Constantin Mierla miconda@gmail.com miconda@gmail.com *Sent:* Wednesday, November 2, 2016 10:12 AM *To:* Tobias; Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Malformed To header, or?
Hello,
kamailio is not adding user=phone to To header by itself, it has to be something in the kamailio.cfg. What do you use to change the To? Or for changing From in initial INVITE?
Cheers, Daniel
On 01/11/16 20:35, Tobias wrote:
Hi Daniel,
Thanks for your quick response. Makes totally sense, I'll need to debug why I'm getting that malformed header.
Do you think my second question is related? I cannot see the same malformed data in the example where the to-header is rewritten, it just looks like Kamailio adds ";user=phone" but the ip address is all obfuscated: 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@127.0.0.1;tag=SD1sf9001--45026-530b969- 77c7543f-530b969. which is rewritten into: To: +123456789 sip:123456789@127*0-)'.:/)&7'...0;user=phone;tag= SD1sf9001--45026-530b969-77c7543f-530b969. and sent out..
Thanks, /Tobias
*From:* sr-users sr-users-bounces@lists.sip-router.org sr-users-bounces@lists.sip-router.org on behalf of Daniel-Constantin Mierla miconda@gmail.com miconda@gmail.com *Sent:* Monday, October 31, 2016 9:07 AM *To:* Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Malformed To header, or?
Hello,
the to header doesn't have the ending '>' after its uri:
<<+123456789 sip:123456789@127.0.0.1;tag=as4aa27bd0>
The first << and last >> are from the log messages, but before ;tag=, it has to be another >, to close the one started before <sip:
Cheers, Daniel
On 28/10/16 21:14, Tobias wrote:
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@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@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@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@127.0.0.1;tag=SD1sf9001--45026-530b969- 77c7543f-530b969. which is rewritten into: To: +123456789 sip:123456789@127*0-)'.:/)&7'...0;user=phone;tag= SD1sf9001--45026-530b969-77c7543f-530b969. and sent out..
Thanks for your help, /Tobias
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing listsr-users@lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Daniel-Constantin Mierlahttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - http://www.asipto.com
-- Daniel-Constantin Mierlahttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - http://www.asipto.com
-- Daniel-Constantin Mierlahttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - http://www.asipto.com
-- Daniel-Constantin Mierlahttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - http://www.asipto.com
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Hello,
is there a '+' missing after sip: in the To of the re-invite vs the From of the initial invite?
Cheers, Daniel
On 03/11/16 14:08, Tobias wrote:
Hi,
This is what it looks like.
Initial INVITE after passing Kamailio: From: +num_1 sip:+num_1@localip;tag=SD1sf9001--45026-530b969-77c7543f-530b969. To: sip:+num_2@localip:5060;user=phone.
Incoming reINVITE: From: sip:+num_2@remoteip:5060;user=phone;tag=SD1sf9099-32997070347920161028161732. To: +num_1 sip:num_1@localip;tag=SD1sf9001--45026-530b969-77c7543f-530b969.
Kind regards, /Tobias
*From:* Daniel-Constantin Mierla miconda@gmail.com *Sent:* Thursday, November 3, 2016 1:59 PM *To:* Tobias; Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Malformed To header, or?
Hello,
the question is if the value in the step 5 is the same as in step 3, or the endpoint does further modifications (changing what it received in step 3)?
Cheers, Daniel
On 03/11/16 10:20, Tobias wrote:
Hi,
The To-header in the reINVITE is changed by the endpoint as far as I can see (if I understand your question correctly), i.e. something like this:
INVITE from endpoint to Kamailio
Kamailio performs uac_replace_from()
INVITE from Kamailio to endpoint (From-header modified)
dialogue goes on..
reINVITE from endpoint to Kamailio (To-header modified using data
from modified From-header in step #3)
- reINVITE from Kamailio to endpoint, ip-address becomes scrambled
I can send you the whole SIP conversation if it helps.
Kind regards,
/Tobias
*From:* Daniel-Constantin Mierla miconda@gmail.com *Sent:* Thursday, November 3, 2016 9:57 AM *To:* Tobias; Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Malformed To header, or?
Hello,
are the From/To headers changed by the endpoint? Or the are the same as in the initial INVITE/200ok?
Cheers, Daniel
On 02/11/16 14:57, Tobias wrote:
Hello!
Correct, we're using uac_replace_from() when passing along the initial INVITE. That INVITE looks good so it's not until this reINVITE that the header is scrambled.
Kind regards,
/Tobias
*From:* Daniel-Constantin Mierla miconda@gmail.com *Sent:* Wednesday, November 2, 2016 10:12 AM *To:* Tobias; Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Malformed To header, or?
Hello,
kamailio is not adding user=phone to To header by itself, it has to be something in the kamailio.cfg. What do you use to change the To? Or for changing From in initial INVITE?
Cheers, Daniel
On 01/11/16 20:35, Tobias wrote:
Hi Daniel,
Thanks for your quick response. Makes totally sense, I'll need to debug why I'm getting that malformed header.
Do you think my second question is related? I cannot see the same malformed data in the example where the to-header is rewritten, it just looks like Kamailio adds ";user=phone" but the ip address is all obfuscated:
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@127.0.0.1;tag=SD1sf9001--45026-530b969-77c7543f-530b969. which is rewritten into: To: +123456789 sip:123456789@127*0-)'.:/)&7'...0;user=phone;tag=SD1sf9001--45026-530b969-77c7543f-530b969. and sent out..
Thanks, /Tobias
*From:* sr-users sr-users-bounces@lists.sip-router.org on behalf of Daniel-Constantin Mierla miconda@gmail.com *Sent:* Monday, October 31, 2016 9:07 AM *To:* Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Malformed To header, or?
Hello,
the to header doesn't have the ending '>' after its uri:
<<+123456789 sip:123456789@127.0.0.1;tag=as4aa27bd0>
The first << and last >> are from the log messages, but before ;tag=, it has to be another >, to close the one started before <sip:
Cheers, Daniel
On 28/10/16 21:14, Tobias wrote:
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@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@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@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@127.0.0.1;tag=SD1sf9001--45026-530b969-77c7543f-530b969. which is rewritten into: To: +123456789 sip:123456789@127*0-)'.:/)&7'...0;user=phone;tag=SD1sf9001--45026-530b969-77c7543f-530b969. and sent out..
Thanks for your help, /Tobias
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Daniel-Constantin Mierla http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - http://www.asipto.com
-- Daniel-Constantin Mierla http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - http://www.asipto.com
-- Daniel-Constantin Mierla http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - http://www.asipto.com
-- Daniel-Constantin Mierla http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - http://www.asipto.com
Hi,
Yes, you're right, there is actually a '+<CC>' missing in the reINVITE. For some reason the number is suddenly on a local format. That will upset Kamailio?
Kind regards,
/Tobias
________________________________ From: Daniel-Constantin Mierla miconda@gmail.com Sent: Thursday, November 3, 2016 2:34 PM To: Tobias; Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Malformed To header, or?
Hello,
is there a '+' missing after sip: in the To of the re-invite vs the From of the initial invite?
Cheers, Daniel
On 03/11/16 14:08, Tobias wrote:
Hi,
This is what it looks like.
Initial INVITE after passing Kamailio: From: +num_1 sip:+num_1@localipsip:+num_1@localip;tag=SD1sf9001--45026-530b969-77c7543f-530b969. To: sip:+num_2@localip:5060;user=phonesip:+num_2@localip:5060;user=phone.
Incoming reINVITE: From: sip:+num_2@remoteip:5060;user=phonesip:+num_2@remoteip:5060;user=phone;tag=SD1sf9099-32997070347920161028161732. To: +num_1 sip:num_1@localipsip:num_1@localip;tag=SD1sf9001--45026-530b969-77c7543f-530b969.
Kind regards, /Tobias
________________________________ From: Daniel-Constantin Mierla miconda@gmail.commailto:miconda@gmail.com Sent: Thursday, November 3, 2016 1:59 PM To: Tobias; Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Malformed To header, or?
Hello,
the question is if the value in the step 5 is the same as in step 3, or the endpoint does further modifications (changing what it received in step 3)?
Cheers, Daniel
On 03/11/16 10:20, Tobias wrote:
Hi,
The To-header in the reINVITE is changed by the endpoint as far as I can see (if I understand your question correctly), i.e. something like this:
1) INVITE from endpoint to Kamailio
2) Kamailio performs uac_replace_from()
3) INVITE from Kamailio to endpoint (From-header modified)
4) dialogue goes on..
5) reINVITE from endpoint to Kamailio (To-header modified using data from modified From-header in step #3)
6) reINVITE from Kamailio to endpoint, ip-address becomes scrambled
I can send you the whole SIP conversation if it helps.
Kind regards,
/Tobias
________________________________ From: Daniel-Constantin Mierla miconda@gmail.commailto:miconda@gmail.com Sent: Thursday, November 3, 2016 9:57 AM To: Tobias; Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Malformed To header, or?
Hello,
are the From/To headers changed by the endpoint? Or the are the same as in the initial INVITE/200ok?
Cheers, Daniel
On 02/11/16 14:57, Tobias wrote:
Hello!
Correct, we're using uac_replace_from() when passing along the initial INVITE. That INVITE looks good so it's not until this reINVITE that the header is scrambled.
Kind regards,
/Tobias
________________________________ From: Daniel-Constantin Mierla miconda@gmail.commailto:miconda@gmail.com Sent: Wednesday, November 2, 2016 10:12 AM To: Tobias; Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Malformed To header, or?
Hello,
kamailio is not adding user=phone to To header by itself, it has to be something in the kamailio.cfg. What do you use to change the To? Or for changing From in initial INVITE?
Cheers, Daniel
On 01/11/16 20:35, Tobias wrote:
Hi Daniel,
Thanks for your quick response. Makes totally sense, I'll need to debug why I'm getting that malformed header.
Do you think my second question is related? I cannot see the same malformed data in the example where the to-header is rewritten, it just looks like Kamailio adds ";user=phone" but the ip address is all obfuscated:
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@127.0.0.1sip:123456789@127.0.0.1;tag=SD1sf9001--45026-530b969-77c7543f-530b969. which is rewritten into: To: +123456789 sip:123456789@127*0-)'.:/)&7'...0;user=phonesip:123456789@127*0-%29%27.:/%29&7%27...0;user=phone;tag=SD1sf9001--45026-530b969-77c7543f-530b969. and sent out..
Thanks, /Tobias
________________________________ From: sr-users sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org on behalf of Daniel-Constantin Mierla miconda@gmail.commailto:miconda@gmail.com Sent: Monday, October 31, 2016 9:07 AM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Malformed To header, or?
Hello,
the to header doesn't have the ending '>' after its uri:
<<+123456789 sip:123456789@127.0.0.1;tag=as4aa27bd0sip:123456789@127.0.0.1;tag=as4aa27bd0>
The first << and last >> are from the log messages, but before ;tag=, it has to be another >, to close the one started before <sip:
Cheers, Daniel
On 28/10/16 21:14, Tobias wrote: 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@127.0.0.1;tag=as4aa27bd0sip:123456789@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@127.0.0.1;tag=as4aa27bd0sip:123456789@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@127.0.0.1sip:123456789@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@127.0.0.1;tag=SD1sf9001--45026-530b969-77c7543f-530b969. which is rewritten into: To: +123456789 sip:123456789@127*0-)'.:/)&7'...0;user=phone;tag=SD1sf9001--45026-530b969-77c7543f-530b969. and sent out..
Thanks for your help, /Tobias
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.orgmailto:sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Daniel-Constantin Mierla http://twitter.com/#!/micondahttp://twitter.com/#%21/miconda - http://www.linkedin.com/in/miconda Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - http://www.asipto.com
-- Daniel-Constantin Mierla http://twitter.com/#!/micondahttp://twitter.com/#%21/miconda - http://www.linkedin.com/in/miconda Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - http://www.asipto.com
-- Daniel-Constantin Mierla http://twitter.com/#!/micondahttp://twitter.com/#%21/miconda - http://www.linkedin.com/in/miconda Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - http://www.asipto.com
-- Daniel-Constantin Mierla http://twitter.com/#!/micondahttp://twitter.com/#%21/miconda - http://www.linkedin.com/in/miconda Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - http://www.asipto.com
-- Daniel-Constantin Mierla http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - http://www.asipto.com
Hello,
the default mechanism is relying on endpoints not changing the values. If you use latest 4.4 branch, there is a safety check to prevent breaking the sip message in such cases.
Anyhow, if the endpints change the From/To, then likely you don't need to restore them, because they match the dialogs by rfc3261 tag parameters. So you can switch to restore mode manual.
If you still need to do restore, then you can't rely on endpoints, and you have to switch to use dialog module for storing the initial values -- see more into the readme of the uac module.
Cheers, Daniel
On 03/11/16 16:31, Tobias wrote:
Hi,
Yes, you're right, there is actually a '+<CC>' missing in the reINVITE. For some reason the number is suddenly on a local format. That will upset Kamailio?
Kind regards,
/Tobias
*From:* Daniel-Constantin Mierla miconda@gmail.com *Sent:* Thursday, November 3, 2016 2:34 PM *To:* Tobias; Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Malformed To header, or?
Hello,
is there a '+' missing after sip: in the To of the re-invite vs the From of the initial invite?
Cheers, Daniel
Thank you!
/Tobias
________________________________ From: Daniel-Constantin Mierla miconda@gmail.com Sent: Friday, November 4, 2016 9:27 AM To: Tobias; Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Malformed To header, or?
Hello,
the default mechanism is relying on endpoints not changing the values. If you use latest 4.4 branch, there is a safety check to prevent breaking the sip message in such cases.
Anyhow, if the endpints change the From/To, then likely you don't need to restore them, because they match the dialogs by rfc3261 tag parameters. So you can switch to restore mode manual.
If you still need to do restore, then you can't rely on endpoints, and you have to switch to use dialog module for storing the initial values -- see more into the readme of the uac module.
Cheers, Daniel
On 03/11/16 16:31, Tobias wrote:
Hi,
Yes, you're right, there is actually a '+<CC>' missing in the reINVITE. For some reason the number is suddenly on a local format. That will upset Kamailio?
Kind regards,
/Tobias
________________________________ From: Daniel-Constantin Mierla miconda@gmail.commailto:miconda@gmail.com Sent: Thursday, November 3, 2016 2:34 PM To: Tobias; Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Malformed To header, or?
Hello,
is there a '+' missing after sip: in the To of the re-invite vs the From of the initial invite?
Cheers, Daniel
-- Daniel-Constantin Mierla http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - http://www.asipto.com