<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
span.EmailStyle18
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle19
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.EmailStyle20
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Does anyone know about how caching of media actually happens in Asterisk 14? What I observe is that in the case of a media uri being presented to Asterisk to play to the caller, Asterisk fetches the media, stores it in
<i>/tmp </i>and plays it back. Now, when the same media uri is presented to Asterisk again whether in the same Call (SIP session with a given caller) or a new call, Asterisk makes a web request to fetch the media file again and replaces the existing file under
<i>/tmp </i> with the new one. This is kinda fine but what doesn’t seem right is that when Media server serving the media files is down, Asterisk fails to play it instead of using the cached media file.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><i>gke-daniel-smartline-us--voip-cluster-c0456898-lg29*CLI> media cache show all<o:p></o:p></i></p>
<p class="MsoNormal"><i>URI<o:p></o:p></i></p>
<p class="MsoNormal"><i> Local File<o:p></o:p></i></p>
<p class="MsoNormal"><i>---------------<o:p></o:p></i></p>
<p class="MsoNormal"><i><a href="https://media-service-vip.smartline.svc.cluster.local/media/v1/media-service/SecondMessage">https://media-service-vip.smartline.svc.cluster.local/media/v1/media-service/SecondMessage</a><o:p></o:p></i></p>
<p class="MsoNormal"><i> /tmp/bucket-xkLK8U.wav<o:p></o:p></i></p>
<p class="MsoNormal"><i><a href="https://media-service-vip.smartline.svc.cluster.local/media/v1/media-service/FirstMessage">https://media-service-vip.smartline.svc.cluster.local/media/v1/media-service/FirstMessage</a><o:p></o:p></i></p>
<p class="MsoNormal"><i> /tmp/bucket-81YBXw.wav<o:p></o:p></i></p>
<p class="MsoNormal"><i><a href="https://media-service-vip.smartline.svc.cluster.local/media/v1/media-service/Goodbye">https://media-service-vip.smartline.svc.cluster.local/media/v1/media-service/<b>Goodbye</b></a><o:p></o:p></i></p>
<p class="MsoNormal"><i> /tmp/bucket-Krr4gc.wav<o:p></o:p></i></p>
<p class="MsoNormal"><i><a href="https://media-service-vip.smartline.svc.cluster.local/media/v1/media-service/GDIntro">https://media-service-vip.smartline.svc.cluster.local/media/v1/media-service/GDIntro</a><o:p></o:p></i></p>
<p class="MsoNormal"><i> /tmp/bucket-bMieY6.wav<o:p></o:p></i></p>
<p class="MsoNormal">[Feb 13 00:38:50] WARNING[408][C-00000007]: res_http_media_cache.c:238 execute_curl_instance: Failed connect to media-service-vip.smartline.svc.cluster.local:443; Connection refused<o:p></o:p></p>
<p class="MsoNormal">[Feb 13 00:38:50] WARNING[408][C-00000007]: res_http_media_cache.c:238 execute_curl_instance: Failed connect to media-service-vip.smartline.svc.cluster.local:443; Connection refused<o:p></o:p></p>
<p class="MsoNormal">[Feb 13 00:38:50] WARNING[408][C-00000007]: res_http_media_cache.c:284 bucket_file_run_curl: Failed to retrieve URL 'https://media-service-vip.smartline.svc.cluster.local/media/v1/media-service/<b>Goodbye'</b>: server returned -1<o:p></o:p></p>
<p class="MsoNormal">[Feb 13 00:38:50] WARNING[408][C-00000007]: res_http_media_cache.c:238 execute_curl_instance: Failed connect to media-service-vip.smartline.svc.cluster.local:443; Connection refused<o:p></o:p></p>
<p class="MsoNormal">[Feb 13 00:38:50] WARNING[408][C-00000007]: res_http_media_cache.c:284 bucket_file_run_curl: Failed to retrieve URL 'https://media-service-vip.smartline.svc.cluster.local/media/v1/media-service/Goodbye': server returned -1<o:p></o:p></p>
<p class="MsoNormal">[Feb 13 00:38:50] WARNING[408][C-00000007]: file.c:790 ast_openstream_full: File
<a href="https://media-service-vip.smartline.svc.cluster.local/media/v1/media-service/Goodbye">
https://media-service-vip.smartline.svc.cluster.local/media/v1/media-service/<b>Goodbye</b></a><b> does not exist in any format</b><o:p></o:p></p>
<p class="MsoNormal">[Feb 13 00:38:50] WARNING[408][C-00000007]: file.c:1263 ast_streamfile: Unable to open
<a href="https://media-service-vip.smartline.svc.cluster.local/media/v1/media-service/Goodbye">
https://media-service-vip.smartline.svc.cluster.local/media/v1/media-service/Goodbye</a> (format (ulaw)): No such file or directory<o:p></o:p></p>
<p class="MsoNormal">[Feb 13 00:38:50] WARNING[408][C-00000007]: res_stasis_playback.c:277 playback_final_update: 1518482313.8:
<b>Playback failed for sound:https://media-service-vip.smartline.svc.cluster.local/media/v1/media-service/Goodbye</b><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Has anyone seen the same thing? And, have any comments on how to get it to behave right? My last resort is to patch Asterisk but wanted to find out how others are doing before I start fixing it myself.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks,<br>
Gaurav<o:p></o:p></p>
</div>
</body>
</html>