showrav017 / jain-sip

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

Second Record-Route header removed when parsing #111

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Receive an incoming INVITE with two record route headers
2.Show conlose
3.

What is the expected output? What do you see instead?
Both record routes should be printed, only first is shown instead.

What version of the product are you using? On what operating system?

Lastest

Please provide any additional information below.

Example request:

INVITE sip:ray@Wy9fhM66Q15l.invalid;transport=ws SIP/2.0
Record-Route: <sip:X.X.X.X:8100;transport=ws;r2=on;lr=on>
Record-Route: <sip:X.X.X.X;r2=on;lr=on>
Call-ID: aebc5295e72559f70b8fc5fe162e67dc@X.X.X.X
CSeq: 1 INVITE
From: 
<sip:conf@mcuWeb>;tag=04283825_655e17f9_5b945722-4037-48b8-88db-171d288b6762
To: <sip:ray@X.X.X.X>
Max-Forwards: 16
Contact: <sip:conf@2X.X.X.X:5080>
Supported: timer
Session-Expires: 300;refresher=uas
Content-Type: application/sdp
Via: SIP/2.0/WS  X.X.X.X:8100;branch=z9hG4bK85ec.0da80f74.0
Via: SIP/2.0/UDP 
X.X.X.X:5080;branch=z9hG4bK5b945722-4037-48b8-88db-171d288b6762_655e17f9_9682852
705563491
Content-Length: 2818

But in console it is displayed like this:

SIP message received: INVITE sip:ray@Wy9fhM66Q15l.invalid;transport=ws SIP/2.0
Record-Route: <sip:X.X.X.X:8100;transport=ws;r2=on;lr=on>
Call-ID: aebc5295e72559f70b8fc5fe162e67dc@X.X.X.X
CSeq: 1 INVITE
From: 
<sip:conf@mcuWeb>;tag=04283825_655e17f9_5b945722-4037-48b8-88db-171d288b6762
To: <sip:ray@X.X.X.X>
Max-Forwards: 16
Contact: <sip:conf@X.X.X.X:5080>
Supported: timer,timer
Session-Expires: 300;refresher=uas
Content-Type: application/sdp
Via: SIP/2.0/WS X.X.X.X:8100;branch=z9hG4bK85ec.0da80f74.0;rport
Via: SIP/2.0/UDP 
X.X.X.X:5080;branch=z9hG4bK5b945722-4037-48b8-88db-171d288b6762_655e17f9_9682852
705563491;rport
Content-Length: 2818

Original issue reported on code.google.com by sergio.g...@gmail.com on 7 May 2013 at 12:23

GoogleCodeExporter commented 8 years ago
collection.lenght is undefined in:

SIPHeaderList.prototype.addAll =function(){
    if(logger!=undefined) logger.debug("SIPHeaderList:addAll():arguments="+arguments.toString());
    if(arguments.length==1)
    {

        var collection=arguments[0];
        var length=this.hlist.length;
        for(var i=0;i<collection.length;i++)
        {
            var n=i+length;
            this.hlist[n]=collection[i];
        }
        if(this.hlist.length!=length)
        {
            return true;
        }
        else
        {
            return false;
        }

Shouldn't it be collection.size() ?

Original comment by sergio.g...@gmail.com on 7 May 2013 at 12:35

GoogleCodeExporter commented 8 years ago
best is:

var collection=arguments[0].hlist;

Original comment by sergio.g...@gmail.com on 7 May 2013 at 1:19