• Модуль: imopenlines
  • Путь к файлу: ~/bitrix/modules/imopenlines/lib/im.php
  • Класс: BitrixImOpenLinesIm
  • Вызов: Im::addMessageLiveChat
static function addMessageLiveChat($fields)
{
	$result = false;

	if(Loader::includeModule('im'))
	{
		$fields['MESSAGE_TYPE'] = IM_MESSAGE_CHAT;

		$result = CIMMessenger::Add($fields);
		if (!$result)
		{
			$errorMessage = 'Unknown error';
			if ($e = $GLOBALS['APPLICATION']->GetException())
			{
				$errorMessage = $e->GetString();
			}
			BitrixImOpenLinesLog::write([$fields, $errorMessage], 'DEBUG SESSION');
		}
	}

	return $result;
}