[asterisk-dev] [Code Review] 2579: Add vtable and methods for to_json and to_ami for Stasis messages
David Lee
reviewboard at asterisk.org
Tue Jun 4 13:00:41 CDT 2013
> On May 31, 2013, 2:20 p.m., Matt Jordan wrote:
> > /trunk/main/stasis_channels.c, lines 39-55
> > <https://reviewboard.asterisk.org/r/2579/diff/1/?file=38865#file38865line39>
> >
> > Shouldn't this go in manager_channels.c?
> >
> > At the point the documentation is no longer associated with the raising of the message, it feels like it could be with all of the other documentation blobs.
I really think the documentation for the event belongs as close to the event as it can get. If it's going to be in a different file, then it should be in a .xml file somewhere so there's at least a chance that the editor can validate syntax, or even the schema.
Ideally I'd like it to go right above the ast_manager_event_blob_create, but my attempts at editing the get_documentation scripts to do so all failed.
- David
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2579/#review8744
-----------------------------------------------------------
On May 30, 2013, 10:42 p.m., David Lee wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2579/
> -----------------------------------------------------------
>
> (Updated May 30, 2013, 10:42 p.m.)
>
>
> Review request for Asterisk Developers, Matt Jordan and Jason Parker.
>
>
> Bugs: ASTERISK-21817
> https://issues.asterisk.org/jira/browse/ASTERISK-21817
>
>
> Repository: Asterisk
>
>
> Description
> -------
>
> When a Stasis message type is defined in a loadable module, handling
> those messages for AMI and res_stasis events can be cumbersome.
>
> This patch adds a vtable to stasis_message_type, with to_ami and
> to_json virtual functions. These allow messages to be handled
> abstractly without putting module-specific code in core.
>
> As an example, the VarSet AMI event was refactored to use the to_ami
> virtual function.
>
> Additionally, I finally got tired of the boilerplate incrementing AO2
> refcounts, so I added an ao2_ref1() macro, which is NULL safe and
> returns the object.
>
>
> Diffs
> -----
>
> /trunk/apps/confbridge/confbridge_manager.c 390151
> /trunk/include/asterisk/astobj2.h 390151
> /trunk/include/asterisk/manager.h 390151
> /trunk/include/asterisk/stasis.h 390151
> /trunk/main/manager.c 390151
> /trunk/main/manager_channels.c 390151
> /trunk/main/parking.c 390151
> /trunk/main/stasis_channels.c 390151
> /trunk/main/stasis_message.c 390151
> /trunk/tests/test_astobj2.c 390151
> /trunk/tests/test_stasis.c 390151
> /trunk/tests/test_stasis_channels.c 390151
>
> Diff: https://reviewboard.asterisk.org/r/2579/diff/
>
>
> Testing
> -------
>
> Unit tests.
>
> Verified that the VarSet event still looked the way it ought to.
>
>
> Thanks,
>
> David Lee
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20130604/65fd6418/attachment-0001.htm>
More information about the asterisk-dev
mailing list