[asterisk-commits] file: trunk r50709 - /trunk/channels/chan_sip.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Jan 12 21:56:26 MST 2007


Author: file
Date: Fri Jan 12 22:56:25 2007
New Revision: 50709

URL: http://svn.digium.com/view/asterisk?view=rev&rev=50709
Log:
Get rid of unneeded code, fix a spelling mistake, and use registry state a bit more. (issue #8402 reported by rizzo)

Modified:
    trunk/channels/chan_sip.c

Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=50709&r1=50708&r2=50709
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Fri Jan 12 22:56:25 2007
@@ -347,7 +347,7 @@
 	REG_STATE_UNREGISTERED = 0,	/*!< We are not registred */
 	REG_STATE_REGSENT,	/*!< Registration request sent */
 	REG_STATE_AUTHSENT,	/*!< We have tried to authenticate */
-	REG_STATE_REGISTERED,	/*!< Registred and done */
+	REG_STATE_REGISTERED,	/*!< Registered and done */
 	REG_STATE_REJECTED,	/*!< Registration rejected */
 	REG_STATE_TIMEOUT,	/*!< Registration timed out */
 	REG_STATE_NOAUTH,	/*!< We have no accepted credentials */
@@ -12088,18 +12088,16 @@
 		break;
 	case 403:	/* Forbidden */
 		ast_log(LOG_WARNING, "Forbidden - wrong password on authentication for REGISTER for '%s' to '%s'\n", p->registry->username, p->registry->hostname);
-		if (global_regattempts_max)
-			p->registry->regattempts = global_regattempts_max+1;
 		ast_sched_del(sched, r->timeout);
 		r->timeout = -1;
+		r->regstate = REG_STATE_NOAUTH;
 		ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);	
 		break;
 	case 404:	/* Not found */
 		ast_log(LOG_WARNING, "Got 404 Not found on SIP register to service %s@%s, giving up\n", p->registry->username,p->registry->hostname);
-		if (global_regattempts_max)
-			p->registry->regattempts = global_regattempts_max+1;
 		ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);	
 		r->call = NULL;
+		r->regstate = REG_STATE_REJECTED;
 		ast_sched_del(sched, r->timeout);
 		r->timeout = -1;
 		break;
@@ -12130,10 +12128,9 @@
 		break;
 	case 479:	/* SER: Not able to process the URI - address is wrong in register*/
 		ast_log(LOG_WARNING, "Got error 479 on register to %s@%s, giving up (check config)\n", p->registry->username,p->registry->hostname);
-		if (global_regattempts_max)
-			p->registry->regattempts = global_regattempts_max+1;
 		ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);	
 		r->call = NULL;
+		r->regstate = REG_STATE_REJECTED;
 		ast_sched_del(sched, r->timeout);
 		r->timeout = -1;
 		break;



More information about the asterisk-commits mailing list