<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jan 21, 2019 at 2:45 PM <a href="mailto:sduthil@wazo.io">sduthil@wazo.io</a> <<a href="mailto:sduthil@wazo.io">sduthil@wazo.io</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 2019-01-21 10:42 a.m., George Joseph wrote:<br>
> and what do you use it for?<br>
<br>
I assume that you're talking about the /sounds resource available in ARI<br>
[1].<br>
<br>
At Wazo [2], we use the /sounds resource to list the sound files that<br>
are register in Asterisk.<br>
<br>
It allows us to implement a REST API that gives an overview of what<br>
sound files are available and in what languages.<br>
<br>
This REST API is then used to display the list of sound files in a web<br>
page, or to select a sound file in an application, e.g. when creating an<br>
IVR and selecting a sound file to play. The REST API is also used to<br>
list the available languages for sound files.<br>
<br>
We have used the /sounds resource when we could, but we still had to<br>
access the file system directly at some point in order to offer more<br>
features in our REST API, like uploading custom sounds, streaming the<br>
sound files or accessing recording files.<br>
<br>
[1] <a href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+16+Sounds+REST+API" rel="noreferrer" target="_blank">https://wiki.asterisk.org/wiki/display/AST/Asterisk+16+Sounds+REST+API</a><br>
[2] <a href="http://wazo.community/" rel="noreferrer" target="_blank">http://wazo.community/</a><br>
<br>
-- <br>
Sébastien Duthil<br>
Wazo developer<br>
</blockquote></div><br clear="all"><div>Thanks Sébastien.</div><div><br></div><div>What kind of response time are you getting when you retrieve the full list?</div><div><br></div><div>The reason I'm asking is that when Asterisk starts, we pre-populate an internal cache (media_index) with all the sounds which, depending on which languages and formats are installed, could easily be 20,000 files. In some instances, users are creating symlinks inside the sounds language directories to other places (like voicemail) which now will also get indexed. In one case, we had a customer with an effective list of over 800,000 sound files. This takes quite a bit of memory. What we're trying to determine is the value of the cache considering that we're only caching directory entries (not contents) which the filesystem has already got cached. In tests of the ari/sounds resource, 95% of the response time is constructing the JSON response, even when not using the cache. I.E. The cache made no appreciable difference in the response time.</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr" style="font-size:12.8px"><b style="font-family:arial,helvetica,sans-serif;font-size:12.8px">George Joseph</b><br></div><div dir="ltr"><div style="font-size:12.8px"><font face="arial, helvetica, sans-serif" size="1">Digium - A Sangoma Company | Software Developer | Software Engineering</font></div><font size="1">445 Jan Davis Drive NW - Huntsville, AL 35806 - US</font></div><div dir="ltr"><font size="1">direct/fax: +1 256 428 6012</font><div style="font-size:12.8px"><font face="arial, helvetica, sans-serif" size="1">Check us out at: <a href="https://digium.com/" style="color:rgb(17,85,204)" target="_blank">https://digium.com</a> · <a href="https://sangoma.com/" style="color:rgb(17,85,204)" target="_blank">https://sangoma.com</a></font></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><img src="https://www.digium.com/sites/digium/themes/digium/logo.png" width="96" height="60"></div></div></div></div></div></div></div>