Summary:ASTERISK-12199: Asterisk gives up on registration after receiving 408 Timeout response once
Reporter:Ricardo Villa (ricvil)Labels:
Date Opened:2008-06-15 20:28:14Date Closed:2008-06-27 16:54:13
Versions:Frequency of
Description:This was originally reported under bug 12323.  I think it was closed prematurely.  It was supposed to be fixed in 1.4.20 according to the changelog:
 119 * channels/chan_sip.c: Don't give up on attempting an outbound
 120  registration if we receive a 408 Timeout. (closes issue ASTERISK-11744)

I just tried it today and the problem still happens.  The code is:
 12546         case 408:       /* Request timeout */
 12547                 ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
 12548                 r->call = NULL;
 12549                 AST_SCHED_DEL(sched, r->timeout);
 12550                 break;

But the only way I can get it to re-register again after receiving a 408 is by changing the code to:
 12546         case 408:       /* Request timeout */
 12547                 break;

Did anybody really test this out before closing bug 12323?  

It would also be nice to enable re-registration for a 404 response.  We are running into an issue were a provider takes down its database for a few minutes and during that timeframe we receive a '404 Not Found' when attempting to register.  After that, Asterisk never registers again even though the provider is back up and running normally.  It would be better for Asterisk to rely on the sip.conf variable 'registerattempts' for these cases rather than giving up after just one try.  
Comments:By: Digium Subversion (svnbot) 2008-06-27 16:54:05

Repository: asterisk
Revision: 126056

U   branches/1.4/channels/chan_sip.c

r126056 | tilghman | 2008-06-27 16:53:53 -0500 (Fri, 27 Jun 2008) | 4 lines

When we get a 408 Timeout, don't stop trying to re-register.
(closes issue ASTERISK-12199)
Reported by: ricvil