[asterisk-dev] [Code Review]: A name/value list mechanism for raising events.

Mark Michelson reviewboard at asterisk.org
Wed Dec 19 14:13:38 CST 2012



> On Dec. 18, 2012, 1:09 p.m., Russell Bryant wrote:
> > I'm sure this was considered, but I'm curious why main/event.c, include/asterisk/event.h isn't sufficient.

Unfortunately there's not a public JIRA issue to point you to, but let let me try to address this.

The goal here is to make it so that AMI events are raised not with a big string as currently done but rather with a series of key/value pairs. This is the first step in that process, which is just to define a key/value pair system and create a means of turning a set of these into an AMI event. Subsequent related reviews you are likely to see will involve converting existing AMI events to use this system. You'll also see this tie into a general effort for Asterisk 12 to improve APIs.

The event system is fantastic, but as far as making a general mechanism for converting AMI events into key/value pairs, it's not a feasible method. I can tell you from experience that I once attempted to convert all the manager events in app_queue into ast_events, and it was pretty brutal. The problem with the event system as-is is its binary nature. A key/value pair object is simpler and more generic, so it lends itself easier to converting AMI events.

I'd expect that as this process continues, you'll see some chunks of code either get factored away altogether or merged in with currently-existing APIs. So for instance, this key/value pair object may end up being defined as a type the event system will understand, or this may get rolled entirely into the event system, or something similar.


- Mark


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


On Dec. 18, 2012, 12:28 p.m., Brent Eagles wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2248/
> -----------------------------------------------------------
> 
> (Updated Dec. 18, 2012, 12:28 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> This patch includes an initial crack at a mechanism for creating events through collections of named/value pairs. It also contains some non-heavily-tested code for publishing the name/value pairs as an AMI event. 
> 
> 
> Diffs
> -----
> 
>   /trunk/tests/test_nvevent.c PRE-CREATION 
>   /trunk/include/asterisk/nvevent.h PRE-CREATION 
>   /trunk/main/nvevent.c PRE-CREATION 
> 
> Diff: https://reviewboard.asterisk.org/r/2248/diff
> 
> 
> Testing
> -------
> 
> Unit test in test_nvevent.c
> 
> 
> Thanks,
> 
> Brent
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20121219/26d77993/attachment.htm>


More information about the asterisk-dev mailing list