1. Go to this page and download the library: Download tmilos/light-fsm library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$stateObject = $orm-find();
$stateMachine = new StateMachine(
function () use ($stateObject) {
return $stateObject->getValue();
},
function ($state) use ($stateObject) {
$stateObject->setValue($state);
$orm->persist($stateObject);
}
);
$phoneCall->configure(State::OFF_HOOK)
.permit(Trigger::CALL_DIALLED, State::RINGING, function ($data) { return IsValidNumber($data); })
.permit(Trigger::CALL_DIALLED, State::BEEPING, function ($data) { return !IsValidNumber($data); });