[asterisk-commits] rmudgett: branch rmudgett/cel_accountcode r417662 - in /team/rmudgett/cel_acc...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jun 30 13:33:39 CDT 2014


Author: rmudgett
Date: Mon Jun 30 13:33:32 2014
New Revision: 417662

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=417662
Log:
accountcode: Override the outgoing channel's accountcode with the caller's when dialing.

Modified:
    team/rmudgett/cel_accountcode/UPGRADE.txt
    team/rmudgett/cel_accountcode/main/channel.c

Modified: team/rmudgett/cel_accountcode/UPGRADE.txt
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cel_accountcode/UPGRADE.txt?view=diff&rev=417662&r1=417661&r2=417662
==============================================================================
--- team/rmudgett/cel_accountcode/UPGRADE.txt (original)
+++ team/rmudgett/cel_accountcode/UPGRADE.txt Mon Jun 30 13:33:32 2014
@@ -24,16 +24,16 @@
 From 12.3.1 to 12.4.0:
 
  - The accountcode propagation is now consistently propagated to outgoing
-   channels before dialing.  In addition, if a channel already has an
-   accountcode then it will not be changed unless explicitly set by
-   CHANNEL(accountcode) or an originate method that can specify an
-   accountcode value.  The change has three visible effects.  One, if the
-   channel driver is configured with an accountcode for new channels then
-   those channels will always have that accountcode unless explicitly
-   changed.  Two, local channels now cross accountcode and peeraccount
-   across the special bridge between the ;1 and ;2 channels just like
-   channels between normal bridges.  Three, the CHANNEL(peeraccount) value
-   now can be set before Dial, FollowMe, and Queue to set an empty
+   channels before dialing.  The channel accountcode can change from its
+   original non-empty value on channel creation for the following specific
+   reasons.  One, dialplan sets it using CHANNEL(accountcode).  Two, an
+   originate method that can specify an accountcode value.  Three, the
+   calling channel propagates its peeraccount or accountcode to the
+   outgoing channel's accountcode before dialing.  The change has two
+   visible effects.  One, local channels now cross accountcode and
+   peeraccount across the special bridge between the ;1 and ;2 channels
+   just like channels between normal bridges.  Two, the CHANNEL(peeraccount)
+   value now can be set before Dial, FollowMe, and Queue to set the
    accountcode on the outgoing channel(s).  For Queue this now includes
    local channel members where the accountcodes are propagated early
    enough to be useful on the ;2 channel.

Modified: team/rmudgett/cel_accountcode/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cel_accountcode/main/channel.c?view=diff&rev=417662&r1=417661&r2=417662
==============================================================================
--- team/rmudgett/cel_accountcode/main/channel.c (original)
+++ team/rmudgett/cel_accountcode/main/channel.c Mon Jun 30 13:33:32 2014
@@ -6024,36 +6024,30 @@
 	switch (relationship) {
 	case AST_CHANNEL_REQUESTOR_BRIDGE_PEER:
 		/* Crossover the requestor's accountcode and peeraccount */
-		if (ast_strlen_zero(ast_channel_accountcode(chan))) {
-			/* The newly created channel does not have an accountcode. */
-			if (!ast_strlen_zero(ast_channel_peeraccount(requestor))) {
-				/*
-				 * Set it to the requestor's peeraccount.  This allows the
-				 * dialplan to indicate the accountcode to use when dialing
-				 * by setting CHANNEL(peeraccount).
-				 */
-				ast_channel_accountcode_set(chan, ast_channel_peeraccount(requestor));
-			} else if (!ast_strlen_zero(ast_channel_accountcode(requestor))) {
-				/*
-				 * Fallback to the historic propagation and set it to the
-				 * requestor's accountcode.
-				 */
-				ast_channel_accountcode_set(chan, ast_channel_accountcode(requestor));
-			}
-		}
-		if (ast_strlen_zero(ast_channel_peeraccount(chan))
-			&& !ast_strlen_zero(ast_channel_accountcode(requestor))) {
+		if (!ast_strlen_zero(ast_channel_peeraccount(requestor))) {
+			/*
+			 * Set it to the requestor's peeraccount.  This allows the
+			 * dialplan to indicate the accountcode to use when dialing
+			 * by setting CHANNEL(peeraccount).
+			 */
+			ast_channel_accountcode_set(chan, ast_channel_peeraccount(requestor));
+		} else if (!ast_strlen_zero(ast_channel_accountcode(requestor))) {
+			/*
+			 * Fallback to the historic propagation and set it to the
+			 * requestor's accountcode.
+			 */
+			ast_channel_accountcode_set(chan, ast_channel_accountcode(requestor));
+		}
+		if (!ast_strlen_zero(ast_channel_accountcode(requestor))) {
 			ast_channel_peeraccount_set(chan, ast_channel_accountcode(requestor));
 		}
 		break;
 	case AST_CHANNEL_REQUESTOR_REPLACEMENT:
 		/* Pass the requestor's accountcode and peeraccount straight. */
-		if (ast_strlen_zero(ast_channel_accountcode(chan))
-			&& !ast_strlen_zero(ast_channel_accountcode(requestor))) {
+		if (!ast_strlen_zero(ast_channel_accountcode(requestor))) {
 			ast_channel_accountcode_set(chan, ast_channel_accountcode(requestor));
 		}
-		if (ast_strlen_zero(ast_channel_peeraccount(chan))
-			&& !ast_strlen_zero(ast_channel_peeraccount(requestor))) {
+		if (!ast_strlen_zero(ast_channel_peeraccount(requestor))) {
 			ast_channel_peeraccount_set(chan, ast_channel_peeraccount(requestor));
 		}
 		break;




More information about the asterisk-commits mailing list