[asterisk-bugs] [Asterisk 0011318]: When my gateway gets a new ip address, sip can not be re-registered (wrong "nonce"?)

noreply at bugs.digium.com noreply at bugs.digium.com
Thu Nov 22 01:59:42 CST 2007


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=11318 
====================================================================== 
Reported By:                MicWy
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   11318
Category:                   Channels/chan_sip/Registration
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     feedback
Asterisk Version:            1.4.11  
SVN Branch (only for SVN checkouts, not tarball releases): N/A  
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             11-20-2007 01:14 CST
Last Modified:              11-22-2007 01:59 CST
====================================================================== 
Summary:                    When my gateway gets a new ip address, sip can not
be re-registered (wrong "nonce"?)
Description: 
I'm running asterisk on a local server. The internet gateway gets a new ip
every night. after that, all external sip registrations remains in the
state "request send".

I tried to debug sip:

SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP
88.74.139.30:16322;received=88.74.155.83;branch=z9hG4bK6e283905;rport=10036
From: <sip:03XXXXXXX at 0341.sip.arcor.de>;tag=as3c85d392
To: <sip:034XXXXXXX at 0341.sip.arcor.de>;tag=SDm61ed99-
Call-ID: 0ecf687b44aa9b3777ffed0967026ef5 at 88.74.139.30
CSeq: 1284 REGISTER
Server: SSW/0.0.0
WWW-Authenticate: Digest
realm="arcor.de",nonce="47428568f7222c281c2cf7505b622ed4f37325a4",algorithm=MD5
Contact: <sip:.iIiIiI.52521118. at 82.82.16.8>
Content-Length: 0

--- (10 headers 0 lines) ---
Nov 20 08:08:23 NOTICE[15125]: chan_sip.c:5431 sip_reg_timeout:    --
Registration for '03XXXXXXX at 0341.sip.arcor.de' timed out, trying again
(Attempt http://bugs.digium.com/view.php?id=523)
REGISTER 13 headers, 0 lines
Reliably Transmitting (no NAT) to 212.144.96.102:5060:
REGISTER sip:0341.sip.arcor.de SIP/2.0
Via: SIP/2.0/UDP 192.168.100.2:5060;branch=z9hG4bK78e7369a;rport
From: <sip:03XXXXXXX at 0341.sip.arcor.de>;tag=as5c0adb73
To: <sip:03XXXXXXX at 0341.sip.arcor.de>
Call-ID: 0ecf687b44aa9b3777ffed0967026ef5 at 192.168.100.2
CSeq: 1285 REGISTER
User-Agent: Asterisk PBX
Max-Forwards: 70
Authorization: Digest username="03XXXXXXX", realm="arcor.de",
algorithm=MD5, uri="sip:0341.sip.arcor.de",
nonce="474259501d015b7c6917172b433db63e4b0d5eb7",
response="89c243afdadcb84147e76e795eacf174", opaque=""
Expires: 120
Contact: <sip:03XXXXXXX at 192.168.100.2>
Event: registration
Content-Length: 0

---
Destroying call '0ecf687b44aa9b3777ffed0967026ef5 at 192.168.100.2'
isdn-gw1*CLI> 
<-- SIP read from 212.144.96.102:5060: 
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP
88.74.139.30:16322;received=88.74.155.83;branch=z9hG4bK78e7369a;rport=10036
From: <sip:03XXXXXXX at 0341.sip.arcor.de>;tag=as5c0adb73
To: <sip:03XXXXXXX at 0341.sip.arcor.de>;tag=SDm61ed99-2b8de099
Call-ID: 0ecf687b44aa9b3777ffed0967026ef5 at 88.74.139.30
CSeq: 1285 REGISTER
Server: SSW/0.0.0
WWW-Authenticate: Digest
realm="arcor.de",nonce="47428568f7222c281c2cf7505b622ed4f37325a4",algorithm=MD5
Contact: <sip:.iIiIiI.52521118. at 82.82.16.8>
Content-Length: 0


--- (10 headers 0 lines) ---
Retransmitting http://bugs.digium.com/view.php?id=1 (no NAT) to
212.144.96.102:5060:
REGISTER sip:0341.sip.arcor.de SIP/2.0
Via: SIP/2.0/UDP 192.168.100.2:5060;branch=z9hG4bK78e7369a;rport
From: <sip:03XXXXXXX at 0341.sip.arcor.de>;tag=as5c0adb73
To: <sip:03XXXXXXX at 0341.sip.arcor.de>
Call-ID: 0ecf687b44aa9b3777ffed0967026ef5 at 192.168.100.2
CSeq: 1285 REGISTER
User-Agent: Asterisk PBX
Max-Forwards: 70
Authorization: Digest username="03XXXXXXX", realm="arcor.de",
algorithm=MD5, uri="sip:0341.sip.arcor.de",
nonce="474259501d015b7c6917172b433db63e4b0d5eb7",
response="89c243afdadcb84147e76e795eacf174", opaque=""
Expires: 120
Contact: <sip:03XXXXXXX at 192.168.100.2>
Event: registration
Content-Length: 0


As you can see, the parameter "nonce" which is sent by the server is
totally ignored by asterisk. Is always uses the same "nonce" in it's
response. When i do a "reload", asterisk re-registers fine. The requests
have the same "nonce" as the server contains in it's "unauthorized"
responses.


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

---------------------------------------------------------------------- 
 MicWy - 11-22-07 01:59  
---------------------------------------------------------------------- 
That's the network:

Asterisk<->router<->external SIP Provider

Asterisk-Machines (192.168.100.1/192.168.100.2), both have different
asterisk versions, both use external sip providers.

Router, internal IP 192.168.100.254, external IP changes every night. The
router is doing NAT.

SIP-Provider (external, have fixed IPs).


There's nothing between asterisk and the SIP provider that changes anythin
in the sip protocol.


I can reproduce the problem as soon as I disconnect the router to get a
new IP:
- first, the peers gets "unreachable" until the router has a new IP
- then asterisks sends a lot of REGISTER requests. Each is responded with
"FORBIDDEN"
- when i do a "reload", it sends a single REGISTER request which succeeds 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
11-22-07 01:59  MicWy          Note Added: 0074178                          
======================================================================




More information about the asterisk-bugs mailing list