• Модуль: voximplant
  • Путь к файлу: ~/bitrix/modules/voximplant/lib/controller/callerid.php
  • Класс: BitrixVoximplantControllerCallerId
  • Вызов: CallerId::requestVerificationAction
public function requestVerificationAction($phoneNumber)
{
	$number = Parser::getInstance()->parse($phoneNumber);

	if(!$number->isValid())
	{
		$this->errorCollection[] = new Error("", "wrong_number");
		return null;
	}
	$normalizedNumber = $number->format(Format::E164);
	// remove +
	$normalizedNumber = mb_substr($normalizedNumber, 1);

	$apiClient = new CVoxImplantHttp();
	$result = $apiClient->verifyCallerID($normalizedNumber);
	if(!$result)
	{
		$this->errorCollection[] = new Error($apiClient->GetError()->msg, $apiClient->GetError()->code);
		return null;
	}

	return true;
}