[asterisk-dev] [Code Review] 2486: Rework CDRs for Asterisk 12

opticron reviewboard at asterisk.org
Wed May 22 15:28:00 CDT 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2486/#review8692
-----------------------------------------------------------



/team/group/bridge_construction/CHANGES
<https://reviewboard.asterisk.org/r/2486/#comment17045>

    This seems to have been duplicated from below.



/team/group/bridge_construction/CHANGES
<https://reviewboard.asterisk.org/r/2486/#comment17047>

    Also duplicated from below.  There are additional portions of CHANGES that seem to have been pulled into this diff that are already in trunk (Channel Drivers, chan_local, chan_mobile, chan_sip).



/team/group/bridge_construction/apps/app_dial.c
<https://reviewboard.asterisk.org/r/2486/#comment17048>

    This comment could use a tweak.



/team/group/bridge_construction/cdr/cdr_odbc.c
<https://reviewboard.asterisk.org/r/2486/#comment17050>

    This is only used within the scope of the first branch of the if.



/team/group/bridge_construction/main/manager_channels.c
<https://reviewboard.asterisk.org/r/2486/#comment17051>

    Merge conflict. These now exist in manager.c/h.



/team/group/bridge_construction/tests/test_cdr.c
<https://reviewboard.asterisk.org/r/2486/#comment17052>

    Use ast_channel_publish_state().


It looks like most of the Dial End BUGBUGs can be taken care of now.

- opticron


