[OpenSIPS-Devel] [ opensips-Bugs-3415264 ] recieved=x.x.x.x added to wrong via header

SourceForge.net noreply at sourceforge.net
Mon Oct 3 09:58:03 CEST 2011


Bugs item #3415264, was opened at 2011-09-29 10:39
Message generated for change (Comment added) made by mtryfoss
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=3415264&group_id=232389

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: Fixed
Priority: 5
Private: No
Submitted By: Morten Tryfoss (mtryfoss)
Assigned to: Bogdan-Andrei Iancu (bogdan_iancu)
Summary: recieved=x.x.x.x added to wrong via header

Initial Comment:
Hi!

It seems like 'recived' is added to the wrong header when the dialog contains multiple comma separated Via-headers. It's just appended to the end of the line.

Example:
Via: SIP/2.0/TCP 10.3.8.20:5060;branch=z9hG4bK0440914511a92062ea12e98d4, SIP/2.0/TCP 10.3.8.19:5062;branch=z9hG4bKaad385d13b702b61ee38b3118;rport=4108;received=80.239.13.209

The correct would be:
Via: SIP/2.0/TCP 10.3.8.20:5060;branch=z9hG4bK0440914511a92062ea12e98d4;rport=4108;received=80.239.13.209, SIP/2.0/TCP 10.3.8.19:5062;branch=z9hG4bKaad385d13b702b61ee38b3118

It's working ok when you have one Via pr line:
Via: SIP/2.0/UDP 172.50.1.8;branch=z9hG4bK6257.ce0c3755.0;i=1;received=85.19.212.117
Via: SIP/2.0/TCP 172.50.1.9:5060;received=172.50.1.9;branch=z9hG4bK397aee9f;rport=39350

Regards,
Morten Tryfoss

----------------------------------------------------------------------

>Comment By: Morten Tryfoss (mtryfoss)
Date: 2011-10-03 09:58

Message:
Hi again,

A trace for INVITE without force_report seems like this:

INVITE sip:48485858 at 85.19.212.36;transport=tcp SIP/2.0
To: <sip:48485858 at 10.3.8.20:5060>
From: "Unknown" <sip:38531300 at dialer2.krs>;tag=213459
Via: SIP/2.0/TCP 10.3.8.20:5060;branch=z9hG4bK98ab5eedf1cf3daff50c64b3f,
SIP/2.0/TCP 10.3.8.19:5062;branch=z9hG4bK1c87b1d1160eb11fd64222407
Call-ID: 78b42eb76231af56b1503bdcce4a912c at 10.3.8.19
CSeq: 1 INVITE
Contact: <sip:38531300 at 10.3.8.19:5062;transport=tcp>
Max-Forwards: 69
x-inin-crn: 1001099797;loc=Kristiansand;ms=NECIC4
Supported: join, replaces
User-Agent: ININ-TsServer/3.11.11.12100
Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, PRACK, REFER,
SUBSCRIBE
Accept: application/sdp
Accept-Encoding: identity
Content-Type: application/sdp
Content-Length: 197
Record-Route: <sip:10.3.8.20:5060;lr;transport=tcp>

v=0
o=ININ 2009292242 2009292243 IN IP4 10.3.8.19
s=Interaction
c=IN IP4 10.3.8.20
t=0 0
m=audio 18198 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15

