[Freeswitch-svn] [commit] r3140 - freeswitch/trunk/src/mod/endpoints/mod_sofia

Freeswitch SVN anthm at freeswitch.org
Sat Oct 21 18:54:57 EDT 2006


Author: anthm
Date: Sat Oct 21 18:54:55 2006
New Revision: 3140

Modified:
   freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c

Log:
add viles patch

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	Sat Oct 21 18:54:55 2006
@@ -3771,18 +3771,22 @@
 		return;
 	}
 	
-	if (sip->sip_www_authenticate) {
-		authenticate = sip->sip_www_authenticate;
-	} else if (sip->sip_proxy_authenticate) {
-		authenticate = sip->sip_proxy_authenticate;
-	}
-
 	if (status == 200) {
 		if (sofia_private->oreg) {
 			oreg->state = REG_STATE_REGISTER;
 			nua_handle_destroy(nh);
 		}
-	} else if (authenticate) {
+	} else if (status == 401 || status == 407) {
+
+		if (sip->sip_www_authenticate) {
+			authenticate = sip->sip_www_authenticate;
+		} else if (sip->sip_proxy_authenticate) {
+			authenticate = sip->sip_proxy_authenticate;
+		} else {
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Missing Authenticate Header!\n");
+			return;
+		}
+
 		char const *realm = (char const *) *authenticate->au_params;
 		char const *scheme = (char const *) authenticate->au_scheme;
 		char authentication[256] = "";



More information about the Freeswitch-svn mailing list