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

Freeswitch SVN anthm at freeswitch.org
Sun Nov 19 14:51:41 EST 2006


Author: anthm
Date: Sun Nov 19 14:51:40 2006
New Revision: 3414

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

Log:
update

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	Sun Nov 19 14:51:40 2006
@@ -4150,42 +4150,43 @@
 
 		if (!(scheme && realm)) {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No scheme and realm!\n");
+			return;
 		}
 	}
 
-	if (!(scheme && realm)) {
-		return;
-	}
 
-	duprealm = strdup(realm);
-	qrealm = duprealm;
-	
-	while(qrealm && *qrealm && *qrealm == '"') {
-		qrealm++;
-	}
-	if ((p = strchr(qrealm, '"'))) {
-		*p = '\0';
-	}
-
 	if (sofia_private) {
 		if (sofia_private->oreg) {
 			oreg = sofia_private->oreg;
 		} else if (profile) {
 			outbound_reg_t *oregp;
-			for (oregp = profile->registrations; oregp; oregp = oregp->next) {
-				if (scheme && qrealm && !strcasecmp(oregp->register_scheme, scheme) && !strcasecmp(oregp->register_realm, qrealm)) {
-					oreg = oregp;
-					break;
+
+			if ((duprealm = strdup(realm))) {
+				qrealm = duprealm;
+	
+				while(*qrealm && *qrealm == '"') {
+					qrealm++;
 				}
-			}
-			if (!oreg) {
-				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No Match for Scheme [%s] Realm [%s]\n", scheme, qrealm);
-			}
+				if ((p = strchr(qrealm, '"'))) {
+					*p = '\0';
+				}
 
+				for (oregp = profile->registrations; oregp; oregp = oregp->next) {
+					if (scheme && qrealm && !strcasecmp(oregp->register_scheme, scheme) && !strcasecmp(oregp->register_realm, qrealm)) {
+						oreg = oregp;
+						break;
+					}
+				}
+				if (!oreg) {
+					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No Match for Scheme [%s] Realm [%s]\n", scheme, qrealm);
+				}
+				switch_safe_free(duprealm);
+			} else {
+				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Memory Error!\n");
+				return;
+			}
 		}
 	}
-
-	switch_safe_free(duprealm);
 
 	if (!oreg) {
 		return;



More information about the Freeswitch-svn mailing list