[Home]

Summary:ASTERISK-00574: [patch] chan_sip doesn't reply with the "Contact:" filled in correctly in all cases.
Reporter:exomorph (exomorph)Labels:
Date Opened:2003-11-26 00:47:22.000-0600Date Closed:2004-09-25 02:49:15
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) chan_sip.c.diff
Description:When Asterisk receives a sip message, chan_sip (on most cases) checks to make sure the user has been authenticated.  If not, then it issues a "407 - Proxy Authentication Required" message to force the other end to authenticate properly.

But in the two cases when an Invite or Subscribe messages are received, and the user is not authenticated, the 407 message does not have anything in the "Contact" field. This is causing the SipExpress TA2 gateway to not reply to the 407 message, because it thinks the message is invalid.  I'm sure there are a lot more devices out there with the same problem.

Attached is a patch that will correct this by parsing the Contact field out of the received message and use that in the reply for the 407 message.

****** ADDITIONAL INFORMATION ******

Sip traffic dump, parsed by SipExpress to show Contact: field error.

================================================================================

    SIP MESSAGE 9        216.251.134.8:5060() -> 216.251.128.22:5060()
    UDP Frame 9        25/Nov/03 18:51:47.7135 TimeFromPreviousSipFrame=15.5422 TimeFromStart=45.6
INVITE sip:814@asterisk SIP/2.0
Via: SIP/2.0/UDP 216.251.134.8:5060
From: 00 <sip:gvarga0@asterisk>;tag=2536768733
To: <sip:814@asterisk>
Call-ID: 3437148938@216.251.134.8
CSeq: 100 INVITE
Contact: <sip:gvarga0@216.251.134.8:5060>
max-forwards: 70
Allow: INVITE, ACK, CANCEL, BYE, REFER, NOTIFY
Content-Type: application/sdp
Content-Length:   170

v=0
o=- 0 0 IN IP4 216.251.134.8
s=-
c=IN IP4 216.251.134.8
b=AS:64
t=0 0
m=audio 13456 RTP/AVP 18 0 8 4 101
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:20

================================================================================

    SIP MESSAGE 10       216.251.128.22:5060() -> 216.251.134.8:5060()
    UDP Frame 10       25/Nov/03 18:51:47.7150 TimeFromPreviousSipFrame=0.0016 TimeFromStart=45.66
SIP/2.0 407 Proxy Authentication Required
Via: SIP/2.0/UDP 216.251.134.8:5060
From: 00 <sip:gvarga0@asterisk>;tag=2536768733
To: <sip:814@asterisk>;tag=as4d475b2a
Call-ID: 3437148938@216.251.134.8
CSeq: 100 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER
Contact:
Proxy-Authenticate: Digest realm="asterisk", nonce="29ff550143a66d20529a0e8d3b89"
Content-Length: 0


================================================================================
Comments:By: Brian West (bkw918) 2003-11-26 15:34:58.000-0600

Applied to CVS.