- Модуль: imconnector
- Путь к файлу: ~/bitrix/modules/imconnector/lib/provider/base/input.php
- Класс: Bitrix\ImConnector\Provider\Base\Input
- Вызов: Input::routing
public function routing($command, $connector, $line = null, $data = []): Result
{
$result = clone $this->result;
if ($result->isSuccess())
{
if (empty($command))
{
$result->addError(new Error(
Loc::getMessage('IMCONNECTOR_NOT_SPECIFIED_CORRECT_COMMAND'),
Library::ERROR_IMCONNECTOR_NOT_SPECIFIED_CORRECT_COMMAND,
__METHOD__,
[
'$command' => $command,
'$connector' => $connector,
'$line' => $line,
'$data' => $data
]
));
}
if (
empty($connector)
&& Connector::isConnector($connector)
)
{
$result->addError(new Error(
Loc::getMessage('IMCONNECTOR_NOT_SPECIFIED_CORRECT_CONNECTOR'),
Library::ERROR_IMCONNECTOR_NOT_SPECIFIED_CORRECT_CONNECTOR,
__METHOD__,
[
'$command' => $command,
'$connector' => $connector,
'$line' => $line,
'$data' => $data
]
));
}
}
if ($result->isSuccess())
{
switch ($command)
{
case 'testConnect'://Test connection
$result = $this->receivingTestConnect();
break;
case 'receivingMessage'://To receive the message
$result = $this->receivingMessage();
break;
case 'receivingStatusDelivery'://To receive a delivery status
$result = $this->receivingStatusDelivery();
break;
case 'receivingStatusReading'://To receive the status of reading
$result = $this->receivingStatusReading();
break;
case 'receivingError':
$result = $this->receivingError();
break;
case 'receivingStatusBlock':
$result = $this->receivingStatusBlock();
break;
//The disconnection of the connector due to the connection with the specified data on a different portal or lines
case 'deactivateConnector':
$result = $this->deactivateConnector();
break;
default:
$result = $this->receivingDefault();
}
}
return $result;
}