public function GetUsers($userId = array(), $getOneUser = false, $skipUpdateAccount = false) { if (!is_array($userId)) { $userId = array($userId); } foreach ($userId as $key => $value) { $userId[$key] = intval($value); } $ViHttp = new CVoxImplantHttp(); $result = $ViHttp->GetUsers($userId, !$getOneUser); if (!$result || $ViHttp->GetError()->error) { $this->error = new CVoxImplantError(__METHOD__, $ViHttp->GetError()->code, $ViHttp->GetError()->msg); return false; } if (!$skipUpdateAccount) { $ViAccount = new CVoxImplantAccount(); $ViAccount->SetAccountName($result->account_name); $ViAccount->SetAccountBalance($result->account_balance); $ViAccount->SetAccountCurrency($result->account_currency); } return $result; }
} } } } else { if ($params['BX_TYPE'] == 'B24' && CVoxImplantHttp::RequestSign($params['BX_TYPE'], md5(implode("|", $params) . "|" . BX24_HOST_NAME)) === $hash || $params['BX_TYPE'] == 'CP' && CVoxImplantHttp::RequestSign($params['BX_TYPE'], md5(implode("|", $params))) === $hash) { if ($params["BX_COMMAND"] != "add_history" && isset($params['PHONE_NUMBER']) && isset($params['ACCOUNT_SEARCH_ID'])) { $params['PHONE_NUMBER'] = $params['ACCOUNT_SEARCH_ID']; } if ($params["BX_COMMAND"] == "add_history") { CVoxImplantHistory::WriteToLog($params, 'PORTAL ADD HISTORY'); if (isset($params['PORTAL_NUMBER']) && isset($params['ACCOUNT_SEARCH_ID'])) { $params['PORTAL_NUMBER'] = $params['ACCOUNT_SEARCH_ID']; } CVoxImplantHistory::Add($params); $ViAccount = new CVoxImplantAccount(); $ViAccount->SetAccountBalance($params["balance"]); echo "200 OK"; } elseif ($params["COMMAND"] == "IncomingGetConfig") { $result = CVoxImplantIncoming::GetConfigBySearchId($params['PHONE_NUMBER']); CVoxImplantHistory::WriteToLog($result, 'PORTAL GET INCOMING CONFIG'); if ($result['ID']) { $result = CVoxImplantIncoming::RegisterCall($result, $params); } $isNumberInBlacklist = CVoxImplantIncoming::IsNumberInBlackList($params["CALLER_ID"]); $isBlacklistAutoEnable = Bitrix\Main\Config\Option::get("voximplant", "blacklist_auto", "N") == "Y"; if ($result["WORKTIME_SKIP_CALL"] == "Y" && !$isNumberInBlacklist && $isBlacklistAutoEnable) { $isNumberInBlacklist = CVoxImplantIncoming::CheckNumberForBlackList($params["CALLER_ID"]); } if ($isNumberInBlacklist) { $result["NUMBER_IN_BLACKLIST"] = "Y"; }