Comments (18)
You are right, but the case is that there can be many head field rows with the same name in a comma-separated value form.
http://tools.ietf.org/html/rfc3261#section-7.3.1
Regards.
from jssip.
I mean, each header must have a single URI, otherwise the parser will fail, but there can be many header fields in a comma-separated form. Yes?
from jssip.
@iwanbk In the Contact of an INVITE or a 200 to an INVITE it's true that there MUST be just one single SIP or SIPS URI, but that is not true in a REGISTER request/response or in a 3XX response (redirection).
from jssip.
Hmm..
So, it maybe become a bug report.
I got contact header like this when registering.
Contact: <sip:[email protected];transport=ws>;expires=580;received="sip:36.72.73.223:22667;transport=WS";+sip.instance="<urn:uuid:b5f2a3fb-3874-4f84-ae4a-98a87f156707>";reg-id=1, <sip:[email protected];transport=ws>;expires=600;received="sip:36.72.73.223:22668;transport=WS";+sip.instance="<urn:uuid:37d17414-d63d-4489-89f7-cebe4bf1920a>";reg-id=1
And add console.log in line 106 and 108 of Parser.js
console.log("length="+length);
for(idx=0; idx < length; idx++) {
console.log("idx="+idx+". contact header="+header[idx]);
Then, i got this message in JS console.
length=4
idx=0. contact header=<sip:[email protected];transport=ws>;expires=580;received="sip:36.72.73.223:22667;transport=WS";+sip.instance="<urn:uuid:b5f2a3fb-3874-4f84-ae4a-98a87f156707>";reg-id=1
idx=1. contact header=
idx=2. contact header= <sip:[email protected];transport=ws>;expires=600;received="sip:36.72.73.223:22668;transport=WS";+sip.instance="<urn:uuid:37d17414-d63d-4489-89f7-cebe4bf1920a>";reg-id=1
JsSIP | MESSAGE | Not so many "Contact" headers present
It happened when i registering same user from different computer. Maybe it is not the right thing to do. But the parser shouldn't failed in this case.
Sorry, can't give a patch.
from jssip.
@iwanbk The previous header split regexp returns an array with some blank values.
Did you realize that nothing is done for such empty values?
for(idx=0; idx < length; idx++) {
// @iwanbk log here
if (header[idx].length > 0) {
message.addHeader('contact', header[idx]);
parsed = message.parseHeader('contact', idx);
if (parsed === undefined) {
break;
}
}
}
break;
from jssip.
The question here is, what would return those cases?:
getHeader("contact", 0)
getHeader("contact", 1)
getHeader("contact", 2)
from jssip.
@jmillan
Yes, but then the registration failed.
Sorry, for not providing complete log
JsSIP | MESSAGE | Not so many "Contact" headers present
JsSIP | TRANSACTION | Timer F expired z9hG4bK9005848
JsSIP | EVENT EMITTER | Emitting event: registrationFailed
from jssip.
Please, provide a complete log
from jssip.
Not needed, Ok
Got it. The index is not net being saved right. There' s the bug.
I let this open for resolution. Thanx @iwanbk
from jssip.
@iwanbk , it is solved in 351ca06
Thank you for reporting.
from jssip.
I'm seeing problems with multiple Contact headers in a reply from a REGISTER - maybe related to this bug
I'm using tryit.jssip.net
If I register as a user that is not already registered, everything is fine.
If I try to register as a user that has multiple registrations, JsSIP doesn't parse the reply from the proxy.
from jssip.
Could you provide more detailed info and hopefully a real example? This bug was fixed 4 months ago and we have not seen it again.
from jssip.
hi @dpocock I just tried by using a single account from two tabs in Chrome and got no apparent errors. Do you see any specific error in the console?
from jssip.
Seems to be related to the use of the sips scheme:
var uri = JsSIP.NameAddrHeader.parse("\"daniel1\"<sips:[email protected];transport=wss;rtcweb-breaker=no>;expires=132;language=\"en,fr\";click2call=no;+g.oma.sip-im;+audio");
undefined
uri
undefined
var uri = JsSIP.NameAddrHeader.parse("\"daniel1\"<sip:[email protected];transport=wss;rtcweb-breaker=no>;expires=132;language=\"en,fr\";click2call=no;+g.oma.sip-im;+audio");
undefined
uri
NameAddrHeader {uri: URI, parameters: Object, setParam: function, getParam: function, hasParam: function…}
from jssip.
Hi,
Yes, it is related to the sips
scheme. JsSIP does only handle sip
scheme.
var myNameAddress = JsSIP.NameAddrHeader.parse("\"daniel1\"<sip:[email protected];transport=wss;rtcweb-breaker=no>;expires=132;language=\"en,fr\";click2call=no;+g.oma.sip-im;+audio");
undefined
myNameAddress ->
NameAddrHeader {uri: URI, parameters: Object, setParam: function, getParam: function, hasParam: function…}
from jssip.
The draft doesn't say a lot about sips, although it does appear to be valid in certain situations:
http://tools.ietf.org/html/draft-ietf-sipcore-sip-websocket-08#section-5.3
http://tools.ietf.org/html/draft-ietf-sipcore-sip-websocket-08#section-9.2
I've been doing all my testing with wss:// recently and all my other SIP UAs (e.g. Lumicall) use TLS by default too. I realise that sips URIs have their own issues, of course. In this case, this is just the default behavior of SIPml5 when registering against a wss:// server.
Do you think sips: is valid in the contact header?
from jssip.
SIPS usage is a pain due. It's much better and easier just to use SIP scheme everywhere and use a secure WSS connection. There is NO need at all to use SIPS if the transport is secure, NOT AT ALL.
Anyhow, JsSIP should allow SIPS scheme in URIs. I will open an issue for this.
from jssip.
This issue will be adressed in #78.
from jssip.
Related Issues (20)
- UnMute Call HOT 2
- How not to get microphone permission HOT 1
- For SIP server Account Register Working? HOT 2
- Abnormal session cancellation method under race condition
- Type definition errors in 3.10.0 HOT 1
- Error when getting video track status on Firefox
- Play audio or tone to remote user. HOT 2
- The new JsSIP.UA(configuration).call method does not return the status after execution
- import JsSIP from "jssip"; 打印JsSIP undefined HOT 2
- Error 'setLocalDescription' on Chrome HOT 1
- BYE: Request-URI does not point to us HOT 34
- Incorrect SDP a=sendrecv in firefox HOT 7
- I want to send and Receive message using JSSIP
- Sending a silent stream on latest Chrome HOT 1
- Error when trying to change the microphone during a call HOT 1
- Add custom header JsSIP - Asterisk HOT 1
- JsSIP processing re-INVITE HOT 1
- SDP is cut off between recieving 200 OK and the sdp event being emitted HOT 2
- On iOS, navigator.mediaDevices is `undefined` unless page is served in a secure context, but Errors are swallowed
- Why is there a 2-second delay when exiting? According to the source code, it seems to have no practical significance. HOT 3
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 jssip.