• Модуль: voximplant
  • Путь к файлу: ~/bitrix/modules/voximplant/lib/controller/callerid.php
  • Класс: BitrixVoximplantControllerCallerId
  • Вызов: CallerId::deleteAction
public function deleteAction($phoneNumber)
{
	$row = CallerIdTable::getRow(['filter' => [
		'=NUMBER' => $phoneNumber
	]]);

	if(!$row)
	{
		$this->errorCollection[] = new Error(Loc::getMessage("VOX_CALLER_ID_NOT_FOUND"), "not_found");
		return null;
	}


	$api = new CVoxImplantHttp();
	$result = $api->delCallerID($phoneNumber);

	if(!$result)
	{
		$errorCode = $api->getError()->code;

		if($errorCode != 'CALLERID_ERROR')
		{
			$this->errorCollection[] = new Error($api->getError()->msg);
			return null;
		}
	}

	CallerIdTable::delete($row['ID']);
	ConfigTable::delete($row['CONFIG_ID']);
}