Skip to content
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

core: msg_translator.c put new line after «parsing failed» error message #3348

Closed

Conversation

dilyanpalauzov
Copy link
Contributor

I use Kamailio with log_stderror=yes. When Kamailio receives confirmation from the Websocket reverse proxy, it logs on stderr

23(24) ERROR: <core> [core/parser/parse_fline.c:271]: parse_first_line(): parse_first_line: bad message (offset: 22)
23(24) ERROR: <core> [core/parser/msg_parser.c:749]: parse_msg(): ERROR: parse_msg: message=<HTTP/1.1 101 Switching Protocols
Sia: SIP/2.0/TCP 111.11.111.11:47418
Sec-WebSocket-Protocol: sip
Upgrade: websocket
Connection: upgrade
Sec-WebSocket-Accept: Ak3/c/aw3iyHnFkDDHabw1iXcqY=
Content-Length: 0

>
23(24) ERROR: <core> [core/msg_translator.c:3256]: build_sip_msg_from_buf(): parsing failed

Without the included \n here the subsequent messages are logged on the same line as parsing failed.

For the record, I use this NGINX configuration:

location /sip {
    proxy_http_version 1.1;
    proxy_set_header "Accept-Encoding" "";  # delete header before sending it to Kamailio
    proxy_set_header "Pragma" "";
    proxy_set_header "Cache-control" "";
    proxy_set_header "User-Agent" "";
    proxy_set_header Host $host;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $http_connection;
    proxy_pass http://123.12.123.12:5060;
    proxy_read_timeout 86400;
}

and it leads to that unparsable message above.

@miconda
Copy link
Member

miconda commented Feb 3, 2023

Thanks, merged manually because there were also several typos fixed in the patch.

@miconda miconda closed this Feb 3, 2023
@dilyanpalauzov dilyanpalauzov deleted the core_msg_translator_nl branch February 3, 2023 09:07
miconda added a commit that referenced this pull request Feb 24, 2023
miconda added a commit that referenced this pull request Feb 24, 2023
- GH #3348

(cherry picked from commit 51fa3da)
(cherry picked from commit b2e8727)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants