From a3e41edd578cfe99ad8e42f5cc3daf19ebbafabe Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Wed, 10 Apr 2019 20:29:53 +0900 Subject: [PATCH] Update twilio.api.php --- helper/twilio.api.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/helper/twilio.api.php b/helper/twilio.api.php index 510935f..1878c20 100644 --- a/helper/twilio.api.php +++ b/helper/twilio.api.php @@ -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,9 +29,13 @@ 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);