title: store the recordings on s3 with mod_rayo and mod_http_cache on freeswitch
body: <p>i'm trying to get my recordings stored on s3.</p>
  
  <p>Here is my rayo.conf.xml:</p>
  
  <pre><code>&lt;configuration name="rayo.conf"&gt;
    &lt;settings&gt;
      &lt;param name="max-idle-sec" value="300"/&gt;
    &lt;/settings&gt;
    &lt;domain name="localhost" shared-secret="itsasecret"&gt;
      &lt;listen type="c2s" port="5222" address="0.0.0.0" acl=""/&gt;
      &lt;users&gt;&lt;user name="adhearsion" password="foo"/&gt;&lt;/users&gt;
    &lt;/domain&gt;
  
    &lt;record&gt;
      &lt;param name="record-file-prefix" value="{profile=s3}http://bucket.domain.com.s3.amazonaws.com/records/"/&gt;
    &lt;/record&gt;
  
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Here is my http_cache.conf.xml</p>
  
  <pre><code>&lt;configuration name="http_cache.conf" description="HTTP GET cache"&gt;
    &lt;settings&gt;
      &lt;!-- set to true if you want to enable http:// and https:// formats.  Do not use if mod_httapi is also loaded --&gt;
      &lt;param name="enable-file-formats" value="true"/&gt;
      &lt;param name="max-urls" value="10000"/&gt;
      &lt;param name="location" value="$${base_dir}/http_cache"/&gt;
      &lt;param name="default-max-age" value="86400"/&gt;
      &lt;param name="prefetch-thread-count" value="8"/&gt;
      &lt;param name="prefetch-queue-size" value="100"/&gt;
      &lt;!-- absolute path to CA bundle file --&gt;
      &lt;param name="ssl-cacert" value="$${base_dir}/conf/cacert.pem"/&gt;
      &lt;!-- verify certificates --&gt;
      &lt;param name="ssl-verifypeer" value="true"/&gt;
      &lt;!-- verify host name matches certificate --&gt;
      &lt;param name="ssl-verifyhost" value="true"/&gt;
    &lt;/settings&gt;
  &lt;profiles&gt;
      &lt;profile name='s3'&gt;
          &lt;aws-s3&gt;
              &lt;access-key-id&gt;
                  &lt;![CDATA[AWS_KEY_ID]]&gt;
              &lt;/access-key-id&gt;
              &lt;secret-access-key&gt;
                  &lt;![CDATA[AWS_KEY_SECRET]]&gt;
              &lt;/secret-access-key&gt;
          &lt;/aws-s3&gt;
          &lt;domains&gt;
            &lt;domain name='bucket.domain.com.s3.amazonaws.com' /&gt;
          &lt;/domains&gt;
      &lt;/profile&gt;
  &lt;/profiles&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Here is the debug log:</p>
  
  <pre><code>2014-08-10 01:03:19.405172 [ERR] mod_http_cache.c:351 Received HTTP error 403 trying to save /usr/http_cache/64/6ee5dd-bb6d-49a4-96cc-34bd54ab9827.wav to http://bucket.domain.com.s3.amazonaws.com/records/b5ffe577-c8c1-48c5-847e-a330ddc7b6b9-2.wav
  
  2014-08-10 01:03:19.405172 [ERR] mod_http_cache.c:351 Received HTTP error 403 trying to save /usr/http_cache/64/6ee5dd-bb6d-49a4-96cc-34bd54ab9827.wav to http://bucket.domain.com.s3.amazonaws.com/records/b5ffe577-c8c1-48c5-847e-a330ddc7b6b9-2.wav
  [DEBUG] esl.c:1316 esl_recv_event() RECV HEADER [Content-Type] = [log/data]
  [DEBUG] esl.c:1316 esl_recv_event() RECV HEADER [Content-Length] = [116]
  [DEBUG] esl.c:1316 esl_recv_event() RECV HEADER [Log-Level] = [5]
  [DEBUG] esl.c:1316 esl_recv_event() RECV HEADER [Text-Channel] = [3]
  [DEBUG] esl.c:1316 esl_recv_event() RECV HEADER [Log-File] = [switch_core_session.c]
  [DEBUG] esl.c:1316 esl_recv_event() RECV HEADER [Log-Func] = [switch_core_session_thread]
  [DEBUG] esl.c:1316 esl_recv_event() RECV HEADER [Log-Line] = [1632]
  [DEBUG] esl.c:1316 esl_recv_event() RECV HEADER [User-Data] = [b5ffe577-c8c1-48c5-847e-a330ddc7b6b9]
  [DEBUG] esl.c:1480 esl_recv_event() RECV MESSAGE
  Event-Name: SOCKET_DATA
  Content-Type: log/data
  Content-Length: 116
  Log-Level: 5
  Text-Channel: 3
  Log-File: switch_core_session.c
  Log-Func: switch_core_session_thread
  Log-Line: 1632
  User-Data: b5ffe577-c8c1-48c5-847e-a330ddc7b6b9
  Content-Length: 116
  
  2014-08-10 01:03:19.425141 [NOTICE] switch_core_session.c:1632 Session 2 (sofia/internal/1001@192.168.59.103) Ended
  </code></pre>
  
  <p>I tried to point it to a local server and turns out the only params i get are is the name of the file: audio_file.wav. looks like it's not sending the file properly... </p>
  
  <p>I double checked my credentials so i'm pretty sure that's not the issue. Also, the records directory is writable by world for now.</p>