S3 Presigned URL

I am using Asterisk 17.3 and ARI to playback .wav files from a given URL. This is working fine for public URLs but fails for S3 presigned URLs. The situation is similar to this post unfortunately it was never really answered.

In my case i can verify the presigned URL is correct, as it is accessible via Browser.
The logs are showing: (URL adjusted for this post)

db.c:334 ast_db_put: Family and key length must be less than 253 bytes
db.c:334 ast_db_put: Family and key length must be less than 253 bytes
file.c:789 ast_openstream_full: File https://s3.provider.net/my-bucket/some/path/29bb...0010268.wav?AWSAccessKeyId=28e...80b4b&Signature=6z...9iQ%2F...eI%3D&Expires=1681227647 does not exist in any format
file.c:1262 ast_streamfile: Unable to open https://s3.provider.net/my-bucket/some/path/29bb...0010268.wav?AWSAccessKeyId=28e...89f80b4b&Signature=6z...9iQ%2F...eI%3D&Expires=1681227647 (format (slin)): No such file or directory

Does Asterisk 17 even support a URLs like this?

I had this exact same issue. The problem is that asterisk goes based on the extension and looks at the end of the url. I believe a fix was done in 18 and 20 for this. I opted to modify my bucket settings to allow my Asterisk IPs to have access without having to sign the files.

Thanks for the quick answer.
Unfortunately updating to 18 or 20 is not an option yet, so I will try to adjust the bucket. Good hint, didn’t know that this is possible. I hope my provider is supporting this feature, as it is not AWS directly.

Another option would be to relay the file data through your own background process, and have Asterisk read from that process via a fifo with a suitable name, including the right extension.

We found a hacky quick fix. By adding #.wav to the end of the presigned URL, Asterisk seems to be satisfied with the format without breaking the functionality of the actual URL. Of course the other suggestions would be cleaner.

That is a really cool hack. I spent days on trying to figure out a work around for this one.

I describe more details about the pipe redirection here.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.