On May 16, 2013, 7:17 p.m., Matt Jordan wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2486/
> -----------------------------------------------------------
> 
> (Updated May 16, 2013, 7:17 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Bugs: ASTERISK-21196
>     https://issues.asterisk.org/jira/browse/ASTERISK-21196
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> Sorry for e-mail spam folks, but apparently Review Board chocked on the last posting. Hopefully this one takes.
> 
> This patch reworks CDRs for Asterisk 12. For more information on why and what the records should look like, please view the specification on the wiki: https://wiki.asterisk.org/wiki/display/AST/Asterisk+12+CDR+Specification
> 
> Since the Bridge API migration resulted in all CDR code in features.c no longer being applicable, and the model of masquerades during transfers now no longer occurs (mostly), the vast majority of complex CDR code sprinkled throughout Asterisk was either wrong, or would never be executed. Rather than piling the CDR code back into the Bridging API, this patch instead builds CDRs off of messages received over the Stasis-Core message bus. However, as a result, all direct manipulation of CDRs by channel drivers, applications, and the Asterisk core is now highly suspect and most likely null and void.
> 
> This patch rips most of the existing code out.
> 
> Messages received over Stasis-Core are first dispatched by top level message handlers. The handlers job is to (a) find the CDRs that are affected by the message, (b) dispatch the message to the CDRs, and (c) based on the statuses, determine if more CDRs are needed.
> 
> Each CDR has a virtual table that determines what effect the message has on it. Depending on the state of the CDR, the message may be dropped; invalid; or it may alter the state of the CDR. CDRs transition states when they need to, and the top level message handlers generally don't care what state the CDR is in.
> 
> CDRs exist in a chain. As a channel does stuff, additional CDRs may be appended to the chain, and there may be multiple active CDRs at any given moment in time.
> 
> As a result of all of this, ForkCDR, NoCDR, and ResetCDR have essentially been rewritten and simplified greatly. The need for ForkCDR is significantly less, as additional CDRs are created between all pairs of channels in multi-party and transfer situations.
> 
> A new CDR function, CDR_PROP, has been added that lets the dialplan override who is the Party A when two channels enter into a bridge together. This function also lets you disable/re-enable CDRs on a channel, which precludes the need for NoCDR and one of ResetCDR's options.
> 
> Finally, a set of unit tests have been written that cover the existing functionality.
> 
> This patch is not complete - there is still some additional work to do and testing to perform. The following needs to be covered under subsequent reviews:
> * Linkedid propagation. As CEL will need this as well, this will most likely become a core concept (if possible)
> * Park. A unit test exists for this, however, the holding bridge is not yet handled properly. This is rather trivial, as most of the Bridge state logic simply needs to be avoided if a holding bridge is entered.
> * Call Pickup. We need the Stasis Message for this before this can be completed.
> * Attended transfers into an application. We need the Stasis Message for this too.
> * Quite a few BUGBUG comments in app_queue (which needs the Dial messages - see ASTERISK-21551) and the media channel (see ASTERISK-21713)
> 
> Hopefully, this patch is far enough along that the approach can be verified and major bugs can be commented on. Ideally, this would go into bridge_construction so that the Test Suite running against it can be updated.
> 
> A few open questions:
> * What do we want to do with peeraccount? In general, this property on the channel needs to be set by the bridging API, but much like the BRIDGEPEER channel variable, has issues in reasonably complex scenarios. Right now, the peeraccount is passed through the CDRs by virtue of the CDR engine knowing who the channel is bridged with, but inspecting this value through a function becomes problematic since we can't return a single value in multi-party bridges. CEL will also need an answer to this question. (There is also some bridging logic that applies a channel's accountcode to who its bridged with if the other channel doesn't have an accountcode; this does need to be performed by the bridging layer)
> * There is certainly room for debate with where the userfield, accountcode, and amaflags should live. Currently that is CDR, channel, channel. The channel userfield is generally unused. These could all be combined; however, that forces some parity between CEL userfield and CDR userfield that didn't used to exist.
> 
> 
> Diffs
> -----
> 
>   /team/group/bridge_construction/CHANGES 388938 
>   /team/group/bridge_construction/UPGRADE.txt 388938 
>   /team/group/bridge_construction/addons/cdr_mysql.c 388938 
>   /team/group/bridge_construction/addons/chan_ooh323.c 388938 
>   /team/group/bridge_construction/apps/app_authenticate.c 388938 
>   /team/group/bridge_construction/apps/app_cdr.c 388938 
>   /team/group/bridge_construction/apps/app_dial.c 388938 
>   /team/group/bridge_construction/apps/app_disa.c 388938 
>   /team/group/bridge_construction/apps/app_dumpchan.c 388938 
>   /team/group/bridge_construction/apps/app_followme.c 388938 
>   /team/group/bridge_construction/apps/app_forkcdr.c 388938 
>   /team/group/bridge_construction/apps/app_osplookup.c 388938 
>   /team/group/bridge_construction/apps/app_queue.c 388938 
>   /team/group/bridge_construction/bridges/bridge_softmix.c 388938 
>   /team/group/bridge_construction/cdr/cdr_adaptive_odbc.c 388938 
>   /team/group/bridge_construction/cdr/cdr_csv.c 388938 
>   /team/group/bridge_construction/cdr/cdr_custom.c 388938 
>   /team/group/bridge_construction/cdr/cdr_manager.c 388938 
>   /team/group/bridge_construction/cdr/cdr_odbc.c 388938 
>   /team/group/bridge_construction/cdr/cdr_pgsql.c 388938 
>   /team/group/bridge_construction/cdr/cdr_radius.c 388938 
>   /team/group/bridge_construction/cdr/cdr_syslog.c 388938 
>   /team/group/bridge_construction/cdr/cdr_tds.c 388938 
>   /team/group/bridge_construction/cel/cel_manager.c 388938 
>   /team/group/bridge_construction/cel/cel_radius.c 388938 
>   /team/group/bridge_construction/cel/cel_tds.c 388938 
>   /team/group/bridge_construction/channels/chan_agent.c 388938 
>   /team/group/bridge_construction/channels/chan_dahdi.c 388938 
>   /team/group/bridge_construction/channels/chan_h323.c 388938 
>   /team/group/bridge_construction/channels/chan_iax2.c 388938 
>   /team/group/bridge_construction/channels/chan_mgcp.c 388938 
>   /team/group/bridge_construction/channels/chan_sip.c 388938 
>   /team/group/bridge_construction/channels/chan_skinny.c 388938 
>   /team/group/bridge_construction/channels/chan_unistim.c 388938 
>   /team/group/bridge_construction/funcs/func_callerid.c 388938 
>   /team/group/bridge_construction/funcs/func_cdr.c 388938 
>   /team/group/bridge_construction/funcs/func_channel.c 388938 
>   /team/group/bridge_construction/include/asterisk/cdr.h 388938 
>   /team/group/bridge_construction/include/asterisk/cel.h 388938 
>   /team/group/bridge_construction/include/asterisk/channel.h 388938 
>   /team/group/bridge_construction/include/asterisk/config_options.h 388938 
>   /team/group/bridge_construction/include/asterisk/stasis_channels.h 388938 
>   /team/group/bridge_construction/include/asterisk/strings.h 388938 
>   /team/group/bridge_construction/include/asterisk/test.h 388938 
>   /team/group/bridge_construction/include/asterisk/time.h 388938 
>   /team/group/bridge_construction/main/asterisk.c 388938 
>   /team/group/bridge_construction/main/bridging.c 388938 
>   /team/group/bridge_construction/main/cdr.c 388938 
>   /team/group/bridge_construction/main/cel.c 388938 
>   /team/group/bridge_construction/main/channel.c 388938 
>   /team/group/bridge_construction/main/channel_internal_api.c 388938 
>   /team/group/bridge_construction/main/cli.c 388938 
>   /team/group/bridge_construction/main/config_options.c 388938 
>   /team/group/bridge_construction/main/features.c 388938 
>   /team/group/bridge_construction/main/manager.c 388938 
>   /team/group/bridge_construction/main/manager_channels.c 388938 
>   /team/group/bridge_construction/main/pbx.c 388938 
>   /team/group/bridge_construction/main/stasis_channels.c 388938 
>   /team/group/bridge_construction/main/test.c 388938 
>   /team/group/bridge_construction/main/utils.c 388938 
>   /team/group/bridge_construction/res/res_agi.c 388938 
>   /team/group/bridge_construction/res/res_config_sqlite.c 388938 
>   /team/group/bridge_construction/res/res_monitor.c 388938 
>   /team/group/bridge_construction/res/res_stasis_answer.c 388938 
>   /team/group/bridge_construction/tests/test_cdr.c PRE-CREATION 
> 
> Diff: https://reviewboard.asterisk.org/r/2486/diff/
> 
> 
> Testing
> -------
> 
> Unit testing
> 
> 
> Thanks,
> 
> Matt Jordan
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20130522/fb7b9e73/attachment-0001.htm>


More information about the asterisk-dev mailing list