I got it working! The goal was to run a script to inform users via a text message when they get a voicemail.This script looks for a "vm-notify-sms" param in the user's directory information. It sends the text from user's outbound caller-ID number, which is set in the standard FS configuration. I'm using the SMS API from Flowroute.com.--[[ This script is called by configuration in autoload_configs/lua.conf.xml.It is called on a "vm:maintenance" event.]]-- The following is specifc to the Flowroute SMS API,-- documented at https://developer.flowroute.com/docs/messagingauthentication = "user:password"action = event:getHeader("VM-Action")if action ~= "leave-message" then return enduser = event:getHeader("VM-User")domain = event:getHeader("VM-Domain")caller_id_name = event:getHeader("VM-Caller-ID-Name")caller_id_number = event:getHeader("VM-Caller-ID-Number")--[[ We don't care about these:file_path = event:getHeader("VM-File-Path")flags = event:getHeader("VM-Flags")folder = event:getHeader("VM-Folder")uuid = event:getHeader("VM-UUID")--]]message_len = event:getHeader("VM-Message-Len")timestamp = event:getHeader("VM-Timestamp")api = freeswitch.API();from = api:execute("user_data", user .. "@" .. domain .. " var outbound_caller_id_number")to = api:execute("user_data", user .. "@" .. domain .. " param vm-notify-sms")if to == "" then return endif caller_id_name == ''or caller_id_name == 'UNKNOWN'or caller_id_name == 'UNASSIGNED'or caller_id_name == 'WIRELESS CALLER'or caller_id_name == 'TOLL FREE CALL'or caller_id_name == 'Anonymous'or caller_id_name == 'Unavailable'then caller_id_name = nil endif caller_id_number == ''then caller_id_number = nil endmessage = "Voicemail "if caller_id_namethen message = message .. "from " .. caller_id_name .. " (" .. caller_id_number .. ")"elseif caller_id_numberthen message = message .. "from " .. caller_id_number endmessage = message .. " at " .. os.date("%I:%M %p", timestamp)message = message .. " length " .. message_len .. " seconds"message = message .. " to box " .. usermessage = message .. "."-- Blindly send the textdata = '{ "to": "' .. to .. '", "from": "' .. from .. '", "body": "' .. message .. '"}'--[[Until either Freeswitch has the ability to pass authentication datato the mod_curl API (FS-9223), or the Flowroute API has the abilityto take authentication data in the POST body (they are working on it),we are forced to spawn a shell to use the curl from our OS.]]-- api.execute("curl", url .. " auth " .. authentication .. " post " .. data)os.execute("curl -u " .. authentication .. " -H 'Content-Type: application/json' -X POST -d '" .. data .. "' " .. url)