• Модуль: voximplant
  • Путь к файлу: ~/bitrix/modules/voximplant/classes/general/vi_user.php
  • Класс: CVoxImplantUser
  • Вызов: CVoxImplantUser::getUserOutgoingLine
static function getUserOutgoingLine($userId)
{
	$cache = BitrixMainApplication::getInstance()->getManagedCache();
	if($cache->read(self::$cacheTtl, self::$cacheTag.$userId, self::$cacheTable))
	{
		return $cache->get(self::$cacheTag.$userId);
	}
	else
	{
		$outgoingLine = '';
		$userData = BitrixMainUserTable::getRow(array(
			'select' => array('ID', 'UF_VI_BACKPHONE'),
			'filter' => array('=ID' => $userId)
		));
		if ($userData)
		{
			$outgoingLine = $userData['UF_VI_BACKPHONE'];
			if ($outgoingLine)
			{
				$portalPhones = CVoxImplantConfig::GetPortalNumbers(true, true);
				if (!isset($portalPhones[$outgoingLine]))
				{
					$outgoingLine = CVoxImplantConfig::GetPortalNumber();
				}
			}
			if ($outgoingLine == '')
			{
				$outgoingLine = CVoxImplantConfig::GetPortalNumber();
			}
		}
		$cache->set(self::$cacheTag.$userId, $outgoingLine);
		return $outgoingLine;
	}

}