<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=""> <profiles></div><div class=""> <!-- amazon s3 security credentials --></div><div class=""> <profile name="s3"></div><div class=""> <aws-s3></div><div class=""> <!-- 20 character key identifier --></div><div class=""> <access-key-id><![CDATA[my-access-key-id]]></access-key-id></div><div class=""> <!-- 40 character secret --></div><div class=""> <secret-access-key><![my-secret-access-key]]></secret-access-key></div><div class=""> </aws-s3></div><div class=""><br class=""></div><div class=""> <!-- optional list of domains that this profile will automatically be applied to --></div><div class=""> <!-- if you wish to apply the s3 credentials to a domain not listed here, then use</div><div class=""> {profile=s3}<a href="http://foo.s3" class="">http://foo.s3</a>... --></div><div class=""> <domains></div><div class=""> <domain name=“<a href="http://my-bucket.s3.amazonaws.com" class="">my-bucket.s3.amazonaws.com</a>"/></div><div class=""> </domains></div><div class="">—————————</div><div class=""><br class=""></div><div class="">———dialplan———</div><div class=""><br class=""></div><div class=""><div class=""> <extension name="announcement"></div><div class=""> <condition field="${sip_req_user}" expression="^annc$"/></div><div class=""> <condition field="${sip_req_params}" expression="^play=(.*)$"></div><div class=""> <action application="answer"/></div><div class=""> <action application="sleep" data="1000"/></div><div class=""> <action application="playback" data="http_cache://<a href="http://my-bucket.amazonaws.com/$1" class="">http://my-bucket.amazonaws.com/$1</a>"/></div><div class=""> <action application="hangup"/></div><div class=""> </condition></div><div class=""> </extension></div></div><div class=""><br class=""></div><div class="">------------------------</div><div><div class="">On Jun 16, 2016, at 3:42 PM, Christopher Rienzo <<a href="mailto:cmrienzo@gmail.com" class="">cmrienzo@gmail.com</a>> 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. It will default to <a href="http://amazonaws.com/" class="">amazonaws.com</a> if not set. 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=""><<a href="mailto:daveh@beachdognet.com" target="_blank" class="">daveh@beachdognet.com</a>></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 <<a href="mailto:cmrienzo@gmail.com" target="_blank" class="">cmrienzo@gmail.com</a>> 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. 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=""><<a href="mailto:daveh@beachdognet.com" target="_blank" class="">daveh@beachdognet.com</a>></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="">
<configuration name="http_cache.conf" description="HTTP GET cache"><br class="">
<settings><br class="">
<!-- set to true if you want to enable http:// and https:// formats. Do not use if mod_httapi is also loaded --><br class="">
<param name="enable-file-formats" value="true"/><br class="">
<param name="max-urls" value="10000"/><br class="">
<param name="location" value="$${cache_dir}"/><br class="">
<param name="default-max-age" value="86400"/><br class="">
<param name="prefetch-thread-count" value="8"/><br class="">
<param name="prefetch-queue-size" value="100"/><br class="">
<!-- absolute path to CA bundle file --><br class="">
<param name="ssl-cacert" value="$${certs_dir}/cacert.pem"/><br class="">
<!-- verify certificates --><br class="">
<param name="ssl-verifypeer" value="true"/><br class="">
<!-- verify host name matches certificate --><br class="">
<param name="ssl-verifyhost" value="true"/><br class="">
<!-- default is 300 seconds, override here --><br class="">
<!--param name="connect-timeout" value="300"/--><br class="">
<!-- default is 300 seconds, override here --><br class="">
<!--param name="download-timeout" value="300"/--><br class="">
</settings><br class="">
<br class="">
<profiles><br class="">
<!-- amazon s3 security credentials --><br class="">
<profile name="s3"><br class="">
<aws-s3><br class="">
<!-- 20 character key identifier --><br class="">
<access-key-id><![CDATA[my-access-key-here]]></access-key-id><br class="">
<!-- 40 character secret --><br class="">
<secret-access-key><![CDATA[my-secret-access-key-here]]></secret-access-key><br class="">
</aws-s3><br class="">
<!-- optional list of domains that this profile will automatically be applied to --><br class="">
<!-- if you wish to apply the s3 credentials to a domain not listed here, then use<br class="">
{profile=s3}<a href="http://foo.s3./" rel="noreferrer" target="_blank" class="">http://foo.s3.</a>.. --><br class="">
<domains><br class="">
<domain name=“<a href="http://my-bucket.s3.amazonaws.com/" rel="noreferrer" target="_blank" class="">my-bucket.s3.amazonaws.com</a>"/><br class="">
</domains><br class="">
</profile><br class="">
</profiles><br class="">
</configuration><br class="">
—————————————<br class="">
<br class="">
My dialplan looks like this:<br class="">
<br class="">
——————————————<br class="">
<extension name="announcement"><br class="">
<condition field="${sip_req_user}" expression="^annc$"/><br class="">
<condition field="${sip_req_params}" expression="^play=(.*)$"><br class="">
<action application="log" data=“file to play: $1"/><br class="">
<action application="answer"/><br class="">
<action application="sleep" data="1000"/><br class="">
<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>"/><br class="">
<action application="hangup"/><br class="">
</condition><br class="">
</extension><br class="">
_______________________<br class="">
<br class="">
The log file says this:<br class="">
<br class="">
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="">
2016-06-16 14:02:59.173718 [DEBUG] mod_http_cache.c:569 Locked cache<br class="">
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="">
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="">
2016-06-16 14:02:59.173718 [DEBUG] mod_http_cache.c:580 Unlocked cache<br class="">
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="">
2016-06-16 14:02:59.233717 [DEBUG] mod_http_cache.c:548 HTTP/1.1 403 Forbidden<br class="">
2016-06-16 14:02:59.233717 [DEBUG] mod_http_cache.c:548 x-amz-request-id: F27F3491740AC96E<br class="">
2016-06-16 14:02:59.233717 [DEBUG] mod_http_cache.c:548 x-amz-id-2: 1LII609UCqdosrj+3tha2MrWfkoDjIgJ/wK2V47LDkgpn6/i8V4GFRxVzzoXRj9Rzbq6BMP15Po=<br class="">
2016-06-16 14:02:59.233717 [DEBUG] mod_http_cache.c:548 Content-Type: application/xml<br class="">
2016-06-16 14:02:59.233717 [DEBUG] mod_http_cache.c:548 Transfer-Encoding: chunked<br class="">
2016-06-16 14:02:59.233717 [DEBUG] mod_http_cache.c:548 Date: Thu, 16 Jun 2016 18:02:58 GMT<br class="">
2016-06-16 14:02:59.233717 [DEBUG] mod_http_cache.c:548 Server: AmazonS3<br class="">
2016-06-16 14:02:59.233717 [DEBUG] mod_http_cache.c:548<br class="">
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="">
2016-06-16 14:02:59.233717 [DEBUG] mod_http_cache.c:569 Locked cache<br class="">
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="">
2016-06-16 14:02:59.233717 [DEBUG] mod_http_cache.c:580 Unlocked cache<br class="">
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. 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. 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>