[asterisk-commits] rizzo: branch rizzo/astobj2 r47918 - /team/rizzo/astobj2/channels/chan_sip.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Nov 22 03:04:21 MST 2006


Author: rizzo
Date: Wed Nov 22 04:04:20 2006
New Revision: 47918

URL: http://svn.digium.com/view/asterisk?view=rev&rev=47918
Log:
in handle_response_register(), cases 401 and 407 are handled
in the same way so, at least until the code becomes different,
don't replicate the code.


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=47918&r1=47917&r2=47918
==============================================================================
--- team/rizzo/astobj2/channels/chan_sip.c (original)
+++ team/rizzo/astobj2/channels/chan_sip.c Wed Nov 22 04:04:20 2006
@@ -12331,11 +12331,13 @@
 
 	switch (resp) {
 	case 401:	/* Unauthorized */
+	case 407:	/* Proxy auth */
 		if (p->authtries == MAX_AUTHTRIES || do_register_auth(p, req, resp)) {
 			ast_log(LOG_NOTICE, "Failed to authenticate on REGISTER to '%s@%s' (Tries %d)\n", r->username, r->hostname, p->authtries);
 			set_destroy(p);
 		}
 		break;
+
 	case 403:	/* Forbidden */
 		ast_log(LOG_WARNING, "Forbidden - wrong password on authentication for REGISTER for '%s' to '%s'\n", r->username, r->hostname);
 		if (global_regattempts_max)
@@ -12353,12 +12355,7 @@
 		ast_sched_del(sched, r->timeout);
 		r->timeout = -1;
 		break;
-	case 407:	/* Proxy auth */
-		if (p->authtries == MAX_AUTHTRIES || do_register_auth(p, req, resp)) {
-			ast_log(LOG_NOTICE, "Failed to authenticate on REGISTER to '%s' (tries '%d')\n", get_header(&p->initreq, "From"), p->authtries);
-			set_destroy(p);
-		}
-		break;
+
 	case 423:	/* Interval too brief */
 		r->expiry = atoi(get_header(req, "Min-Expires"));
 		ast_log(LOG_WARNING, "Got 423 Interval too brief for service %s@%s, minimum is %d seconds\n", r->username, r->hostname, r->expiry);



More information about the asterisk-commits mailing list