[asterisk-commits] bmd: branch group/newcdr r119078 - /team/group/newcdr/main/channel.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu May 29 16:04:27 CDT 2008


Author: bmd
Date: Thu May 29 16:04:26 2008
New Revision: 119078

URL: http://svn.digium.com/view/asterisk?view=rev&rev=119078
Log:
make accountcode/peeraccount propagation a bit more aggressive.  This fixes mismatch issues in directed pickup.

Modified:
    team/group/newcdr/main/channel.c

Modified: team/group/newcdr/main/channel.c
URL: http://svn.digium.com/view/asterisk/team/group/newcdr/main/channel.c?view=diff&rev=119078&r1=119077&r2=119078
==============================================================================
--- team/group/newcdr/main/channel.c (original)
+++ team/group/newcdr/main/channel.c Thu May 29 16:04:26 2008
@@ -3955,15 +3955,25 @@
 				chan2->accountcode, chan1->name, chan2->name);
 		ast_string_field_set(chan1, peeraccount, chan2->accountcode);
 	}
-	if (chan2 && !ast_strlen_zero(chan1->peeraccount) && ast_strlen_zero(chan2->accountcode)) {
+	if (!ast_strlen_zero(chan1->peeraccount) && ast_strlen_zero(chan2->accountcode)) {
 		ast_log(LOG_DEBUG, "setting accountcode to %s for %s from data on channel %s\n",
 				chan1->peeraccount, chan2->name, chan1->name);
 		ast_string_field_set(chan1, accountcode, chan1->peeraccount);
 	}
-	if (chan1 && !ast_strlen_zero(chan2->peeraccount) && ast_strlen_zero(chan1->accountcode)) {
+	if (!ast_strlen_zero(chan2->peeraccount) && ast_strlen_zero(chan1->accountcode)) {
 		ast_log(LOG_DEBUG, "setting accountcode to %s for %s from data on channel %s\n",
 				chan2->peeraccount, chan1->name, chan2->name);
 		ast_string_field_set(chan1, accountcode, chan2->peeraccount);
+	}
+	if (0 != strcmp(chan1->accountcode, chan2->peeraccount)) {
+		ast_log(LOG_DEBUG, "changing peeraccount from %s to %s on %s to match channel %s\n",
+				chan2->peeraccount, chan1->peeraccount, chan2->name, chan1->name);
+		ast_string_field_set(chan2, peeraccount, chan1->accountcode);
+	}
+	if (0 != strcmp(chan2->accountcode, chan1->peeraccount)) {
+		ast_log(LOG_DEBUG, "changing peeraccount from %s to %s on %s to match channel %s\n",
+				chan1->peeraccount, chan2->peeraccount, chan1->name, chan2->name);
+		ast_string_field_set(chan1, peeraccount, chan2->accountcode);
 	}
 }
 




More information about the asterisk-commits mailing list