Review Board 1.7.16


accountcode: Slightly change accountcode propagation.

Review Request #3601 - Created June 6, 2014 and submitted

rmudgett
trunk
AFS-65
Reviewers
asterisk-dev
Asterisk
Accountcode propagation:

The current behavior is to simply set the accountcode of an outgoing
channel to the accountcode of the channel initiating the call.  It was
done this way a long time ago to allow the accountcode set on the SIP/100
channel to be propagated to a local channel so the dialplan execution on
the Local;2 channel would have the SIP/100 accountcode available.

SIP/100 -> Local;1/Local;2 -> SIP/200

Propagating the SIP/100 accountcode to the local channels is very useful.
Without any dialplan manipulation, all channels in this call would have
the same accountcode.

Using dialplan, you can set a different accountcode on the SIP/200 channel
either by setting the accountcode on the Local;2 channel or by the Dial
application's b(pre-dial), M(macro) or U(gosub) options, or by the
FollowMe application's b(pre-dial) option, or by the Queue application's
macro or gosub options.  Before Asterisk v12, the altered accountcode on
SIP/200 will remain until the local channels optimize out and the
accountcode would change to the SIP/100 accountcode.

Asterisk v1.8 attempted to add peeraccount support but ultimately had to
punt on the support.  The peeraccount support was rendered useless because
of how the CDR code needed to unconditionally force the caller's
accountcode onto the peer channel's accountcode.  The CEL events were thus
intentionally made to always use the channel's accountcode as the
peeraccount value.

With the arrival of Asterisk v12, the situation has improved somewhat so
peeraccount support can be made to work.  Using the indicated example, the
the accountcode values become as follows when the peeraccount is set on
SIP/100 before calling SIP/200:

SIP/100 ---> Local;1 ---- Local;2 ---> SIP/200
acct: 100 \/ acct: 200 \/ acct: 100 \/ acct: 200
peer: 200 /\ peer: 100 /\ peer: 200 /\ peer: 100

If a channel already has an accountcode it can only change by the
following explicit user actions:

1) A channel originate method that can specify an accountcode to use.

2) The calling channel propagating its non-empty peeraccount or its
non-empty accountcode if the peeraccount was empty to the outgoing
channel's accountcode before initiating the dial.  e.g., Dial and
FollowMe.  The exception to this propagation method is Queue.  Queue will
only propagate peeraccounts this way only if the outgoing channel does not
have an accountcode.

3) Dialplan using CHANNEL(accountcode).

4) Dialplan using CHANNEL(peeraccount) on the other end of a local
channel pair.

If a channel does not have an accountcode it can get one from the
following places:

1) The channel driver's configuration at channel creation.

2) Explicit user action as already indicated.

3) Entering a basic or stasis-mixing bridge from a peer channel's
peeraccount value.

You can specify the accountcode for an outgoing channel by setting the
CHANNEL(peeraccount) before using the Dial, FollowMe, and Queue
applications.  Queue adds the wrinkle that it will not overwrite an
existing accountcode on the outgoing channel with the calling channels
values.

Accountcode and peeraccount values propagate to an outgoing channel before
dialing.  Accountcodes also propagate when channels enter or leave a basic
or stasis-mixing bridge.  The peeraccount value only makes sense for
mixing bridges with two channels; it is meaningless otherwise.

* Made peeraccount functional by changing accountcode propagation as
described above.

* Fixed CEL extracting the wrong ie value for the peeraccount.  This was
done intentionally in Asterisk v1.8 when that version had to punt on
peeraccount.

* Fixed a few places dealing with accountcodes that were reading from
channels without the lock held.
* Ran tests from https://reviewboard.asterisk.org/r/3832/ all tests tagged
with accountcode pass.

* Set the accountcode on the calling channel and let the channel driver
supply or not the accountcode for the outgoing channel.  The acccountcode
on the calling channel forces itself on the outgoing channel.  This is the
same as previous behavior.

* Set the accountcode and peeraccount code on the calling channel and let
the channel driver supply or not the acccountcode for the outgoing
channel.  The outgoing channel's accountcode and peeraccount got the
calling channel's peeraccount and accountcode values respectively.

* Let dialplan set accountcodes on channels and performed a DTMF attended
transfer to create a three party bridge.  When the transferrer channel
left the three party bridge, the remaining two channels got the
peeraccount updated to the other party.  Unfortunately, you only see the
updated peeraccount values in the CEL log when the channels leave the
bridge.

