mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-02-21 18:36:31 +00:00
Use FreeSWITCH to run mkdir so it inherits its own user and group permissions.
This commit is contained in:
@@ -1956,4 +1956,28 @@ function number_pad($number,$n) {
|
||||
}
|
||||
}
|
||||
|
||||
function event_socket_mkdir($dir) {
|
||||
//if the handle does not exist create it
|
||||
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
|
||||
if (!$fp) {
|
||||
return false;
|
||||
}
|
||||
//send the mkdir command to freeswitch
|
||||
if ($fp) {
|
||||
//send the api command to check if the module exists
|
||||
$switch_cmd = "system mkdir -p '$dir'";
|
||||
$switch_result = event_socket_request($fp, 'api '.$switch_cmd);
|
||||
unset($switch_cmd);
|
||||
if (trim($switch_result) == "-ERR no reply") {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user