9namespace Bitrix\Sender\Integration\VoxImplant;
11use Bitrix\Main\Localization\Loc;
12use Bitrix\Main\Web\HttpClient;
14use Bitrix\Sender\Message;
15use Bitrix\Sender\Transport;
16use Bitrix\Sender\Recipient;
18Loc::loadMessages(__FILE__);
26 const CODE = self::CODE_AUDIO_CALL;
49 return Loc::getMessage(
'SENDER_INTEGRATION_AUDIOCALL_TRANSPORT_NAME');
99 $clientOptions =
array(
100 'waitResponse' =>
false,
101 'socketTimeout' => 5,
103 $this->httpClient =
new HttpClient($clientOptions);
104 $this->httpClient->setTimeout(1);
118 $outputNumber =
$message->getConfiguration()->get(
'OUTPUT_NUMBER');
120 $fileJson =
$message->getConfiguration()->get(
'AUDIO_FILE');
122 $audio = (
new Audio())
123 ->withJsonString($fileJson)
124 ->withMessageCode(
$message->getCode());
129 $audio->getFileUrl(
true)
132 if ($callId &&
$message->getRecipientId())
134 CallLogTable::add(
array(
135 'CALL_ID' => $callId,
136 'RECIPIENT_ID' =>
$message->getRecipientId()
163 $fileJson =
$message->getConfiguration()->get(
'AUDIO_FILE');
166 $audio = (
new Audio())
167 ->withJsonString($fileJson)
168 ->withMessageCode(
$message->getCode());
170 $length = $audio->getDuration();
172 $length = $length ?: 20;
176 return round(($length + $magic) / $limit);
200 if ($this->limiter ===
null)
202 $this->limiter =
new Limiter();
static sendFile($outputNumber, $number, $fileUrl)
getDuration(Message\Adapter $message=null)
getSupportedRecipientTypes()
send(Message\Adapter $message)
getLimiters(Message\iBase $message=null)
saveConfiguration(Message\Configuration $configuration)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)