Throughout each of these tests, the CEL log had the expected peeraccount
value.  Some interpolation is needed in the CEL log for complicated
accountcode manipulation because there aren't enough events to indicate
when the account codes change.  Note the peeraccount value is meaningless
if the bridge does not contain two parties.
/trunk/CHANGES
Diff Revision 5 Diff Revision 6
[20] 31 lines
[+20]
32
   unless explicitly set by CHANNEL(accountcode).  The change has three
32
   unless explicitly set by CHANNEL(accountcode).  The change has three
33
   visible effects.  One, local channels now cross accountcode and
33
   visible effects.  One, local channels now cross accountcode and
34
   peeraccount across the special bridge between the ;1 and ;2 channels
34
   peeraccount across the special bridge between the ;1 and ;2 channels
35
   just like channels between normal bridges.  Two, the queue member will
35
   just like channels between normal bridges.  Two, the queue member will
36
   get an accountcode if it doesn't have one and one is available from the
36
   get an accountcode if it doesn't have one and one is available from the
37
   calling channel's peeraccount or accountcode.  Three, accountcode
37
   calling channel's peeraccount.  Three, accountcode propagation includes
38
   propagation includes local channel members where the accountcodes are
38
   local channel members where the accountcodes are propagated early
39
   propagated early enough to be available on the ;2 channel.
39
   enough to be available on the ;2 channel.
40

    
   
40

   
41
app_dahdibarge
41
app_dahdibarge
42
------------------
42
------------------
43
 * This module was deprecated and has been removed. Users of app_dahdibarge
43
 * This module was deprecated and has been removed. Users of app_dahdibarge
44
   should use ChanSpy instead.
44
   should use ChanSpy instead.
[+20] [20] 21 lines
[+20]
66
   'dialplan remove extension' CLI commands respectively.
66
   'dialplan remove extension' CLI commands respectively.
67

    
   
67

   
68
 * New AMI action LoggerRotate reloads and rotates logger in the same manner
68
 * New AMI action LoggerRotate reloads and rotates logger in the same manner
69
   as CLI command 'logger rotate'
69
   as CLI command 'logger rotate'
70

    
   
70

   

    
   
71
 * New AMI Actions FAXSessions, FAXSession, and FAXStats replicate the

    
   
72
   functionality of CLI commands 'fax show sessions', 'fax show session',

    
   
73
   and fax show stats' respectively.

    
   
74

   
71
 * New AMI actions PRIDebugSet, PRIDebugFileSet, and PRIDebugFileUnset
75
 * New AMI actions PRIDebugSet, PRIDebugFileSet, and PRIDebugFileUnset
72
   enable manager control over PRI debugging levels and file output.
76
   enable manager control over PRI debugging levels and file output.
73

    
   
77

   
74
cdr_sqlite
78
cdr_sqlite
75
-----------------
79
-----------------
76
 * This module was deprecated and has been removed. Users of cdr_sqlite
80
 * This module was deprecated and has been removed. Users of cdr_sqlite
77
   should use cdr_sqlite3_custom.
81
   should use cdr_sqlite3_custom.
78

    
   
82

   

    
   
83
cdr_pgsql

    
   
84
------------------

    
   
85
 * Added the ability to support PostgreSQL application_name on connections.

    
   
86
   This allows PostgreSQL to display the configured name in the

    
   
87
   pg_stat_activity view and CSV log entries. This setting is configurable

    
   
88
   for cdr_pgsql via the appname configuration setting in cdr_pgsql.conf.

    
   
89

   

    
   
90
cel_pgsql

    
   
91
------------------

    
   
92
 * Added the ability to support PostgreSQL application_name on connections.

    
   
93
   This allows PostgreSQL to display the configured name in the

    
   
94
   pg_stat_activity view and CSV log entries. This setting is configurable

    
   
95
   for cel_pgsql via the appname configuration setting in cel_pgsql.conf.

    
   
96

   
79
CEL
97
CEL
80
------------------
98
------------------
81
 * The "bridge_technology" extra field key has been added to BRIDGE_ENTER
99
 * The "bridge_technology" extra field key has been added to BRIDGE_ENTER
82
   and BRIDGE_EXIT events.
