[asterisk-bugs] [Asterisk 0013823]: responce to REGISTER is sent to wrong address

Asterisk Bug Tracker noreply at bugs.digium.com
Sun Nov 2 13:27:11 CST 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=13823 
====================================================================== 
Reported By:                dimas
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   13823
Category:                   Channels/chan_sip/General
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
Asterisk Version:           1.4.21.2 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             2008-11-02 12:08 CST
Last Modified:              2008-11-02 13:27 CST
====================================================================== 
Summary:                    responce to REGISTER is sent to wrong address
Description: 
I have client behind NAT. 
when client (10.0.0.17) sends REGISTER request, it puts rport into Via
header. check_via notices that and sets SIP_NAT_ROUTE to the &p->flags[0] -
note the log line:

Sending to 192.168.7.211 : 5079 (NAT)

however the register_verify function later does 
  ast_copy_flags(&p->flags[0], &peer->flags[0], SIP_NAT); 
effectively overwritting the value with SIP_NAT_RFC3581. And finally,
check_auth send response back to client to the wrong address which is
visible from the log line 

<--- Transmitting (no NAT) to 10.0.0.17:5079 --->

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

---------------------------------------------------------------------- 
 (0094505) dimas (reporter) - 2008-11-02 13:27
 http://bugs.digium.com/view.php?id=13823#c94505 
---------------------------------------------------------------------- 
And the same happens later when procssing INVITE - handle_request_invite
calls check_via which properly sets NAT_ROUTE but later check_user(_full)
gets called which overwrites flags (somewhere around line 9516, but there
are multiple places in this function which do copy SIP_FLAGS_TO_COPY).

As result, response to INVITE also goes to wrong direction. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-11-02 13:27 dimas          Note Added: 0094505                          
======================================================================




More information about the asterisk-bugs mailing list