Commit Graph

4 Commits

Author SHA1 Message Date
Sean Bright
e70f8f7c20 sounds: Sort 'core show sounds' output
Change-Id: Ib39052a745040f75eb635f15a042da15b20e22ab
2019-02-04 15:40:02 -05:00
George Joseph
66982824bf media_index.c: Refactored so it doesn't cache the index
Testing revealed that the cache added no benefit but that it could
consume excessive memory.

Two new index related functions were created:
ast_sounds_get_index_for_file() and ast_media_index_update_for_file()
which restrict index updating to specific sound files.

The original ast_sounds_get_index() and ast_media_index_update()
calls are still available but since they no longer cache the results
internally, developers should re-use an index they may already have
instead of calling ast_sounds_get_index() repeatedly.  If information
for only a single file is needed, ast_sounds_get_index_for_file()
should be called instead of ast_sounds_get_index().

The media_index directory scan code was elimininated in favor of
using the existing ast_file_read_dirs() function.

Since there's no more cache, ast_sounds_index_init now only
registers the sounds cli commands instead of generating the
initial index and subscribing to stasis format register/unregister
messages.

ast_sounds_reindex() is now a no-op but left for backwards
compatibility.

loader.c no longer registers "sounds" as a special reload target.

Both the sounds cli commands and the sounds ari resources were
refactored to only call ast_sounds_get_index() once per invocation
and to use ast_sounds_get_index_for_file() when a specific sound
file is requested.

Change-Id: I1cef327ba1b0648d85d218b70ce469ad07f4aa8d
2019-01-28 10:07:51 -07:00
Corey Farrell
a89323236f main/sounds: Use ast_cli_completion_add.
Change-Id: I140e1137906bbfcdb61c0c6304159be459ad873e
2018-03-19 15:45:08 -06:00
Corey Farrell
e532b982b3 core: Rename sounds_index.c to sounds.c.
This will make the source filename match the 'module reload sounds'
command.  This will allow conversion to a built-in module in Asterisk 16
without needing to redefine AST_MODULE.

Change-Id: Ifb8e489575b27eb33d8c0b6a531f266670557f6e
2018-02-19 05:00:23 -05:00