Closed vsc55 closed 6 months ago
Hi @billsimon,
About this: https://github.com/simontelephonics/smsconnector/blob/c6ef6a5acb9c44225eb96af338de6dcff289de56/sipsmsdaemon.php#L37-L39
Did you try something like this?
... if ($astman->connected()) { $smsconnector = \FreePBX::Create()->Smsconnector(); $astman->Events('on'); $astman->add_event_handler('UserEvent', function($event, $data, $server, $port) use (&$smsconnector) { userEventHandler($data, $smsconnector); }); } ... function userEventHandler($data, $smsconnector) { ... }
What do you think?
I found a better way to handle messages that does not require a long running process so this code is going to go away entirely in the next release (soon). Thank you for the help!
Hi @billsimon,
About this: https://github.com/simontelephonics/smsconnector/blob/c6ef6a5acb9c44225eb96af338de6dcff289de56/sipsmsdaemon.php#L37-L39
Did you try something like this?
What do you think?