[asterisk-bugs] [Asterisk 0014446]: [patch] chan_sip does not support the maddr attribute in Via headers

Asterisk Bug Tracker noreply at bugs.digium.com
Thu Mar 12 17:31:08 CDT 2009


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=14446 
====================================================================== 
Reported By:                frawd
Assigned To:                oej
====================================================================== 
Project:                    Asterisk
Issue ID:                   14446
Category:                   Channels/chan_sip/Interoperability
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
Asterisk Version:           1.4.23 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2009-02-10 04:12 CST
Last Modified:              2009-03-12 17:31 CDT
====================================================================== 
Summary:                    [patch] chan_sip does not support the maddr
attribute in Via headers
Description: 
I recently connected Asterisk with a badly configured Nortel CS2K, which
sends me the following Via header:

Via: SIP/2.0/UDP
CS2KSSTEMAG:5060;maddr=213.60.204.48;branch=z9hG4bK-142abd7-ec6f41f2-4aeebdaf

CS2KSSTEMAG not being a valid DNS entry, the reply is never sent (Asterisk
blocks trying to resolve the name). Even tho it is a configuration error,
maddr should be used as reply address.

The attached patch fixes the issue in 1.4.23.1
====================================================================== 

---------------------------------------------------------------------- 
 (0101697) ibc (reporter) - 2009-03-12 17:31
 http://bugs.digium.com/view.php?id=14446#c101697 
---------------------------------------------------------------------- 
The patch is correct but with it the behaviour of Asterisk is wrong. In
fact Asterisk should reply to the origin source address even without your
patch:

RFC 3261 - 18.2.1
------------------
   When the server transport receives a request over any transport, it
   MUST examine the value of the "sent-by" parameter in the top Via
   header field value.  If the host portion of the "sent-by" parameter
   contains a domain name, or if it contains an IP address that differs
   from the packet source address, the server MUST add a "received"
   parameter to that Via header field value.  This parameter MUST
   contain the source address from which the packet was received.  This
   is to assist the server transport layer in sending the response,
   since it must be sent to the source IP address from which the request
   came.
------------------

In your case, since topmost Via contains a sent-by with a hostname
(CS2KSSTEMAG) Asterisk should add ";received=SOURCE_IP" parameter to Via
and route replies to that SOURCE_IP and port in sent-by (not present so
5060) (well, in case of existing "rport" Asterisk should send replies to
origin SOURCE_PORT). 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-03-12 17:31 ibc            Note Added: 0101697                          
======================================================================




More information about the asterisk-bugs mailing list