fix
This commit is contained in:
parent
cab583fd1c
commit
c922ef2b80
|
@ -28,7 +28,7 @@ if(!check_function_exists("twilio_send_message")) {
|
||||||
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", $sid);
|
||||||
$response = get_web_json($request_url, "post", array(
|
$response = get_web_json($request_url, "post", 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']),
|
||||||
),
|
),
|
||||||
|
@ -36,8 +36,8 @@ if(!check_function_exists("twilio_send_message")) {
|
||||||
"Body" => $message,
|
"Body" => $message,
|
||||||
"From" => $cnf['from'],
|
"From" => $cnf['from'],
|
||||||
"To" => $to,
|
"To" => $to,
|
||||||
),
|
)
|
||||||
);
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
|
@ -45,19 +45,19 @@ if(!check_function_exists("twilio_send_message")) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!check_function_exists("twilio_send_voice")) {
|
if(!check_function_exists("twilio_send_voice")) {
|
||||||
function twilio_send_voice($url="", $to) {
|
function twilio_send_voice($message="", $to) {
|
||||||
$response = false;
|
$response = false;
|
||||||
|
|
||||||
$cnf = twilio_get_config();
|
$cnf = twilio_get_config();
|
||||||
|
|
||||||
if(empty($url)) {
|
|
||||||
$url = "http://demo.twilio.com/docs/voice.xml";
|
$url = "http://demo.twilio.com/docs/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", $sid);
|
$request_url = sprintf("https://api.twilio.com/2010-04-01/Accounts/%s/Calls.json", $cnf['sid']);
|
||||||
$response = get_web_json($request_url, "post", array(
|
$response = get_web_page($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']),
|
||||||
),
|
),
|
||||||
|
@ -66,7 +66,9 @@ if(!check_function_exists("twilio_send_voice")) {
|
||||||
"From" => $cnf['from'],
|
"From" => $cnf['from'],
|
||||||
"To" => $to,
|
"To" => $to,
|
||||||
),
|
),
|
||||||
);
|
));
|
||||||
|
var_dump($response);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
|
|
|
@ -106,6 +106,7 @@ if(!check_function_exists("get_web_cmd")) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$args[] = $url;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($method == "jsondata") {
|
if($method == "jsondata") {
|
||||||
|
@ -124,6 +125,9 @@ if(!check_function_exists("get_web_cmd")) {
|
||||||
|
|
||||||
// complete and run command
|
// complete and run command
|
||||||
$cmd = trim(implode(" ", $args));
|
$cmd = trim(implode(" ", $args));
|
||||||
|
|
||||||
|
var_dump($cmd);
|
||||||
|
|
||||||
if(!empty($cmd)) {
|
if(!empty($cmd)) {
|
||||||
$output = exec_command($cmd, "shell_exec");
|
$output = exec_command($cmd, "shell_exec");
|
||||||
}
|
}
|
||||||
|
|
|
@ -425,7 +425,7 @@ if(!check_function_exists("get_bind_to_sql_select")) {
|
||||||
foreach($options['setorders'] as $opts) {
|
foreach($options['setorders'] as $opts) {
|
||||||
if(check_is_string_not_array($opts)) {
|
if(check_is_string_not_array($opts)) {
|
||||||
$s4a[] = $opts;
|
$s4a[] = $opts;
|
||||||
} elseif(check_array_length($opts, 2) == 0)) {
|
} elseif(check_array_length($opts, 2) == 0) {
|
||||||
// example: array("desc", "datetime")
|
// example: array("desc", "datetime")
|
||||||
$s4a[] = sprintf("%s %s", $opts[1], $opts[0]);
|
$s4a[] = sprintf("%s %s", $opts[1], $opts[0]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -155,7 +155,6 @@ if(!check_function_exists("read_requests")) {
|
||||||
"raw" => "_RAW",
|
"raw" => "_RAW",
|
||||||
"json" => "_JSON",
|
"json" => "_JSON",
|
||||||
"seal" => "_SEAL",
|
"seal" => "_SEAL",
|
||||||
"mixed" => "_MIXED",
|
|
||||||
);
|
);
|
||||||
foreach($aliases as $k=>$v) {
|
foreach($aliases as $k=>$v) {
|
||||||
$requests[$k] = $requests[$v];
|
$requests[$k] = $requests[$v];
|
||||||
|
@ -269,7 +268,7 @@ if(!check_function_exists("get_requested_value")) {
|
||||||
if(is_array($method)) {
|
if(is_array($method)) {
|
||||||
$req_methods = array_merge($req_methods, $method);
|
$req_methods = array_merge($req_methods, $method);
|
||||||
} else {
|
} else {
|
||||||
$req_methods[] = $mehtod;
|
$req_methods[] = $method;
|
||||||
}
|
}
|
||||||
$req_methods = array_reverse($req_methods);
|
$req_methods = array_reverse($req_methods);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user