Comments (9)
I throw addHdr err: no semi found in: %s" whenever there is no ":" the header line. At this point in code I expect following:
headername: headervalue
As you can see here:
https://github.com/negbie/sipparser/blob/master/parser.go#L138
I print the whole header line and when I look at your error message above it seems the header line was not splitted correctly by "\r\n"
from heplify-server.
When I look at your first error I see:
CSeq: 3047 REGISTER\r\n
WWW-Authenticate: Digest realm="..*.",\r\n nonce="xWg1DnB3QqPdiSYw8jsH0g==",algorithm=MD5\r\n
So although its an error for you the parser acts correctly.
As I said the headers will be split by "\r\n"
So it will split the headers like following
CSeq: 3047 REGISTER
WWW-Authenticate: Digest realm="..*.",
nonce="xWg1DnB3QqPdiSYw8jsH0g==",algorithm=MD5
The problem here is that the useragent puts "\r\n" in the middle of the WWW-Authenticate header. Do you know if this is rfc conform?
Same for the second error
Authorization: Digest username="+@...",\r\n realm="...",nonce="aWo/bi1Gr0/Mdgr4aW295Q==",\r\n uri="sip:..*.",\r\n
"\r\n" in the middle of the Authorization header
from heplify-server.
I have check the RFC3261, from my understanding, it seems the \r\n are not placed correctly. They did not follow the standard. Will check with my vendor to see if they have an explanation.
from heplify-server.
In the best case they will fix it but it will take a while. What I can do is to check if we have at least the mandatory sip headers and go ahead with the processing. It seems I handle sip parsing errors to strict right now.
from heplify-server.
Got a feedback from the vendor, i miss out one of the syntax. So actually the syntax is correct (the \r\n is placed correctly - it is an optional part)
RFC3261:
WWW-Authenticate = "WWW-Authenticate" HCOLON challenge
challenge = ("Digest" LWS digest-cln *(COMMA digest-cln))
COMMA = SWS "," SWS ; comma
SWS = [ LWS ] ; sep whitespace
LWS = [ WSP CRLF ] 1WSP ; linear whitespace
Did some testing on my own for changes to parser.go at the sipparser. I commented out the error reporting for "no semi found in xxx" and manually set sp=0. I figure that since there is no semi, it is not a header anyways so it can be ignored.
func (s *SipMsg) addHdr(str string) {
if str == "" || str == " " {
return
}
sp := strings.IndexRune(str, ':')
if sp == -1 {
sp = 0
//s.Error = fmt.Errorf("addHdr err: no semi found in: %s", str)
//return
}
from heplify-server.
Try to comment only the error message
from heplify-server.
Owww thats a much better way of doing it. don't need to continue processing since it is not a header.
I tried it, it is working well.
from heplify-server.
Fixed with latest commit.
from heplify-server.
thank you 😄
from heplify-server.
Related Issues (20)
- panic when decoding HOT 1
- heplify-server.toml HOT 3
- Remove sip header via lua or other means? HOT 1
- Missing src_id, dst_id, ID labels HOT 4
- DB Error - could not map dynamic shared memory segment HOT 7
- Duplication with 'Dedup' set to 'true' HOT 4
- Prometheus metrics HOT 5
- [FEATURE REQ] multiple sockets listening at same hep udp port: setting "so_reuseport" in udp.go HOT 1
- Heplify-server não apresenta os dados HOT 31
- Prometheus was not accessed on installation and access is denied http and telnet on port 9090 HOT 1
- heplify-server resets TCP connection HOT 4
- Certificate with only 'Digital Signature' Key Usage not accepted
- Add subnet to PromTargetIP HOT 2
- ISUP multipart encoding issue HOT 4
- correlation id lost when pushing to loki HOT 1
- timestamp of hep packets discarded in loki
- Configure Multiply connections
- Multiple instances cause rotator to get stuck
- image for release v1.59.7 not yet available on ghcr HOT 2
- heplify-server's DB health monitoring HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from heplify-server.