101t / elastix-api Goto Github PK
View Code? Open in Web Editor NEW☎️ Elastix and Asterisk API to make PBX easy to manage
Home Page: https://www.elastix.org/
☎️ Elastix and Asterisk API to make PBX easy to manage
Home Page: https://www.elastix.org/
Hi All,
I tried this to test in postman got the Error Key not found or key not matched can somebody please help me get this working.
With elastix 5: when i call api by postman, alway error 401 unauthorized
Can you help me, pls.
Thanks
The CDR report endpoint returns empty body even with the Elastix dashboard having a lot of data in cdr report. All the other endpoints work properly.
I tried using a combination of the filters without any luck
I am sory Iam new in elastix... I want know where is or which one menu in elastix to generate token key ? Thanks
hi
please help me how i can use this in laravel?
Is there a way to modify to work on Issabel, even if for a fee?
public function get_voicemail_report() {
$number = $_POST["number"];
# FIXME Get voicemail path from configuration file
$dir = "/var/spool/asterisk/voicemail/default";
$numbers = array_diff(scandir($dir,1), array('..', '.'));
if (isset($number) and in_array($number, $numbers)) {
$numbers = array($number);
}
foreach ( $numbers as $key => $value ) {
if (is_dir($dir . DIRECTORY_SEPARATOR . $value)) {
$dir_input = $dir . DIRECTORY_SEPARATOR . $value . DIRECTORY_SEPARATOR . "INBOX";
$files = array_diff(scandir($dir_input,1), array('..', '.'));
$filelist = array();
foreach ( $files as $key2 => $value2 ) {
#$result[$value] = array();
if (is_file($dir_input . DIRECTORY_SEPARATOR . $value2)) {
$filename = $dir_input . DIRECTORY_SEPARATOR . $value2;
$fileparts = pathinfo($filename);
if ($fileparts['extension'] == 'wav') {
$metadata = array();
$metadata_file = $dir_input . DIRECTORY_SEPARATOR . $fileparts['filename'] . ".txt";
if (is_file($metadata_file)) {
$metadata = parse_ini_file($metadata_file, true, INI_SCANNER_RAW);
}
array_push($filelist, array('file' => $value2, 'ctime' => date("Y-m-d H:i:s", filectime($filename)), 'metadata' => $metadata));
}
}
}
$result[$value] = $filelist;
}
}
header('Content-Type: application/json');
echo json_encode($result);
}
public function get_voicemail_file() {
$number = $_POST["number"];
$filename = $_POST["filename"];
# FIXME Get voicemail path from configuration file
$directory = "/var/spool/asterisk/voicemail/default";
$file = realpath($directory . DIRECTORY_SEPARATOR . $number . DIRECTORY_SEPARATOR . "INBOX" . DIRECTORY_SEPARATOR . $filename);
if(strpos($file, $directory) == 0 && strpos($file, $directory) !== false && file_exists($file) && is_file($file)){
header("Content-Disposition: attachment; filename=\"" . basename($file) . "\"");
header("Content-Length: " . filesize($file));
header("Content-Type: application/octet-stream;");
readfile($file);
} else {
header("HTTP/1.0 404 Not Found");
header("Content-Type: application/json");
echo '{"status": "File not found", "code": 404}';
}
}
Hello, how can I make the API work in issabel?
main/elastix.php
public function get_wav_file() - can take ../../../../../etc/passwd and any readable file
i check path before open file:
$name = $_GET["name"];
$directory = "/var/spool/asterisk/monitor";
$file = realpath($directory . $name);
if(strpos($file, $directory) !== false && strpos($file, $directory) == 0 && file_exists($file) && is_file($file)){
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.