[Freeswitch-users] Question about httapi app cached audio files

Michael Jerris mike at jerris.com
Sat Aug 27 00:08:59 MSD 2016


The point is to re-use the file so it doesn’t have to download it each time.  If its not, you are either downloading a different file each time, or there is some other reason its not using the cache.  

> On Aug 26, 2016, at 3:56 PM, Lin, Xiaoping <xlin at soleocommunications.com> wrote:
> 
> Hi! Mike,
>  
> Thank you very much for your reply! I did a little research and find your name in the contributor list of contributors for switch_ivr_play_say.c and hope you do not mind I go further, hope to get your opinion and suggestions.
>  
> Our product is running under 60k/hour call volume. Each call may have 3 to 4 files and plus the meta files. Cron job may end up to impact the performance badly.  Our production owner cannot accept that solution. 
>  
> From the log file I noticed:
>  
> (1). Mod_httpapi.c line 2631 created the cache file
> (2). switch_ivr_play_say.c:1910 plays the file, even from the message, I cannot tell it plays from the original or from the cached.
>  
> I am wondering if the purpose of saving the cache is for playing audio in full from the local, because it creates file with different name each time. If  switch_ivr_play_say.c:1910 knows that it has done with playing, why not just delete the files (wav and meta) after playing? Can we have a quick fix? Any other suggestions?
>  
> Many Thanks!
>  
> -          Xiaoping
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
> 2016-08-26 15:44:24.602281 [NOTICE] mod_dptools.c:1309 Channel [sofia/external/5856414300 at 10.11.210.169 <mailto:sofia/external/5856414300 at 10.11.210.169>:7060] has been answered
> 2016-08-26 15:44:24.602281 [DEBUG] switch_channel.c:3770 (sofia/external/5856414300 at 10.11.210.169 <mailto:sofia/external/5856414300 at 10.11.210.169>:7060) Callstate Change EARLY -> ACTIVE
> 2016-08-26 15:44:24.602281 [DEBUG] sofia.c:6858 Channel sofia/external/5856414300 at 10.11.210.169 <mailto:sofia/external/5856414300 at 10.11.210.169>:7060 entering state [completed][200]
> EXECUTE sofia/external/5856414300 at 10.11.210.169 <mailto:sofia/external/5856414300 at 10.11.210.169>:7060 httapi({method=POST,url=http://10.11.210.169:8690/BannerAdApp/servlet/VoiceAppServlet?dsarsinfo=dsars_vip=10.11.210.63;dsars_key=0e9510d6-524d-4489-991b-77b8f400d003&Context=BannerAdApp <http://10.11.210.169:8690/BannerAdApp/servlet/VoiceAppServlet?dsarsinfo=dsars_vip=10.11.210.63;dsars_key=0e9510d6-524d-4489-991b-77b8f400d003&Context=BannerAdApp>})
> 2016-08-26 15:44:24.764249 [CRIT] mod_httapi.c:1153 Debugging Return Data:
> <document type="text/freeswitch-httapi">
>         <work>  <playback file="http://10.11.210.169:8690//CA/servlet/CA/BannerAdApp/Default/en_US/AgainNumNotInService.wav <http://10.11.210.169:8690//CA/servlet/CA/BannerAdApp/Default/en_US/AgainNumNotInService.wav>"
>                 action="http://10.11.210.169:8690//BannerAdApp/servlet/VoiceAppServlet;jsessionid=1CE051F7B88C2D11AB430A97FD243A21?item=0&PLAY_DONE <http://10.11.210.169:8690//BannerAdApp/servlet/VoiceAppServlet;jsessionid=1CE051F7B88C2D11AB430A97FD243A21?item=0&PLAY_DONE>"
> />      </work>
> </document>
> 2016-08-26 15:44:24.764249 [DEBUG] mod_httapi.c:1222 Process Tag: [playback]
> 2016-08-26 15:44:24.764249 [DEBUG] sofia.c:6858 Channel sofia/external/5856414300 at 10.11.210.169 <mailto:sofia/external/5856414300 at 10.11.210.169>:7060 entering state [ready][200]
> 2016-08-26 15:44:24.764249 [DEBUG] mod_httapi.c:2631 caching: url:http://10.11.210.169:8690//CA/servlet/CA/BannerAdApp/Default/en_US/AgainNumNotInService.wav to /var/lib/freeswitch/storage/http_file_cache/1f1a57f1bbfb2aa96d727a7a3fba94b6.wav (56842 bytes)
> 2016-08-26 15:44:24.764249 [DEBUG] switch_ivr_play_say.c:1467 Codec Activated L16 at 8000hz 1 channels 20ms
> 2016-08-26 15:44:24.764249 [DEBUG] switch_rtp.c:6707 Correct audio ip/port confirmed.
> 2016-08-26 15:44:28.302287 [DEBUG] switch_ivr_play_say.c:1910 done playing file http://10.11.210.169:8690//CA/servlet/CA/BannerAdApp/Default/en_US/AgainNumNotInService.wav <http://10.11.210.169:8690//CA/servlet/CA/BannerAdApp/Default/en_US/AgainNumNotInService.wav>
> From: freeswitch-users-bounces at lists.freeswitch.org [mailto:freeswitch-users-bounces at lists.freeswitch.org] On Behalf Of Michael Jerris
> Sent: Friday, August 26, 2016 11:49 AM
> To: FreeSWITCH Users Help <freeswitch-users at lists.freeswitch.org>
> Subject: Re: [Freeswitch-users] Question about httapi app cached audio files
>  
> either they are not re using the cache due to cache expiry or other reason not to cache.  A corn job should be able to clean up older files in this for, or could even look at the metadata and kill stale cache files.  I don't think we have any code or script to do this currently.  A script or patch for a command to do that would be a nice addition
> 
> On Friday, August 26, 2016, Lin, Xiaoping <xlin at soleocommunications.com <mailto:xlin at soleocommunications.com>> wrote:
> Hello,
>  
> We are developing an app using httapi (FreeSwitch 1.6). Our installation and support engineer reported cached audio files have been dumped under
>  
> /var/lib/freeswitch/storage/http_file_cache
>  
> They are not cleaned and take all the disk space after running for a period time. The files list look like:
>  
> -rw------- 1 freeswitch daemon   124 Aug 12 16:28 ef98679d646e00a3a6f5b9265a6b8a21.meta
> -rw------- 1 freeswitch daemon 91192 Aug 12 16:28 ef98679d646e00a3a6f5b9265a6b8a21.wav
> -rw------- 1 freeswitch daemon   137 Aug 16 15:19 f02875bcd1db251e20d286d57aaff373.meta
> -rw------- 1 freeswitch daemon 40660 Aug  8 21:21 f02875bcd1db251e20d286d57aaff373.wav
> -rw------- 1 freeswitch daemon   124 Aug 12 15:51 f7b50a0efadb7dd589d37ba00115c8d1.meta
> -rw------- 1 freeswitch daemon 91192 Aug 12 15:51 f7b50a0efadb7dd589d37ba00115c8d1.wav
> -rw------- 1 freeswitch daemon   124 Aug 10 14:08 feb0d10f984b4ea85e9f6645f561bbf4.meta
> -rw------- 1 freeswitch daemon 91192 Aug 10 14:08 feb0d10f984b4ea85e9f6645f561bbf4.wav
>  
> Even the files are the same, it was saved with different file names and never got cleaned.
>  
> Anyone has the same problem and what is the correct way to deal with this?
>  
> Many thanks!
>  
> -          Xiaoping
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20160826/b1df0008/attachment-0001.html 


Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list