amitpahune / jain-sip

Automatically exported from code.google.com/p/jain-sip
0 stars 0 forks source link

"invalid" in Contact header #118

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Make a call between two clients using the jain-sip js framework (I used the 
Mobicents WebRTC phone application)
2. Observe the SIP responses 180 Ringing and 200 OK

There is meaningless address in the Contact header containing random characters 
and "invalid" string. I traced this in the source code and it seems that the 
problem is at line 50 in SipStackImpl.js file. This line contains the following 
statement:
this.setHostAddress(Utils.prototype.randomString(12)+".invalid");  

What is the expected output? What do you see instead?

Normal host address should be present in the Contact header. Please note that  
there is correct value in Contact header in INVITE and REGISTER requests.

What version of the product are you using? On what operating system?
JAIN SIP javascript framework, version 1.0

Please provide any additional information below.
Example response:
SIP/2.0 180 Ringing
Call-ID: 1372233982268
CSeq: 1 INVITE
From: "alice" <sip:user1@127.0.0.1>;tag=1372233985297
To: <sip:user@127.0.0.1>;tag=1372233985410
Via: SIP/2.0/WS 
127.0.0.1:5082;branch=z9hG4bKec4903d2-6a64-4ea0-a58d-3ba28a541b08_655e17f9_83775
484270875;rport
Via: SIP/2.0/WS 
127.0.0.1:50335;branch=z9hG4bK-373736-5e00ad9ec8051cf5d49f84e87491302b;rport;rec
eived=127.0.0.1
Max-Forwards: 69
Allow: INVITE,ACK,CANCEL,BYE
Record-Route: 
<sip:127.0.0.1:5082;transport=ws;appname=655e17f9;proxy=true;app_id=ec4903d2-6a6
4-4ea0-a58d-3ba28a541b08;lr>
Contact: <sip:user@dQUoi7a5trJq.invalid;transport=ws>
Content-Length: 0

Original issue reported on code.google.com by zukal.ma...@gmail.com on 26 Jun 2013 at 8:39

GoogleCodeExporter commented 8 years ago

Original comment by jean.deruelle on 4 Jul 2013 at 8:14

GoogleCodeExporter commented 8 years ago
Hello,
For me, it's inline with my understanding of the SIP/WS IETF draft 
http://datatracker.ietf.org/doc/draft-ietf-sipcore-sip-websocket/?include_text=1
 :
Since the JavaScript stack in a browser has no way
to determine the local address from which the WebSocket connection
was made, this implementation uses a random ".invalid" domain name
for the Via header sent-by parameter and for the hostport of the URI
in the Contact header (see Appendix B.1).

Laurent

Original comment by laurent.strullu.orange@gmail.com on 4 Jul 2013 at 9:30

GoogleCodeExporter commented 8 years ago

Original comment by laurent.strullu.orange@gmail.com on 4 Jul 2013 at 12:25