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");
$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"));
$twi = twilio_get_config();
$response = false;
$sid = $twi['twilio_sid'];
$token = $twi['twilio_token'];
$response = "";
switch($action) {
case "message":
$response = twilio_send_message($message, $from, $to, $sid, $token);
case "text":
$response = twilio_send_message($message, $to);
break;
case "voice":
$response = twilio_send_voice("", $from, $to, $sid, $token);
break;
$response = twilio_send_voice($message, $to);
break;
}
header("Content-Type: application/json");