SIP/2.0 100 Trying
To: <sip:48485858 at 10.3.8.20:5060>
From: "Unknown" <sip:38531300 at dialer2.krs>;tag=213459
Via: SIP/2.0/TCP 10.3.8.20:5060;received=80.239.13.209Via: SIP/2.0/TCP
10.3.8.20:5060;branch=z9hG4bK98ab5eedf1cf3daff50c64b3f, SIP/2.0/TCP
10.3.8.19:5062;branch=z9hG4bK1c87b1d1160eb11fd64222407
Call-ID: 78b42eb76231af56b1503bdcce4a912c at 10.3.8.19
CSeq: 1 INVITE
Server: OpenSIPS (1.6.4-2-notls (x86_64

SIP/2.0 183 Session Progress
To: <sip:48485858 at 10.3.8.20:5060>;tag=B2B.327.507
From: "Unknown" <sip:38531300 at dialer2.krs>;tag=213459
Via: SIP/2.0/TCP 10.3.8.20:5060;received=80.239.13.209Via: SIP/2.0/TCP
10.3.8.20:5060;branch=z9hG4bK98ab5eedf1cf3daff50c64b3f, SIP/2.0/TCP
10.3.8.19:5062;branch=z9hG4bK1c87b1d1160eb11fd64222407
Call-ID: 78b42eb76231af56b1503bdcce4a912c at 10.3.8.19
CSeq: 1 INVITE
Record-Route: <sip:10.3.8.20:5060;lr;transport=tcp>
Content-Type: application/sdp
Supported: replaces, timer
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Contact: <sip:85.19.212.36:5060;transport=tcp>
Server: OpenSIPS (1.6.4-2-notls (x86_64/linux))
Content-Length: 262


----------------------------------------------------------------------

Comment By: Morten Tryfoss (mtryfoss)
Date: 2011-10-03 09:45

Message:
A little update.

The mess-up seems to be happening when force_rport() is not used (also on
183 Session progress..)

Morten

----------------------------------------------------------------------

Comment By: Morten Tryfoss (mtryfoss)
Date: 2011-10-02 15:55

Message:
Hi again!

I obviously did something wrong. It seems to work now. Thanks a lot!

However, this is a trace for a cancelled call.
Isn't this header messed up?

Via: SIP/2.0/TCP 10.3.8.20:5060;received=80.239.13.209Via: SIP/2.0/TCP
10.3.8.20:5060;branch=z9hG4bKde11688b03b549677351f9ae7


CANCEL sip:48485858 at 85.19.212.36;transport=tcp SIP/2.0
To: <sip:48485858 at 10.3.8.20:5060>
From: "Unknown" <sip:48999303 at dialer2.krs>;tag=185155
Call-ID: f18f50fb63f5f60c79ba5dd6859f19b1 at 10.3.8.19
CSeq: 1 CANCEL
Via: SIP/2.0/TCP 10.3.8.20:5060;branch=z9hG4bKde11688b03b549677351f9ae7
Content-Length: 0


SIP/2.0 200 canceling
To:
<sip:48485858 at 10.3.8.20:5060>;tag=71e4b0f8d9557d11d81f406e5e9f30fc-d6c2
From: "Unknown" <sip:48999303 at dialer2.krs>;tag=185155
Call-ID: f18f50fb63f5f60c79ba5dd6859f19b1 at 10.3.8.19
CSeq: 1 CANCEL
Via: SIP/2.0/TCP 10.3.8.20:5060;received=80.239.13.209Via: SIP/2.0/TCP
10.3.8.20:5060;branch=z9hG4bKde11688b03b549677351f9ae7
Server: OpenSIPS (1.6.4-2-notls (x86_64))

SIP/2.0 487 Request Terminated
To: <sip:48485858 at 10.3.8.20:5060>;tag=B2B.179.127
From: "Unknown" <sip:48999303 at dialer2.krs>;tag=185155
Via: SIP/2.0/TCP
10.3.8.20:5060;received=80.239.13.209;rport=1453;branch=z9hG4bKde11688b03b549677351f9ae7,
SIP/2.0/TCP 10.3.8.19:5062;branch=z9hG4bK4b4e4b5ab77dc64b4a4a09c23
Call-ID: f18f50fb63f5f60c79ba5dd6859f19b1 at 10.3.8.19
CSeq: 1 INVITE
Supported: replaces, timer
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Contact: <sip:85.19.212.36:5060;transport=tcp>
Server: OpenSIPS (1.6.4-2-notls (x86_64/linux))
Content-Length: 0


Regards,
Morten


----------------------------------------------------------------------

Comment By: Vladut-Stefan Paiu (vladut-paiu)
Date: 2011-09-30 16:23

Message:
Hello,

This is strange.. We have tested the patch and it fixed the problems in
all of our tests.
I know this may sound silly, but upon applying the patch, have your
recompiled OpenSIPS ?
If yes, and the problem still persists, can you please give us more info
about the specific scenario when this is happening ?

Regards,
Vlad

----------------------------------------------------------------------

Comment By: Morten Tryfoss (mtryfoss)
Date: 2011-09-30 13:23

Message:
Hi again,

Thanks for quick response.

Patched and tested again but still no luck.

Note: I forgot to mention that I'm using the B2BUA-module for top hiding.
However, when I disabled this it's still wrong.

Trace:
INVITE sip:48485858 at 85.19.212.36;transport=tcp SIP/2.0
To: <sip:48485858 at 10.3.8.20:5060>
From: "Unknown" <sip:38531300 at dialer2.krs>;tag=116323
Via: SIP/2.0/TCP 10.3.8.20:5060;branch=z9hG4bKdd50a3d6fdadb2888eb8d9294,
SIP/2.0/TCP 10.3.8.19:5062;branch=z9hG4bK453a24108950032c17619d6f5
Call-ID: ad1c2c8efed25472ba8ec6d30107161a at 10.3.8.19
CSeq: 1 INVITE
Contact: <sip:38531300 at 10.3.8.19:5062;transport=tcp>
Max-Forwards: 69
x-inin-crn: 1001096482;loc=Kristiansand;ms=NECIC4
Supported: join, replaces
User-Agent: ININ-TsServer/3.11.11.12100
Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, PRACK, REFER,
SUBSCRIBE
Accept: application/sdp
Accept-Encoding: identity
Content-Type: application/sdp
Content-Length: 197
Record-Route: <sip:10.3.8.20:5060;lr;transport=tcp>

v=0
o=ININ 3665091487 3665091488 IN IP4 10.3.8.19
s=Interaction
c=IN IP4 10.3.8.20
t=0 0
m=audio 31776 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15

SIP/2.0 100 Trying
To: <sip:48485858 at 10.3.8.20:5060>
From: "Unknown" <sip:38531300 at dialer2.krs>;tag=116323
Via: SIP/2.0/TCP 10.3.8.20:5060;branch=z9hG4bKdd50a3d6fdadb2888eb8d9294,
SIP/2.0/TCP
10.3.8.19:5062;branch=z9hG4bK453a24108950032c17619d6f5;rport=3578;received=80.239.13.209
Call-ID: ad1c2c8efed25472ba8ec6d30107161a at 10.3.8.19
CSeq: 1 INVITE
Server: OpenSIPS (1.6.4-2-notls (x86_64/linux))
Content-Length: 0


SIP/2.0 183 Session Progress
To: <sip:48485858 at 10.3.8.20:5060>;tag=B2B.126.378
From: "Unknown" <sip:38531300 at dialer2.krs>;tag=116323
Via: SIP/2.0/TCP 10.3.8.20:5060;branch=z9hG4bKdd50a3d6fdadb2888eb8d9294,
SIP/2.0/TCP
10.3.8.19:5062;branch=z9hG4bK453a24108950032c17619d6f5;rport=3578;received=80.239.13.209
Call-ID: ad1c2c8efed25472ba8ec6d30107161a at 10.3.8.19
CSeq: 1 INVITE
Record-Route: <sip:10.3.8.20:5060;lr;transport=tcp>
Content-Type: application/sdp
Supported: replaces, timer
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Contact: <sip:85.19.212.36:5060;transport=tcp>
Server: OpenSIPS (1.6.4-2-notls (x86_64/linux))
Content-Length: 262

Regards,
Morten

----------------------------------------------------------------------

Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2011-09-30 12:13

Message:
Hi Morten,

Attached is a patch with the fix - I tested, but before uploading on SVN I
would appreciate if you could also run some tests with it.

Thanks and regards,
Bogdan

----------------------------------------------------------------------

Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2011-09-29 16:31

Message:
Ah...ok, the problem seams to be when adding rport + received on replies,
not when forwarding..... Got it.

I will prepare a fix for this.

Thanks and regards,
Bogdan

----------------------------------------------------------------------

Comment By: Morten Tryfoss (mtryfoss)
Date: 2011-09-29 15:59

Message:
The call disconnects on the caller-side as soon as it received the 183
Session Progress.

Complete trace:
INVITE sip:48485858 at 85.19.212.36;transport=tcp SIP/2.0
To: <sip:48485858 at 10.3.8.20:5060>
From: "Unknown" <sip:38531300 at dialer2.krs>;tag=65480
Via: SIP/2.0/TCP 10.3.8.20:5060;branch=z9hG4bK117c679a7a564bb8609b56e88,
SIP/2.0/TCP 10.3.8.19:5062;branch=z9hG4bK54b1106da2bc4a3d07f6ace9a
Call-ID: 271c333045c13cf007cb1519b5c09c6f at 10.3.8.19
CSeq: 1 INVITE
Contact: <sip:38531300 at 10.3.8.19:5062;transport=tcp>
Max-Forwards: 69
x-inin-crn: 1001090768;loc=Kristiansand;ms=NECIC4
Supported: join, replaces
User-Agent: ININ-TsServer/3.11.11.12100
Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, PRACK, REFER,
SUBSCRIBE
Accept: application/sdp
Accept-Encoding: identity
Content-Type: application/sdp
Content-Length: 197
Record-Route: <sip:10.3.8.20:5060;lr;transport=tcp>

v=0
o=ININ 2813816323 2813816324 IN IP4 10.3.8.19
s=Interaction
c=IN IP4 10.3.8.20
t=0 0
m=audio 28804 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15

SIP/2.0 100 Trying
To: <sip:48485858 at 10.3.8.20:5060>
From: "Unknown" <sip:38531300 at dialer2.krs>;tag=65480
Via: SIP/2.0/TCP 10.3.8.20:5060;branch=z9hG4bK117c679a7a564bb8609b56e88,
SIP/2.0/TCP
10.3.8.19:5062;branch=z9hG4bK54b1106da2bc4a3d07f6ace9a;rport=4283;received=80.239.13.209
Call-ID: 271c333045c13cf007cb1519b5c09c6f at 10.3.8.19
CSeq: 1 INVITE
Server: OpenSIPS (1.6.4-2-notls (x86_64/linux))
Content-Length: 0


SIP/2.0 183 Session Progress
To: <sip:48485858 at 10.3.8.20:5060>;tag=B2B.297.356
From: "Unknown" <sip:38531300 at dialer2.krs>;tag=65480
Via: SIP/2.0/TCP 10.3.8.20:5060;branch=z9hG4bK117c679a7a564bb8609b56e88,
SIP/2.0/TCP
10.3.8.19:5062;branch=z9hG4bK54b1106da2bc4a3d07f6ace9a;rport=4283;received=80.239.13.209
Call-ID: 271c333045c13cf007cb1519b5c09c6f at 10.3.8.19
CSeq: 1 INVITE
Record-Route: <sip:10.3.8.20:5060;lr;transport=tcp>
Content-Type: application/sdp
Supported: replaces, timer
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Contact: <sip:85.19.212.36:5060;transport=tcp>
Server: OpenSIPS (1.6.4-2-notls (x86_64/linux))
Content-Length: 264

v=0
o=root 2116035828 2116035828 IN IP4 85.19.212.13
s=Asterisk PBX 1.6.1.20
c=IN IP4 85.19.212.13
t=0 0
m=audio 16330 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

SIP/2.0 180 Ringing
To: <sip:48485858 at 10.3.8.20:5060>;tag=B2B.297.356
From: "Unknown" <sip:38531300 at dialer2.krs>;tag=65480
Via: SIP/2.0/TCP 10.3.8.20:5060;branch=z9hG4bK117c679a7a564bb8609b56e88,
SIP/2.0/TCP
10.3.8.19:5062;branch=z9hG4bK54b1106da2bc4a3d07f6ace9a;rport=4283;received=80.239.13.209
Call-ID: 271c333045c13cf007cb1519b5c09c6f at 10.3.8.19
CSeq: 1 INVITE
Record-Route: <sip:10.3.8.20:5060;lr;transport=tcp>
Supported: replaces, timer
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Contact: <sip:85.19.212.36:5060;transport=tcp>
Server: OpenSIPS (1.6.4-2-notls (x86_64/linux))
Content-Length: 0


SIP/2.0 200 OK
To: <sip:48485858 at 10.3.8.20:5060>;tag=B2B.297.356
From: "Unknown" <sip:38531300 at dialer2.krs>;tag=65480
Via: SIP/2.0/TCP 10.3.8.20:5060;branch=z9hG4bK117c679a7a564bb8609b56e88,
SIP/2.0/TCP
10.3.8.19:5062;branch=z9hG4bK54b1106da2bc4a3d07f6ace9a;rport=4283;received=80.239.13.209
Call-ID: 271c333045c13cf007cb1519b5c09c6f at 10.3.8.19
CSeq: 1 INVITE
Record-Route: <sip:10.3.8.20:5060;lr;transport=tcp>
Content-Type: application/sdp
Supported: replaces, timer
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Contact: <sip:85.19.212.36:5060;transport=tcp>
Server: OpenSIPS (1.6.4-2-notls (x86_64/linux))
Content-Length: 264

v=0
o=root 2116035828 2116035829 IN IP4 85.19.212.13
s=Asterisk PBX 1.6.1.20
c=IN IP4 85.19.212.13
t=0 0
m=audio 16330 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

SIP/2.0 200 OK
To: <sip:48485858 at 10.3.8.20:5060>;tag=B2B.297.356
From: "Unknown" <sip:38531300 at dialer2.krs>;tag=65480
Via: SIP/2.0/TCP 10.3.8.20:5060;branch=z9hG4bK117c679a7a564bb8609b56e88,
SIP/2.0/TCP
10.3.8.19:5062;branch=z9hG4bK54b1106da2bc4a3d07f6ace9a;rport=4283;received=80.239.13.209
Call-ID: 271c333045c13cf007cb1519b5c09c6f at 10.3.8.19
CSeq: 1 INVITE
Record-Route: <sip:10.3.8.20:5060;lr;transport=tcp>
Content-Type: application/sdp
Supported: replaces, timer
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Contact: <sip:85.19.212.36:5060;transport=tcp>
Server: OpenSIPS (1.6.4-2-notls (x86_64/linux))
Content-Length: 264

v=0
o=root 2116035828 2116035829 IN IP4 85.19.212.13
s=Asterisk PBX 1.6.1.20
c=IN IP4 85.19.212.13
t=0 0
m=audio 16330 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv





----------------------------------------------------------------------

Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2011-09-29 15:33

Message:
Hi Morten,

Just tried a small test :

U 127.0.0.1:36445 -> 127.0.0.1:5060
  MESSAGE sip:600 at 127.0.0.6;kk=q SIP/2.0
  Via: SIP/2.0/TCP 10.3.8.20:5060;branch=z9hG4bK0440914511a92062ea12e98d4,
SIP/2.0/TCP 10.3.8.19:5062;branch=z9hG4bKaad385d13b702b61ee38b3118
  ...
 
#
U 127.0.0.1:5060 -> 127.0.0.6:5060
  MESSAGE sip:600 at 127.0.0.6;kk=q SIP/2.0
  Via: SIP/2.0/UDP
127.0.0.1;branch=z9hG4bK7218.b5582ab096480158f0068e6fe2b7eba3.0
  Via: SIP/2.0/TCP
10.3.8.20:5060;rport=36445;received=127.0.0.1;branch=z9hG4bK0440914511a92062ea12e98d4,
SIP/2.0/TCP 10.3.8.19:5062;branch=z9hG4bKaad385d13b702b61ee38b3118

And as you can see, the rport and received were inserted to the right body
part.

Could you upload a full message trace (in and out) showing the problem you
reported ?

Regards,
Bogdan

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=3415264&group_id=232389



More information about the Devel mailing list