<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">OK, I got it working - tweaked a bunch of things so not sure what was the original problem, but for posterity here is the working config:<div class=""><br class=""></div><div class="">——http_cache.conf.xml—</div><div class=""><br class=""></div><div class=""><div class="">&nbsp; &nbsp; &lt;profiles&gt;</div><div class="">&nbsp; &nbsp; &lt;!-- amazon s3 security credentials --&gt;</div><div class="">&nbsp; &nbsp; &lt;profile name="s3"&gt;</div><div class="">&nbsp; &nbsp; &nbsp; &lt;aws-s3&gt;</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; &lt;!-- 20 character key identifier --&gt;</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; &lt;access-key-id&gt;&lt;![CDATA[my-access-key-id]]&gt;&lt;/access-key-id&gt;</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; &lt;!-- 40 character secret --&gt;</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; &lt;secret-access-key&gt;&lt;![my-secret-access-key]]&gt;&lt;/secret-access-key&gt;</div><div class="">&nbsp; &nbsp; &nbsp; &lt;/aws-s3&gt;</div><div class=""><br class=""></div><div class="">&nbsp; &nbsp; &nbsp; &lt;!-- optional list of domains that this profile will automatically be applied to --&gt;</div><div class="">&nbsp; &nbsp; &nbsp; &lt;!-- if you wish to apply the s3 credentials to a domain not listed here, then use</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{profile=s3}<a href="http://foo.s3" class="">http://foo.s3</a>... --&gt;</div><div class="">&nbsp; &nbsp; &nbsp; &lt;domains&gt;</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; &lt;domain name=“<a href="http://my-bucket.s3.amazonaws.com" class="">my-bucket.s3.amazonaws.com</a>"/&gt;</div><div class="">&nbsp; &nbsp; &nbsp; &lt;/domains&gt;</div><div class="">—————————</div><div class=""><br class=""></div><div class="">———dialplan———</div><div class=""><br class=""></div><div class=""><div class="">&nbsp; &nbsp;&lt;extension name="announcement"&gt;</div><div class="">&nbsp; &nbsp; &nbsp; &lt;condition field="${sip_req_user}" expression="^annc$"/&gt;</div><div class="">&nbsp; &nbsp; &nbsp; &lt;condition field="${sip_req_params}" expression="^play=(.*)$"&gt;</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; &lt;action application="answer"/&gt;</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; &lt;action application="sleep" data="1000"/&gt;</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; &lt;action application="playback" data="http_cache://<a href="http://my-bucket.amazonaws.com/$1" class="">http://my-bucket.amazonaws.com/$1</a>"/&gt;</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; &lt;action application="hangup"/&gt;</div><div class="">&nbsp; &nbsp; &nbsp; &lt;/condition&gt;</div><div class="">&nbsp; &nbsp;&lt;/extension&gt;</div></div><div class=""><br class=""></div><div class="">------------------------</div><div><div class="">On Jun 16, 2016, at 3:42 PM, Christopher Rienzo &lt;<a href="mailto:cmrienzo@gmail.com" class="">cmrienzo@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Base-domain stuff is only if you host your own S3-compatible service.&nbsp; It will default to <a href="http://amazonaws.com/" class="">amazonaws.com</a> if not set.&nbsp; If setting profile=s3 doesn't work, then something is really broken in the config.<br class=""></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Thu, Jun 16, 2016 at 3:32 PM, Dave Horton <span dir="ltr" class="">&lt;<a href="mailto:daveh@beachdognet.com" target="_blank" class="">daveh@beachdognet.com</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="">Well, from looking at the code, part of the problem is that there is an additional — undocumented — configuration parameter called ‘base-domain’ which is required for the AWS stuff to kick in….still trying to figure out how this works, by reading the code……anyone who has knowledge please chime in<div class=""><div class="h5"><div class=""><br class=""></div><div class=""><br class=""><div class=""><div class="">On Jun 16, 2016, at 2:42 PM, Christopher Rienzo &lt;<a href="mailto:cmrienzo@gmail.com" target="_blank" class="">cmrienzo@gmail.com</a>&gt; wrote:</div><br class=""><div class=""><div dir="ltr" class="">Given the example configuration, you can remove {profile=s3}http_cache:// from your playback URL.&nbsp; Also, you can change the config / reload the module / and test using fs_cli http_get for rapid verification of your setup.<br class=""><br class=""></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Thu, Jun 16, 2016 at 2:13 PM, Dave Horton <span dir="ltr" class="">&lt;<a href="mailto:daveh@beachdognet.com" target="_blank" class="">daveh@beachdognet.com</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I’m having trouble using http_cache to download and play a wave file from my amazon S3 bucket.<br class="">
I’m following the basic config at <a href="https://freeswitch.org/confluence/display/FREESWITCH/mod_http_cache" rel="noreferrer" target="_blank" class="">https://freeswitch.org/confluence/display/FREESWITCH/mod_http_cache</a> but I must be missing something.<br class="">
<br class="">
My http_cache.conf.xml looks like this:<br class="">
<br class="">
———————————<br class="">
&lt;configuration name="http_cache.conf" description="HTTP GET cache"&gt;<br class="">
&nbsp; &lt;settings&gt;<br class="">
&nbsp; &nbsp; &lt;!-- set to true if you want to enable http:// and https:// formats.&nbsp; Do not use if mod_httapi is also loaded --&gt;<br class="">
&nbsp; &nbsp; &lt;param name="enable-file-formats" value="true"/&gt;<br class="">
&nbsp; &nbsp; &lt;param name="max-urls" value="10000"/&gt;<br class="">
&nbsp; &nbsp; &lt;param name="location" value="$${cache_dir}"/&gt;<br class="">
&nbsp; &nbsp; &lt;param name="default-max-age" value="86400"/&gt;<br class="">
&nbsp; &nbsp; &lt;param name="prefetch-thread-count" value="8"/&gt;<br class="">
&nbsp; &nbsp; &lt;param name="prefetch-queue-size" value="100"/&gt;<br class="">
&nbsp; &nbsp; &lt;!-- absolute path to CA bundle file --&gt;<br class="">
&nbsp; &nbsp; &lt;param name="ssl-cacert" value="$${certs_dir}/cacert.pem"/&gt;<br class="">
&nbsp; &nbsp; &lt;!-- verify certificates --&gt;<br class="">
&nbsp; &nbsp; &lt;param name="ssl-verifypeer" value="true"/&gt;<br class="">
&nbsp; &nbsp; &lt;!-- verify host name matches certificate --&gt;<br class="">
&nbsp; &nbsp; &lt;param name="ssl-verifyhost" value="true"/&gt;<br class="">
&nbsp; &nbsp; &lt;!-- default is 300 seconds, override here --&gt;<br class="">
&nbsp; &nbsp; &lt;!--param name="connect-timeout" value="300"/--&gt;<br class="">
&nbsp; &nbsp; &lt;!-- default is 300 seconds, override here --&gt;<br class="">
&nbsp; &nbsp; &lt;!--param name="download-timeout" value="300"/--&gt;<br class="">
&nbsp; &lt;/settings&gt;<br class="">
<br class="">
&nbsp; &nbsp; &lt;profiles&gt;<br class="">
&nbsp; &nbsp; &lt;!-- amazon s3 security credentials --&gt;<br class="">
&nbsp; &nbsp; &lt;profile name="s3"&gt;<br class="">
&nbsp; &nbsp; &nbsp; &lt;aws-s3&gt;<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; &lt;!-- 20 character key identifier --&gt;<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; &lt;access-key-id&gt;&lt;![CDATA[my-access-key-here]]&gt;&lt;/access-key-id&gt;<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; &lt;!-- 40 character secret --&gt;<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; &lt;secret-access-key&gt;&lt;![CDATA[my-secret-access-key-here]]&gt;&lt;/secret-access-key&gt;<br class="">
&nbsp; &nbsp; &nbsp; &lt;/aws-s3&gt;<br class="">
&nbsp; &nbsp; &nbsp; &lt;!-- optional list of domains that this profile will automatically be applied to --&gt;<br class="">
&nbsp; &nbsp; &nbsp; &lt;!-- if you wish to apply the s3 credentials to a domain not listed here, then use<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{profile=s3}<a href="http://foo.s3./" rel="noreferrer" target="_blank" class="">http://foo.s3.</a>.. --&gt;<br class="">
&nbsp; &nbsp; &nbsp; &lt;domains&gt;<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; &lt;domain name=“<a href="http://my-bucket.s3.amazonaws.com/" rel="noreferrer" target="_blank" class="">my-bucket.s3.amazonaws.com</a>"/&gt;<br class="">
&nbsp; &nbsp; &nbsp; &lt;/domains&gt;<br class="">
&nbsp; &nbsp; &lt;/profile&gt;<br class="">
&nbsp; &nbsp;&lt;/profiles&gt;<br class="">
&lt;/configuration&gt;<br class="">
—————————————<br class="">
<br class="">
My dialplan looks like this:<br class="">
<br class="">
——————————————<br class="">
&nbsp; &nbsp;&lt;extension name="announcement"&gt;<br class="">
&nbsp; &nbsp; &nbsp; &lt;condition field="${sip_req_user}" expression="^annc$"/&gt;<br class="">
&nbsp; &nbsp; &nbsp; &lt;condition field="${sip_req_params}" expression="^play=(.*)$"&gt;<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; &lt;action application="log" data=“file to play: $1"/&gt;<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; &lt;action application="answer"/&gt;<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; &lt;action application="sleep" data="1000"/&gt;<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; &lt;action application="playback" data="{profile=s3}http_cache://<a href="https://my-bucket.s3.amazonaws.com/$1" target="_blank" class="">https://my-bucket.s3.amazonaws.com:/$1</a>"/&gt;<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; &lt;action application="hangup"/&gt;<br class="">
&nbsp; &nbsp; &nbsp; &lt;/condition&gt;<br class="">
&nbsp; &nbsp;&lt;/extension&gt;<br class="">
_______________________<br class="">
<br class="">
The log file says this:<br class="">
<br class="">
&nbsp; &nbsp;EXECUTE sofia/drachtio_mrf/<a href="mailto:5083084809@68.64.80.16" target="_blank" class="">5083084809@68.64.80.16</a> playback({profile=s3}http_cache://<a href="http://wcs-icr.s3.amazonaws.com/RBT-5762afa9991351886b295fbc/prompt/1466086249630-call-blocked.wav" target="_blank" class="">http://wcs-icr.s3.amazonaws.com:/RBT-5762afa9991351886b295fbc/prompt/1466086249630-call-blocked.wav</a>)<br class="">
&nbsp; &nbsp;2016-06-16 14:02:59.173718 [DEBUG] mod_http_cache.c:569 Locked cache<br class="">
&nbsp; &nbsp;2016-06-16 14:02:59.173718 [INFO] mod_http_cache.c:661 Cache MISS: size = 0 (0 MB), hit ratio = 0/1<br class="">
&nbsp; &nbsp;2016-06-16 14:02:59.173718 [DEBUG] mod_http_cache.c:726 Adding <a href="http://wcs-icr.s3.amazonaws.com/RBT-5762afa9991351886b295fbc/prompt/1466086249630-call-blocked.wav(/usr/local/freeswitch/cache/b6/456219-e1eb-43c2-bbd9-449cfb3af6ac.wav)" target="_blank" class="">http://wcs-icr.s3.amazonaws.com:/RBT-5762afa9991351886b295fbc/prompt/1466086249630-call-blocked.wav(/usr/local/freeswitch/cache/b6/456219-e1eb-43c2-bbd9-449cfb3af6ac.wav)</a> to cache index 0<br class="">
&nbsp; &nbsp;2016-06-16 14:02:59.173718 [DEBUG] mod_http_cache.c:580 Unlocked cache<br class="">
&nbsp; &nbsp;2016-06-16 14:02:59.173718 [DEBUG] mod_http_cache.c:1077 opening /usr/local/freeswitch/cache/b6/456219-e1eb-43c2-bbd9-449cfb3af6ac.wav for URL cache<br class="">
&nbsp; &nbsp;2016-06-16 14:02:59.233717 [DEBUG] mod_http_cache.c:548 HTTP/1.1 403 Forbidden<br class="">
&nbsp; &nbsp;2016-06-16 14:02:59.233717 [DEBUG] mod_http_cache.c:548 x-amz-request-id: F27F3491740AC96E<br class="">
&nbsp; &nbsp;2016-06-16 14:02:59.233717 [DEBUG] mod_http_cache.c:548 x-amz-id-2: 1LII609UCqdosrj+3tha2MrWfkoDjIgJ/wK2V47LDkgpn6/i8V4GFRxVzzoXRj9Rzbq6BMP15Po=<br class="">
&nbsp; &nbsp;2016-06-16 14:02:59.233717 [DEBUG] mod_http_cache.c:548 Content-Type: application/xml<br class="">
&nbsp; &nbsp;2016-06-16 14:02:59.233717 [DEBUG] mod_http_cache.c:548 Transfer-Encoding: chunked<br class="">
&nbsp; &nbsp;2016-06-16 14:02:59.233717 [DEBUG] mod_http_cache.c:548 Date: Thu, 16 Jun 2016 18:02:58 GMT<br class="">
&nbsp; &nbsp;2016-06-16 14:02:59.233717 [DEBUG] mod_http_cache.c:548 Server: AmazonS3<br class="">
&nbsp; &nbsp;2016-06-16 14:02:59.233717 [DEBUG] mod_http_cache.c:548<br class="">
&nbsp; &nbsp;2016-06-16 14:02:59.233717 [ERR] mod_http_cache.c:1131 Received HTTP error 403 trying to fetch <a href="http://wcs-icr.s3.amazonaws.com/RBT-5762afa9991351886b295fbc/prompt/1466086249630-call-blocked.wav" target="_blank" class="">http://wcs-icr.s3.amazonaws.com:/RBT-5762afa9991351886b295fbc/prompt/1466086249630-call-blocked.wav</a><br class="">
&nbsp; &nbsp;2016-06-16 14:02:59.233717 [DEBUG] mod_http_cache.c:569 Locked cache<br class="">
&nbsp; &nbsp;2016-06-16 14:02:59.233717 [INFO] mod_http_cache.c:683 Failed to download URL <a href="http://wcs-icr.s3.amazonaws.com/RBT-5762afa9991351886b295fbc/prompt/1466086249630-call-blocked.wav" target="_blank" class="">http://wcs-icr.s3.amazonaws.com:/RBT-5762afa9991351886b295fbc/prompt/1466086249630-call-blocked.wav</a><br class="">
&nbsp; &nbsp;2016-06-16 14:02:59.233717 [DEBUG] mod_http_cache.c:580 Unlocked cache<br class="">
&nbsp; &nbsp;EXECUTE sofia/drachtio_mrf/<a href="mailto:5083084809@68.64.80.16" target="_blank" class="">5083084809@68.64.80.16</a> hangup()<br class="">
<br class="">
<br class="">
————————<br class="">
<br class="">
I’ve fiddled with a bunch of different things, but no luck.&nbsp; I took a tshark of the outgoing http get and I can see it is not putting in the headers to authenticate, so it seems it is not getting into<br class="">
the S3 code in http_cache.&nbsp; The docs do not include a complete S3 working example, unfortunately.<br class="">
<br class="">
Any help or pointers from those who have gotten this working would be appreciated…<br class="">
<br class="">
Dave<br class="">
_________________________________________________________________________<br class="">
Professional FreeSWITCH Consulting Services:<br class="">
<a href="mailto:consulting@freeswitch.org" target="_blank" class="">consulting@freeswitch.org</a><br class="">
<a href="http://www.freeswitchsolutions.com/" rel="noreferrer" target="_blank" class="">http://www.freeswitchsolutions.com</a><br class="">
<br class="">
Official FreeSWITCH Sites<br class="">
<a href="http://www.freeswitch.org/" rel="noreferrer" target="_blank" class="">http://www.freeswitch.org</a><br class="">
<a href="http://confluence.freeswitch.org/" rel="noreferrer" target="_blank" class="">http://confluence.freeswitch.org</a><br class="">
<a href="http://www.cluecon.com/" rel="noreferrer" target="_blank" class="">http://www.cluecon.com</a><br class="">
<br class="">
FreeSWITCH-users mailing list<br class="">
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank" class="">FreeSWITCH-users@lists.freeswitch.org</a><br class="">
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank" class="">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br class="">
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank" class="">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br class="">
<a href="http://www.freeswitch.org/" rel="noreferrer" target="_blank" class="">http://www.freeswitch.org</a></blockquote></div><br class=""></div>
_________________________________________________________________________<br class="">Professional FreeSWITCH Consulting Services: <br class=""><a href="mailto:consulting@freeswitch.org" target="_blank" class="">consulting@freeswitch.org</a><br class=""><a href="http://www.freeswitchsolutions.com/" target="_blank" class="">http://www.freeswitchsolutions.com</a><br class=""><br class="">Official FreeSWITCH Sites<br class=""><a href="http://www.freeswitch.org/" target="_blank" class="">http://www.freeswitch.org</a><br class=""><a href="http://confluence.freeswitch.org/" target="_blank" class="">http://confluence.freeswitch.org</a><br class=""><a href="http://www.cluecon.com/" target="_blank" class="">http://www.cluecon.com</a><br class=""><br class="">FreeSWITCH-users mailing list<br class=""><a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank" class="">FreeSWITCH-users@lists.freeswitch.org</a><br class=""><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank" class="">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br class="">UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank" class="">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br class=""><a href="http://www.freeswitch.org/" target="_blank" class="">http://www.freeswitch.org</a></div></div><br class=""></div></div></div></div><br class="">_________________________________________________________________________<br class="">
Professional FreeSWITCH Consulting Services:<br class="">
<a href="mailto:consulting@freeswitch.org" class="">consulting@freeswitch.org</a><br class="">
<a href="http://www.freeswitchsolutions.com/" rel="noreferrer" target="_blank" class="">http://www.freeswitchsolutions.com</a><br class="">
<br class="">
Official FreeSWITCH Sites<br class="">
<a href="http://www.freeswitch.org/" rel="noreferrer" target="_blank" class="">http://www.freeswitch.org</a><br class="">
<a href="http://confluence.freeswitch.org/" rel="noreferrer" target="_blank" class="">http://confluence.freeswitch.org</a><br class="">
<a href="http://www.cluecon.com/" rel="noreferrer" target="_blank" class="">http://www.cluecon.com</a><br class="">
<br class="">
FreeSWITCH-users mailing list<br class="">
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" class="">FreeSWITCH-users@lists.freeswitch.org</a><br class="">
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank" class="">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br class="">
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank" class="">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br class="">
<a href="http://www.freeswitch.org/" rel="noreferrer" target="_blank" class="">http://www.freeswitch.org</a><br class=""></blockquote></div><br class=""></div>
_________________________________________________________________________<br class="">Professional FreeSWITCH Consulting Services: <br class=""><a href="mailto:consulting@freeswitch.org" class="">consulting@freeswitch.org</a><br class="">http://www.freeswitchsolutions.com<br class=""><br class="">Official FreeSWITCH Sites<br class="">http://www.freeswitch.org<br class="">http://confluence.freeswitch.org<br class="">http://www.cluecon.com<br class=""><br class="">FreeSWITCH-users mailing list<br class="">FreeSWITCH-users@lists.freeswitch.org<br class="">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users<br class="">UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users<br class="">http://www.freeswitch.org</div></div><br class=""></div></body></html>