[asterisk-bugs] [Asterisk 0012761]: chan_sip: build_contact() does not put alternate port setting in Contact header

noreply at bugs.digium.com noreply at bugs.digium.com
Fri May 30 14:25:41 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=12761 
====================================================================== 
Reported By:                asbestoshead
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   12761
Category:                   Channels/chan_sip/General
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
Asterisk Version:           SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 118255 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             05-30-2008 03:04 CDT
Last Modified:              05-30-2008 14:25 CDT
====================================================================== 
Summary:                    chan_sip: build_contact() does not put alternate
port setting in Contact header
Description: 
build_contact() looks at the *other* end's port to decide whether there's a
non-standard port in use. If my end has bindport=5062 but the peer has
port=5060, when I send an invite to the peer, my Contact header doesn't
have ":5062".

initreqprep() has the same problem when setting the From: header.

chan_sip in Asterisk trunk and 1.6.0-beta8 (but not 1.4.19) have this
problem.

I have a trivial patch for this against Moy's mfcr2 branch off trunk, but
I can't find the link to sign the contributor's agreement. The patch also
applies to 1.6.0beta8, although I haven't tested it there...
====================================================================== 

---------------------------------------------------------------------- 
 rjain - 05-30-08 14:25  
---------------------------------------------------------------------- 
I've tried to mimic your setup. I now have SIPp running on the same machine
bound to port 5060 and that acts as a SIP peer to my Asterisk. There is no
NAT in the picture. I call from a zaptel device towards the SIP peer. Below
is the outbound INVITE from Asterisk. The Contact: contains 5065 as you can
see. Not sure what's different now between our setups.

INVITE sip:2005 at 159.63.73.11 SIP/2.0
Via: SIP/2.0/UDP 159.63.73.11:5065;branch=z9hG4bK6d7ec5fb;rport
Max-Forwards: 70
From: "asterisk" <sip:asterisk at 159.63.73.11:5065>;tag=as75c11cc6
To: <sip:2005 at 159.63.73.11>
Contact: <sip:asterisk at 159.63.73.11:5065>
Call-ID: 4bc81e942378afb56d10202f7c6d16c1 at 159.63.73.11
CSeq: 102 INVITE
User-Agent: Asterisk PBX 1.6.0-beta8
Date: Fri, 30 May 2008 19:20:16 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 314

v=0
o=root 2125222828 2125222828 IN IP4 159.63.73.11
s=Asterisk PBX 1.6.0-beta8
c=IN IP4 159.63.73.11
t=0 0
m=audio 18442 RTP/AVP 0 3 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:3 GSM/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
05-30-08 14:25  rjain          Note Added: 0087570                          
======================================================================




More information about the asterisk-bugs mailing list