Update twilio.api.php
This commit is contained in:
parent
ba21f4e5cf
commit
ffb635d499
|
@ -15,6 +15,7 @@ if(!check_function_exists("twilio_get_config")) {
|
||||||
"sid" => get_value_in_array("twilio_sid", $config, ""),
|
"sid" => get_value_in_array("twilio_sid", $config, ""),
|
||||||
"token" => get_value_in_array("twilio_token", $config, ""),
|
"token" => get_value_in_array("twilio_token", $config, ""),
|
||||||
"from" => get_value_in_array("twilio_from", $config, ""),
|
"from" => get_value_in_array("twilio_from", $config, ""),
|
||||||
|
"block_size" => get_value_in_array("twilio_block_size", $config, 160)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,8 +27,8 @@ if(!check_function_exists("twilio_send_message")) {
|
||||||
$cnf = twilio_get_config();
|
$cnf = twilio_get_config();
|
||||||
|
|
||||||
if(loadHelper("webpagetool")) {
|
if(loadHelper("webpagetool")) {
|
||||||
$request_url = sprintf("https://api.twilio.com/2010-04-01/Accounts/%s/Messages.json", $sid);
|
$request_url = sprintf("https://api.twilio.com/2010-04-01/Accounts/%s/Messages.json", $cnf['sid']);
|
||||||
$response = get_web_json($request_url, "post", array(
|
$response = get_web_json($request_url, "post.cmd", array(
|
||||||
"headers" => array(
|
"headers" => array(
|
||||||
"Content-Type" => "application/x-www-form-urlencoded",
|
"Content-Type" => "application/x-www-form-urlencoded",
|
||||||
"Authentication" => array("Basic", $cnf['sid'], $cnf['token']),
|
"Authentication" => array("Basic", $cnf['sid'], $cnf['token']),
|
||||||
|
@ -49,10 +50,7 @@ if(!check_function_exists("twilio_send_voice")) {
|
||||||
$response = false;
|
$response = false;
|
||||||
|
|
||||||
$cnf = twilio_get_config();
|
$cnf = twilio_get_config();
|
||||||
$url = "http://demo.twilio.com/docs/voice.xml";
|
$url = "http://catswords.re.kr/ep/storage/data/voice.xml";
|
||||||
|
|
||||||
var_dump($cnf);
|
|
||||||
|
|
||||||
|
|
||||||
if(loadHelper("webpagetool")) {
|
if(loadHelper("webpagetool")) {
|
||||||
$request_url = sprintf("https://api.twilio.com/2010-04-01/Accounts/%s/Calls.json", $cnf['sid']);
|
$request_url = sprintf("https://api.twilio.com/2010-04-01/Accounts/%s/Calls.json", $cnf['sid']);
|
||||||
|
@ -67,8 +65,6 @@ if(!check_function_exists("twilio_send_voice")) {
|
||||||
"To" => $to,
|
"To" => $to,
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
var_dump($response);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user