Update api.twilio.php

This commit is contained in:
Namhyeon Go 2019-04-16 08:09:43 +00:00
parent c922ef2b80
commit 895e547acd

View File

@ -9,23 +9,19 @@
loadHelper("twilio.api"); loadHelper("twilio.api");
$action = get_requested_value("action", array("_JSON", "_ALL")); $action = get_requested_value("action", array("_JSON", "_ALL"));
$from = get_requested_value("from", array("_JSON", "_ALL")); $message = get_requested_value("message", array("_JSON", "_ALL"));
$to = get_requested_value("to", array("_JSON", "_ALL")); $to = get_requested_value("to", array("_JSON", "_ALL"));
$twi = twilio_get_config(); $response = false;
$sid = $twi['twilio_sid'];
$token = $twi['twilio_token'];
$response = "";
switch($action) { switch($action) {
case "message": case "text":
$response = twilio_send_message($message, $from, $to, $sid, $token); $response = twilio_send_message($message, $to);
break; break;
case "voice": case "voice":
$response = twilio_send_voice("", $from, $to, $sid, $token); $response = twilio_send_voice($message, $to);
break; break;
} }
header("Content-Type: application/json"); header("Content-Type: application/json");