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

FreeSWITCH SVN brian at freeswitch.org
Tue Feb 17 12:36:21 PST 2009


Author: brian
Date: Tue Feb 17 14:36:21 2009
New Revision: 12113

Log:
fix challenge-realm

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

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c	Tue Feb 17 14:36:21 2009
@@ -877,19 +877,20 @@
 	}
 
 	if (!authorization || stale) {
+		const char *realm = profile->challenge_realm;
+
+		if (switch_strlen_zero(realm) || !strcasecmp(realm, "auto_to")) {
+			realm = to_host;
+		} else if (!strcasecmp(realm, "auto_from")) {
+			realm = from_host;
+		}
+
 		if (regtype == REG_REGISTER) {
-			sofia_reg_auth_challenge(nua, profile, nh, regtype, to_host, stale);
+			sofia_reg_auth_challenge(nua, profile, nh, regtype, realm, stale);
 			if (profile->debug) {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Requesting Registration from: [%s@%s]\n", to_user, to_host);
 			}
 		} else {
-			const char *realm = profile->challenge_realm;
-
-			if (switch_strlen_zero(realm) || !strcasecmp(realm, "auto_to")) {
-				realm = to_host;
-			} else if (!strcasecmp(realm, "auto_from")) {
-				realm = from_host;
-			}
 			sofia_reg_auth_challenge(nua, profile, nh, regtype, realm, stale);
 		}
 		return 1;



More information about the Freeswitch-svn mailing list