GET playback .wav file from AWS S3 using presigned URL returns 403?

I’m trying to use “playback” to play a .wav file, from AWS S3 using a presigned URL but it’s failing with a 403 response code. The exact same presigned URL works fine in Chrome, Postman and curl (I see Freeswitch is using libcurl).

I can’t see that Freeswitch (in mod_httapi.c) is doing anything ‘special’ when it tries to get the file (and it works fine for non-S3 remote .wav files)

Can anyone tell me why I see different behaviour when trying to retrieve the file, using Freeswitch, when it works with other clients)? Is there some FS setting I need to change?

Many thanks

Most likely a config issue. Test with the different config options mod_httapi | FreeSWITCH Documentation Set debug to true to see what error messages you might be getting.

Thanks, @LenGraham-sw . I have yet to find anything in the config or documentation which may help BUT, I’ve been going through the code, plus looking at tcp output, and I now KNOW why it’s failing: the presigned URL for S3 grants GET access but FS is first sending a HEAD request (after which it will sent a GET but only IF the HEAD succeeds).

This explains the 403 response: GET is permitted, but HEAD is not - and S3 wont let us generate presigned URLs allowing BOTH methods

So, now I know I need to persuade FS to NOT use the HEAD method (it must only send a GET request), but I am so far unable to figure out HOW to instruct it to behave as required. I see nothing in the docs or config.

Any ideas how to tell FS to dispense with the initial HEAD request, and just got straight to sending the GET?

I figured it out!!

There appears to be be nothing in the config or documentation on this, but setting “nohead” as a parameter supresses the HEAD request, allowing presigned S3 URLS to work as intended.

I figured this out after MUCH debugging/reading of the code!

NOTE: This kind of parameter has to be provided between parenthesis, after the http:// (why???) For example…

“https://(nohead=1)mydomain.com/filename.wav?param1=sfsf&key=somekey