115 $seenRecently =
false;
117 if($this->lastSeen instanceof
DateTime)
120 $delta = $now - $this->lastSeen->getTimestamp();
121 $seenRecently = $delta <= static::LAST_SEEN_THRESHOLD;
124 return in_array($this->state, [static::STATE_READY, static::STATE_CALLING]) && $seenRecently;
134 $this->userId = array_key_exists(
'USER_ID', $fields) ? $fields[
'USER_ID'] :
$this->userId;
135 $this->callId = array_key_exists(
'CALL_ID', $fields) ? $fields[
'CALL_ID'] :
$this->callId;
136 $this->state = array_key_exists(
'STATE', $fields) ? $fields[
'STATE'] :
$this->state;
137 $this->lastSeen = array_key_exists(
'LAST_SEEN', $fields) ? $fields[
'LAST_SEEN'] :
$this->lastSeen;
138 $this->firstJoined = array_key_exists(
'FIRST_JOINED', $fields) ? $fields[
'FIRST_JOINED'] :
$this->firstJoined;
139 $this->isMobile = array_key_exists(
'IS_MOBILE', $fields) ? $fields[
'IS_MOBILE'] ===
'Y' :
$this->isMobile;
140 $this->sharedScreen = array_key_exists(
'SHARED_SCREEN', $fields) ? $fields[
'SHARED_SCREEN'] ===
'Y' :
$this->sharedScreen;
141 $this->recorded = array_key_exists(
'RECORDED', $fields) ? $fields[
'RECORDED'] ===
'Y' :
$this->recorded;