[asterisk-dev] [Code Review] 4365: Adding AMQP backend for CDR and CEL
Joshua Colp
reviewboard at asterisk.org
Wed Feb 4 08:21:49 CST 2015
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/4365/#review14407
-----------------------------------------------------------
/branches/13/cdr/cdr_amqp.c
<https://reviewboard.asterisk.org/r/4365/#comment24918>
Default is no.
/branches/13/cdr/cdr_amqp.c
<https://reviewboard.asterisk.org/r/4365/#comment24921>
If you do the pre_apply_config callback as I mention below I don't think it would ever be possible for configuration, global, or amqp to not exist if this callback is invoked.
/branches/13/cdr/cdr_amqp.c
<https://reviewboard.asterisk.org/r/4365/#comment24919>
This should happen in a pre_apply_config. As it's written another thread may get the global settings and try to use the amqp while you are refreshing it.
You can also do a check for global there to ensure the new configuration is valid before applying it.
/branches/13/cel/cel_amqp.c
<https://reviewboard.asterisk.org/r/4365/#comment24923>
Same comment as CDR.
/branches/13/cel/cel_amqp.c
<https://reviewboard.asterisk.org/r/4365/#comment24920>
Same finding as CDR. pre_apply_config callback.
/branches/13/include/asterisk/cel.h
<https://reviewboard.asterisk.org/r/4365/#comment24925>
Why were these added here?
/branches/13/res/amqp/config.c
<https://reviewboard.asterisk.org/r/4365/#comment24926>
Since this is an explicit object creation the config options core will call aco_set_defaults automatically on the object you return.
/branches/13/res/amqp/config.c
<https://reviewboard.asterisk.org/r/4365/#comment24927>
This should be done in the pre_apply_config callback so the configuration is completely validated before doing the atomic swap.
As well - should connection validation failure cause the config to not get applied in that case?
- Joshua Colp
On Jan. 26, 2015, 3:16 p.m., David Lee wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/4365/
> -----------------------------------------------------------
>
> (Updated Jan. 26, 2015, 3:16 p.m.)
>
>
> Review request for Asterisk Developers.
>
>
> Repository: Asterisk
>
>
> Description
> -------
>
> This patch adds an AMQP backend for both CDR and CEL. This allows these
> logs to be dispatched to a message broker, such as RabbitMQ, where they
> can reliably be queued for transmission to the handling application.
>
> The res_amqp module adds core AMQP protocol support. The provided API
> only supports publishing, since that's all that's needed for CDR/CEL.
> The AMQP feature of supporting multiple 'channels' per connection was
> also omitted. The underlying librabbitmq library is not thread safe, so
> the multiplexing benefits are limited. It also makes using the library
> more complicated, since clients have to worry about both connections and
> channels.
>
> The cdr_amqp module simply registers a CDR backend which encodes CDRs as
> JSON, and publishes them to an AMQP connection.
>
> The cel_amqp module similarly registers a CEL backend, which encodes
> CELs as JSON, and publishes them to an AMQP connection.
>
>
> Diffs
> -----
>
> /branches/13/res/res_amqp.exports.in PRE-CREATION
> /branches/13/res/res_amqp.c PRE-CREATION
> /branches/13/res/amqp/internal.h PRE-CREATION
> /branches/13/res/amqp/config.c PRE-CREATION
> /branches/13/res/amqp/cli.c PRE-CREATION
> /branches/13/res/Makefile 431095
> /branches/13/makeopts.in 431095
> /branches/13/include/asterisk/cel.h 431095
> /branches/13/include/asterisk/autoconfig.h.in 431095
> /branches/13/include/asterisk/amqp.h PRE-CREATION
> /branches/13/contrib/scripts/install_prereq 431095
> /branches/13/configure.ac 431095
> /branches/13/configs/samples/cel_amqp.conf.sample PRE-CREATION
> /branches/13/configs/samples/cdr_amqp.conf.sample PRE-CREATION
> /branches/13/configs/samples/amqp.conf.sample PRE-CREATION
> /branches/13/cel/cel_amqp.c PRE-CREATION
> /branches/13/cdr/cdr_amqp.c PRE-CREATION
> /branches/13/build_tools/menuselect-deps.in 431095
>
> Diff: https://reviewboard.asterisk.org/r/4365/diff/
>
>
> Testing
> -------
>
> Ran amqp-consume to print messages sent to queues.
>
> Confirmed that the amqp test command sent messages properly.
>
> Confirmed that CDRs were properly sent.
>
> Confirmed that CELs were properly sent.
>
>
> Thanks,
>
> David Lee
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20150204/0cfcc1bf/attachment-0001.html>
More information about the asterisk-dev
mailing list