function getBoolIntValues($field, $newResa, $curResa, $price = false) { $curResa = !isset($curResa[$field]) ? 0 : getBoolValue($curResa[$field]); $newResa = getBoolValue($newResa[$field]) && ($price !== false && !is_null($price)) ? 1 : 0; return $newResa >= $curResa ? getBoolValue($newResa) : 1; }
function callAnswered($ev, $text, $idParam) { global $param; global $defDelay; $evId = $ev->GetValue($idParam); $evPeerId = $ev->GetValue("peerid"); $outbound = getBoolValue($ev->getValue($param . "_outbound"), false); $tmp = $ev->getValue($param . "_delay"); $delay = $defDelay; if (!empty($tmp)) { $val = (int) $tmp; if ($val >= 0) { $delay = $val; } } Yate::Debug($param . ": Handling " . $ev->name . " text=" . $text . " id=" . $evId . " peerid=" . $evPeerId . " outbound=" . $outbound . " delay=" . $delay); if ($outbound) { if (empty($evPeerId)) { return; } $evId = $evPeerId; } else { if (empty($evId)) { return; } } if ($delay > 0) { setupCall($evId, true, $delay, $text); } else { sendTones($evId, $text); } }