[asterisk-commits] oej: trunk r45194 - /trunk/channels/chan_sip.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Oct 16 05:28:19 MST 2006


Author: oej
Date: Mon Oct 16 07:28:18 2006
New Revision: 45194

URL: http://svn.digium.com/view/asterisk?rev=45194&view=rev
Log:
A B2BUA should *not* issue proxy auth.

Modified:
    trunk/channels/chan_sip.c

Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?rev=45194&r1=45193&r2=45194&view=diff
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Mon Oct 16 07:28:18 2006
@@ -7746,7 +7746,6 @@
 	char *c;
 	int  wrongnonce = FALSE;
 	int  good_response;
-	int code;
 	const char *usednonce = p->randdata;
 
 	/* table of recognised keywords, and their value in the digest */
@@ -7765,21 +7764,16 @@
 	/* Always OK if no secret */
 	if (ast_strlen_zero(secret) && ast_strlen_zero(md5secret))
 		return AUTH_SUCCESSFUL;
-	if (sipmethod == SIP_REGISTER || sipmethod == SIP_SUBSCRIBE) {
-		/* On a REGISTER, we have to use 401 and its family of headers
-		 * instead of 407 and its family of headers.
-		 */
-		code = WWW_AUTH;
-		response = "401 Unauthorized";
-	} else {
-		code = PROXY_AUTH;
-		response = "407 Proxy Authentication Required";
-	}
+
+	/* Always auth with WWW-auth since we're NOT a proxy */
+	/* Using proxy-auth in a B2BUA may block proxy authorization in the same transaction */
+	response = "401 Unauthorized";
+
 	/*
 	 * Note the apparent swap of arguments below, compared to other
 	 * usages of auth_headers().
 	 */
-	auth_headers(code, &respheader, &reqheader);
+	auth_headers(WWW_AUTH, &respheader, &reqheader);
 
 	authtoken =  get_header(req, reqheader);	
 	if (ignore && !ast_strlen_zero(p->randdata) && ast_strlen_zero(authtoken)) {



More information about the asterisk-commits mailing list