Update api.twilio.php
This commit is contained in:
parent
c922ef2b80
commit
895e547acd
|
|
@ -9,22 +9,18 @@
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user