100
   and BRIDGE_EXIT events.
83

    
   
101

   
[+20] [20] 96 lines
[+20]
180
   - jb-ni: article ni
198
   - jb-ni: article ni
181
   - jb-ga: article ga
199
   - jb-ga: article ga
182
   - jb-wa: article wa
200
   - jb-wa: article wa
183
   - jb-wo: article wo
201
   - jb-wo: article wo
184

    
   
202

   

    
   
203
res_config_pgsql

    
   
204
------------------

    
   
205
 * Added the ability to support PostgreSQL application_name on connections.

    
   
206
   This allows PostgreSQL to display the configured name in the

    
   
207
   pg_stat_activity view and CSV log entries. This setting is configurable

    
   
208
   for res_config_pgsql via the dbappname configuration setting in

    
   
209
   res_pgsql.conf.

    
   
210

   

    
   
211
------------------------------------------------------------------------------

    
   
212
--- Functionality changes from Asterisk 12.4.0 to Asterisk 12.5.0 ------------

    
   
213
------------------------------------------------------------------------------

    
   
214

   

    
   
215
ARI

    
   
216
------------------

    
   
217
 * Stored recordings now support a new operation, copy. This will take an

    
   
218
   existing stored recording and copy it to a new location in the recordings

    
   
219
   directory.

    
   
220

   

    
   
221
res_pjsip

    
   
222
------------------

    
   
223
 * The endpoint configuration object now supports 'accountcode'. Any channel

    
   
224
   created for an endpoint with this setting will have its accountcode set

    
   
225
   to the specified value.

    
   
226

   

    
   
227
Functions

    
   
228
------------------

    
   
229
 * Function AUDIOHOOK_INHERIT has been deprecated. Audiohooks are now

    
   
230
   unconditionally inhereted through masquerades. As a side benefit, more

    
   
231
   than one audiohook of a given type may persist through a masquerade now.

    
   
232

   
185
------------------------------------------------------------------------------
233
------------------------------------------------------------------------------
186
--- Functionality changes from Asterisk 12.3.0 to Asterisk 12.4.0 ------------
234
--- Functionality changes from Asterisk 12.3.0 to Asterisk 12.4.0 ------------
187
------------------------------------------------------------------------------
235
------------------------------------------------------------------------------
188

    
   
236

   
189
AgentRequest
237
AgentRequest
[+20] [20] 4206 lines
/trunk/UPGRADE.txt
Diff Revision 5 Diff Revision 6
 
/trunk/apps/app_dial.c
Diff Revision 5 Diff Revision 6
 
/trunk/apps/app_followme.c
Diff Revision 5 Diff Revision 6
 
/trunk/apps/app_queue.c
Diff Revision 5 Diff Revision 6
 
/trunk/include/asterisk/channel.h
Diff Revision 5 Diff Revision 6
 
/trunk/main/bridge.c
Diff Revision 5 Diff Revision 6
 
/trunk/main/bridge_basic.c
Diff Revision 5 Diff Revision 6
 
/trunk/main/cel.c
Diff Revision 5 Diff Revision 6
 
/trunk/main/channel.c
Diff Revision 5 Diff Revision 6
 
/trunk/main/core_unreal.c
Diff Revision 5 Diff Revision 6
 
/trunk/main/dial.c
Diff Revision 5 Diff Revision 6
 
/trunk/main/pbx.c
Diff Revision 5 Diff Revision 6
 
/trunk/res/parking/parking_bridge_features.c
Diff Revision 5 Diff Revision 6
 
  1. /trunk/CHANGES: Loading...
  2. /trunk/UPGRADE.txt: Loading...
  3. /trunk/apps/app_dial.c: Loading...
  4. /trunk/apps/app_followme.c: Loading...
  5. /trunk/apps/app_queue.c: Loading...
  6. /trunk/include/asterisk/channel.h: Loading...
  7. /trunk/main/bridge.c: Loading...
  8. /trunk/main/bridge_basic.c: Loading...
  9. /trunk/main/cel.c: Loading...
  10. /trunk/main/channel.c: Loading...
  11. /trunk/main/core_unreal.c: Loading...
  12. /trunk/main/dial.c: Loading...
  13. /trunk/main/pbx.c: Loading...
  14. /trunk/res/parking/parking_bridge_features.c: Loading...

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.