Event socket bug fix and more docs (#6823)

* Add documentation to methods. Use is_resource for added type detection

* Allow connect to specify timeout in microseconds with default 30,000

* Update calling mechanism for event sockets

* Update project for new singleton event sockets

* remove unused variable

* catch errors on closing the socket
This commit is contained in:
frytimo
2023-12-02 17:16:18 -07:00
committed by GitHub
parent 44567f7a05
commit 3a4c2f72e2
74 changed files with 1620 additions and 1533 deletions
@@ -383,11 +383,11 @@
$domain_name = $database->select($sql, $parameters, 'column');
//send the message waiting status
$fp = event_socket_create();
if ($fp) {
$esl = event_socket::create();
if ($esl->is_connected()) {
//$switch_cmd .= "luarun app.lua voicemail mwi ".$voicemail_id."@".$domain_name;
$switch_cmd .= "luarun app/voicemail/resources/scripts/mwi_notify.lua ".$voicemail_id." ".$domain_name." 0 0";
$switch_result = event_socket_request($fp, 'api '.$switch_cmd);
$switch_cmd .= "luarun app/voicemail/resources/scripts/mwi_notify.lua $voicemail_id $domain_name 0 0";
$switch_result = event_socket::api($switch_cmd);
echo $switch_cmd."\n";
}
else {
@@ -517,7 +517,7 @@
unset($mail);
//save output to
//$fp = fopen(sys_get_temp_dir()."/mailer-app.log", "a");
//$esl = fopen(sys_get_temp_dir()."/mailer-app.log", "a");
//prepare the output buffers
//ob_end_clean();
@@ -532,7 +532,7 @@
//ob_end_clean(); //clean the buffer
//fwrite($fp, $content);
//fclose($fp);
//fwrite($esl, $content);
//fclose($esl);
?>