phone_to_post_test.lua
temp_dir = "/tmp"
filename = "post_test.wav"
message = storage("speech_to_text", "translation_1")
post_response = storage("service", "raw")
return
{
{
action = "wait",
milliseconds = 500,
},
{
action = "play_phrase",
phrase = "voicemail_record_message",
},
{
action = "record",
location = temp_dir,
filename = filename,
pre_record_sound = "tone",
max_length = 10,
silence_secs = 2,
keys = {
["0"] = ":break",
["1"] = ":break",
["2"] = ":break",
["3"] = ":break",
["4"] = ":break",
["5"] = ":break",
["6"] = ":break",
["7"] = ":break",
["8"] = ":break",
["9"] = ":break",
["*"] = ":break",
["#"] = ":break",
},
},
{
action = "speech_to_text_from_file",
filepath = temp_dir .. "/" .. filename,
app_key = profile.att_app_key,
app_secret = profile.att_app_secret,
},
{
action = "http_request",
path = "post.php",
query = {
dir = "jester",
message = message,
},
server = "posttestserver.com",
},
{
action = "log",
message = "POST MESSAGE RESPONSE: " .. post_response,
},
{
action = "play_phrase",
phrase = "voicemail_ack",
phrase_arguments = "saved",
},
{
action = "hangup",
},
}