Serverless Fastagi/ARI Via AWS Lambda And A Question About Dialplan Curl For Variables
I want a very basic Asterisk install on a pi to play two mp3 files, which change location, one after another. I have a tiny node script which reads an rss feed and returns the first 2
episodes.
In this case, running a fast-agi server seems like overkill and as it’s simply 2 or 3 variables, I can make a simple dialplan curl request to a simple text/plain lamdba http endpoint, and then CUT the variables.
(eg: https://example.com/something.mp3|https://example.com/tuesday.mp3)
But it made me wonder: has anyone ever attempted running fastagi on something serverless like AWS Lambda? I’m not really sure what the agi tcp spec is – it doesn’t seem to be websockets.
I think ARI might be a different proposition as one can configure an API
websocket gateway on Lambda – go into stasis, websocket to the lambda running node-ari, job done. And has anyone attempted that too, or is that also a bit hopeful?
PS: Side-question: is it possible to put a curl result directly into a variable rather than doing these two back to back (curl > file > file >
variable)
https://wiki.asterisk.org/wiki/display/AST/Asterisk+18+Function_CURL
https://wiki.asterisk.org/wiki/display/AST/Asterisk+18+Function_FILE
Thanks again, hope you all had a good Christmas, and stay safe.
PPS – yes, I know none of the above is production-safe and it sounds a bit insane; this is a little short term micro-project for my own interest, but the thought of serverless AGI/ARI for bigger things intrigued me….