[asterisk-commits] dvossel: branch dvossel/iax2encryption_trunk r174881 - /team/dvossel/iax2encr...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Feb 11 11:08:54 CST 2009


Author: dvossel
Date: Wed Feb 11 11:08:54 2009
New Revision: 174881

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=174881
Log:
This commit will rectify several issues i worked hard to identify involving encryption methods not being recognised... After i unify this branch, i will verify my code on reviewboard so i can correctify all my stupid mistakes... I certify this commit as FRESHsvn diff! zombies. 

Modified:
    team/dvossel/iax2encryption_trunk/channels/chan_iax2.c

Modified: team/dvossel/iax2encryption_trunk/channels/chan_iax2.c
URL: http://svn.digium.com/svn-view/asterisk/team/dvossel/iax2encryption_trunk/channels/chan_iax2.c?view=diff&rev=174881&r1=174880&r2=174881
==============================================================================
--- team/dvossel/iax2encryption_trunk/channels/chan_iax2.c (original)
+++ team/dvossel/iax2encryption_trunk/channels/chan_iax2.c Wed Feb 11 11:08:54 2009
@@ -6404,7 +6404,7 @@
 		ast_string_field_set(p, host, user->name);
 		user = user_unref(user);
 	}
-	if (ast_test_flag(p, IAX_FORCE_ENCRYPT) && !ies->encmethods){
+	if (ast_test_flag(p, IAX_FORCE_ENCRYPT) && !p->encmethods) { 
 		ast_log(LOG_NOTICE, "Call Terminated, Incomming call is unencrypted while force encrypt is enabled.");
 		return res;
 	}
@@ -10717,8 +10717,9 @@
 			} else if (!strcasecmp(v->name, "auth")) {
 				peer->authmethods = get_auth_methods(v->value);
 			} else if (!strcasecmp(v->name, "encryption")) {
-				if (!ast_test_flag(peer, IAX_FORCE_ENCRYPT)) {
-					peer->encmethods = get_encrypt_methods(v->value);	
+				peer->encmethods = get_encrypt_methods(v->value);
+				if (!ast_true(v->value)) {
+					ast_clear_flag(peer, IAX_FORCE_ENCRYPT);
 				}
 			} else if (!strcasecmp(v->name, "forceencryption")) {
 				if (ast_true(v->value)) {
@@ -10986,8 +10987,9 @@
 			} else if (!strcasecmp(v->name, "auth")) {
 				user->authmethods = get_auth_methods(v->value);
 			} else if (!strcasecmp(v->name, "encryption")) {
-				if (!ast_test_flag(user, IAX_FORCE_ENCRYPT)) {
-					user->encmethods = get_encrypt_methods(v->value);	
+				user->encmethods = get_encrypt_methods(v->value);
+				if (!ast_true(v->value)) {
+					ast_clear_flag(user, IAX_FORCE_ENCRYPT);
 				}
 			} else if (!strcasecmp(v->name, "forceencryption")) {
 				if (ast_true(v->value)) {
@@ -11374,9 +11376,10 @@
 		} else if (!strcasecmp(v->name, "authdebug")) {
 			authdebug = ast_true(v->value);
 		} else if (!strcasecmp(v->name, "encryption")) {
-			if (!ast_test_flag((&globalflags), IAX_FORCE_ENCRYPT)) {
-				iax2_encryption = get_encrypt_methods(v->value);	
-			}
+				iax2_encryption = get_encrypt_methods(v->value);
+				if (!ast_true(v->value)) {
+					ast_clear_flag((&globalflags), IAX_FORCE_ENCRYPT);
+				}	
 		} else if (!strcasecmp(v->name, "forceencryption")) {
 			if (ast_true(v->value)) {
 				ast_set_flag((&globalflags), IAX_FORCE_ENCRYPT);




More information about the asterisk-commits mailing list