Fix copying of CDR(accountcode) to local channels.
authorWalter Doekes <walter+asterisk@wjd.nu>
Wed, 29 Feb 2012 19:48:33 +0000 (19:48 +0000)
committerWalter Doekes <walter+asterisk@wjd.nu>
Wed, 29 Feb 2012 19:48:33 +0000 (19:48 +0000)
In r203638, during the addition of the Channel Event Logging, in mid-2009, this
got broken in trunk and ended up in asterisk 1.8 and higher. This fixes so the
CDR(accountcode) from the calling channel is available to dialed channels again
as well as showing up properly in the CDR's.

(closes issue ASTERISK-19384)
Reported by: jamicque
Patches: accountcode.patch (License #6033) by jamicque
Review: https://reviewboard.asterisk.org/r/1775/
Reviewed by: Richard Mudgett
........

Merged revisions 357575 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 357576 from http://svn.asterisk.org/svn/asterisk/branches/10

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357577 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_dial.c

index d12ea9c..d2e9e6f 100644 (file)
@@ -2313,10 +2313,11 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast
                ast_channel_dialed(tc)->transit_network_select = ast_channel_dialed(chan)->transit_network_select;
 
                if (!ast_strlen_zero(ast_channel_accountcode(chan))) {
-                       ast_channel_peeraccount_set(tc, ast_channel_accountcode(chan));
+                       ast_channel_accountcode_set(tc, ast_channel_accountcode(chan));
                }
-               if (ast_strlen_zero(ast_channel_musicclass(tc)))
+               if (ast_strlen_zero(ast_channel_musicclass(tc))) {
                        ast_channel_musicclass_set(tc, ast_channel_musicclass(chan));
+               }
 
                /* Pass ADSI CPE and transfer capability */
                ast_channel_adsicpe_set(tc, ast_channel_adsicpe(chan));