Update twilio.api.php

This commit is contained in:
Namhyeon Go 2019-04-10 20:29:53 +09:00 committed by GitHub
parent df236810ad
commit a3e41edd57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,7 +7,7 @@
* @documentation https://www.twilio.com/docs/sms/send-messages
*/
if(check_function_exists("twilio_send_message")) {
if(!check_function_exists("twilio_send_message")) {
function twilio_send_message($message, $from, $to, $sid, $token) {
$response = false;
@ -29,10 +29,14 @@ if(check_function_exists("twilio_send_message")) {
}
}
if(check_function_exists("twilio_send_voice")) {
function twilio_send_voice($url="http://demo.twilio.com/docs/voice.xml", $from, $to, $sid, $token) {
if(!check_function_exists("twilio_send_voice")) {
function twilio_send_voice($url="", $from, $to, $sid, $token) {
$response = false;
if(empty($url)) {
$url = "http://demo.twilio.com/docs/voice.xml";
}
if(loadHelper("webpagetool")) {
$request_url = sprintf("https://api.twilio.com/2010-04-01/Accounts/%s/Calls.json", $sid);
$response = get_web_json($request_url, "post", array(