[asterisk-dev] [Code Review] 2507: Add support for indexing installed sounds and for Stasis-HTTP sounds queries

opticron reviewboard at asterisk.org
Tue Jun 4 09:17:44 CDT 2013



> On June 3, 2013, 2:46 p.m., David Lee wrote:
> > trunk/include/asterisk/media_index.h, lines 45-55
> > <https://reviewboard.asterisk.org/r/2507/diff/3/?file=38726#file38726line45>
> >
> >     Would it be bad if the string were ao2_alloc()'ed, so it could be ref-counted instead of copied?

The internal implementation of the media index does not currently allow for this since it is a stringfield. Changed to const and copying removed.


> On June 3, 2013, 2:46 p.m., David Lee wrote:
> > trunk/res/stasis_http/resource_sounds.c, lines 138-139
> > <https://reviewboard.asterisk.org/r/2507/diff/3/?file=38734#file38734line138>
> >
> >     Why the strdupa?

ao2_callback takes a void* and casting constness away from a const char* is full of sadness.


> On June 3, 2013, 2:46 p.m., David Lee wrote:
> > trunk/include/asterisk/media_index.h, lines 90-102
> > <https://reviewboard.asterisk.org/r/2507/diff/3/?file=38726#file38726line90>
> >
> >     Wouldn't it be better to put the base_dir and variant in the constructor rather than in index_update()? Otherwise we've got to know the proper base_dir and varient from every place where we might want to kick off an index update.

I'll move base_dir into the constructor since it doesn't make a lot of sense to be indexing multiple base directories, but variants can change on reload depending on what sounds packages you've installed or removed.


- opticron


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


On May 24, 2013, 3:31 p.m., opticron wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2507/
> -----------------------------------------------------------
> 
> (Updated May 24, 2013, 3:31 p.m.)
> 
> 
> Review request for Asterisk Developers and David Lee.
> 
> 
> Bugs: ASTERISK-21584 and ASTERISK-21585
>     https://issues.asterisk.org/jira/browse/ASTERISK-21584
>     https://issues.asterisk.org/jira/browse/ASTERISK-21585
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> This adds support for stasis/sounds and stasis/sounds/{ID} queries via the Stasis-HTTP interface.
> 
> The following changes have been made to accomplish this:
> * A modular indexer was created for local media.
> * A new function to get an ast_format associated with a file extension was added.  
> * Modifications were made to the built-in HTTP server so that URI decoding could be deferred to the URI handler when necessary.
> * The Stasis-HTTP sounds JSON documentation was modified to handle cases where multiple languages are installed in different formats.
> * Register and Unregister events for formats were added to the system topic.
> 
> 
> Diffs
> -----
> 
>   trunk/include/asterisk/_private.h 389730 
>   trunk/include/asterisk/file.h 389730 
>   trunk/include/asterisk/format.h 389730 
>   trunk/include/asterisk/http.h 389730 
>   trunk/include/asterisk/media_index.h PRE-CREATION 
>   trunk/include/asterisk/sounds_index.h PRE-CREATION 
>   trunk/main/asterisk.c 389730 
>   trunk/main/file.c 389730 
>   trunk/main/http.c 389730 
>   trunk/main/media_index.c PRE-CREATION 
>   trunk/main/sounds_index.c PRE-CREATION 
>   trunk/res/res_stasis_http.c 389730 
>   trunk/res/stasis_http/resource_sounds.c 389730 
>   trunk/rest-api/api-docs/sounds.json 389730 
> 
> Diff: https://reviewboard.asterisk.org/r/2507/diff/
> 
> 
> Testing
> -------
> 
> Tested using a browser and HTTP GET requests using the Stasis-HTTP API.  Currently contemplating how to create automated tests.
> 
> 
> Thanks,
> 
> opticron
> 
>

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


More information about the asterisk-dev mailing list