[svn-commits] rizzo: branch rizzo/astobj2 r47952 -
/team/rizzo/astobj2/channels/chan_sip.c
svn-commits at lists.digium.com
svn-commits at lists.digium.com
Thu Nov 23 00:43:17 MST 2006
Author: rizzo
Date: Thu Nov 23 01:43:16 2006
New Revision: 47952
URL: http://svn.digium.com/view/asterisk?view=rev&rev=47952
Log:
don't consider as fatal the cases where the remote server refuses
our credentials. It could be a temporary issue e.g. a database
unavailability. In these case, just schedule a reregister.
Modified:
team/rizzo/astobj2/channels/chan_sip.c
Modified: team/rizzo/astobj2/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/rizzo/astobj2/channels/chan_sip.c?view=diff&rev=47952&r1=47951&r2=47952
==============================================================================
--- team/rizzo/astobj2/channels/chan_sip.c (original)
+++ team/rizzo/astobj2/channels/chan_sip.c Thu Nov 23 01:43:16 2006
@@ -12392,7 +12392,13 @@
ast_verbose("REGISTER %d %s@%s response %d state %s\n",
r->regattempts, r->username, r->hostname, resp, regstate2str(r->regstate));
+ /* Now handle the cases we know about */
switch (resp) {
+ default:
+ ast_log(LOG_WARNING, "Unknown response %d to REGISTER %d %s@%s state %s\n",
+ resp, r->regattempts, r->username, r->hostname, regstate2str(r->regstate));
+ break;
+
case 401: /* Unauthorized */
case 407: /* Proxy auth */
/* Possibly retransmit with proper auth credentials.
@@ -12464,8 +12470,15 @@
ast_log(LOG_DEBUG, "Registration successful\n");
reg_pvt_unlink(p);
-
- /* set us up for re-registering */
+ break;
+ }
+
+ if (r->timeout == -1) {
+ /* Unless someone has set up a new timeout, prepare for a re-register.
+ * Normally we get here in the OK case, but it could be that the
+ * remote party is (temporarily) refusing our credentials, and we want to
+ * retry.
+ */
/* according to section 6.13 of RFC, contact headers override
expires headers, so check those first */
expires = 0;
More information about the svn-commits
mailing list