Skip to content

Header check requires space after colon e.g. "\nContent-Length: " #101

@justin-lavelle

Description

@justin-lavelle

Ran into this issue when trying to do an OPTIONS ping via TCP, the message is received in full, but sipsak is looking for the "\nl: " requiring a space after the colon and Freeswitch generates the reply without a space after the colon for all headers.

message received
checking message for completeness...
missing Content-Length in message
missing CL header; waiting for more bytes...

received from: TCP:255.255.255.101:5080
** timeout after 32000 ms**

Message generated by Freeswitch is using the compact form and omitting a space after the colon for headers.

2025/11/01 02:48:21.233351 255.255.255.101:5080 -> 255.255.255.150:59835
SIP/2.0 200 OK
v:SIP/2.0/TCP 255.255.255.150:59835;branch=z9hG4bK.5dae5b51;rport=59835
f:sip:sipsak@255.255.255.150:59835;tag=1ab1c96
t:sip:255.255.255.101:5080;tag=9g8tcj4Bpr6Se
i:27991190@255.255.255.150
CSeq:1 OPTIONS
m:<sip:255.255.255.101:5080>
User-Agent:fs
Accept:application/sdp
Allow:INVITE,ACK,BYE,CANCEL,OPTIONS,MESSAGE,INFO,UPDATE,REGISTER,REFER,NOTIFY,PUBLISH,SUBSCRIBE
k:timer,path,replaces
u:talk,hold,conference,presence,as-feature-event,dialog,line-seize,call-info,sla,include-session-description,presence.winfo,message-summary,refer
l:0

When using UDP the check is not performed and the reply is accepted.

I checked the RFCs and while not the preferred form of the headers, they are valid.
https://datatracker.ietf.org/doc/html/rfc3261#section-7.3.1

Seems like when generating messages sipsak would be good to generate them in the preferred form with the space after the colon, but when accepting messages should handle all valid forms such as this message.

Created PR that addresses this just for the Content-Length header
#102

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions