1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
service.php
См. документацию.
1<?php
8
9namespace Bitrix\Sender\Integration\VoxImplant;
10
11use Bitrix\Main\Loader;
12use Bitrix\Sender\PostingManager;
13
19{
25 public static function canUse()
26 {
27 if (!Loader::includeModule('voximplant'))
28 {
29 return false;
30 }
31 else
32 {
33 return true;
34 }
35 }
36
48 public static function send($outputNumber, $number, $text, $voiceLanguage = '', $voiceSpeed = '', $voiceVolume = '')
49 {
50 if (!static::canUse())
51 {
52 return false;
53 }
54
55 $result = \CVoxImplantOutgoing::StartInfoCallWithText(
56 $outputNumber,
57 $number,
58 $text,
59 $voiceLanguage,
60 $voiceSpeed,
61 $voiceVolume
62 );
63
64 $data = $result->getData();
65 if (!is_array($data) || !isset($data['CALL_ID']))
66 {
67 return null;
68 }
69
70 return $data['CALL_ID'];
71 }
72
81 public static function sendFile($outputNumber, $number, $fileUrl)
82 {
83 if (!static::canUse())
84 {
85 return false;
86 }
87
88 $result = \CVoxImplantOutgoing::StartInfoCallWithSound(
89 $outputNumber,
90 $number,
91 $fileUrl
92 );
93
94 $data = $result->getData();
95 if (!is_array($data) || !isset($data['CALL_ID']))
96 {
97 return null;
98 }
99
100 return $data['CALL_ID'];
101 }
102
109 public static function onInfoCallResult($callId, $callData)
110 {
111 if (!is_array($callData))
112 {
113 $callData = array();
114 }
115
116 $recipientId = CallLogTable::getRecipientIdByCallId($callId);
117 if ($recipientId && isset($callData['RESULT']) && $callData['RESULT'])
118 {
119 PostingManager::read($recipientId);
120 }
121
123 }
124
125 public static function getFormattedOutputNumber($value)
126 {
127 static $lines;
128 if (null === $lines)
129 {
130 if (static::canUse())
131 {
132 $lines = \CVoxImplantConfig::GetPortalNumbers(false);
133 }
134 else
135 {
136 $lines = [];
137 }
138 }
139
140 return $lines[$value] ?: $value;
141 }
142}
static includeModule($moduleName)
Определения loader.php:67
static removeByCallId($callId=null)
Определения calllog.php:71
static getRecipientIdByCallId($callId)
Определения calllog.php:40
static onInfoCallResult($callId, $callData)
Определения service.php:109
static send($outputNumber, $number, $text, $voiceLanguage='', $voiceSpeed='', $voiceVolume='')
Определения service.php:48
static sendFile($outputNumber, $number, $fileUrl)
Определения service.php:81
static getFormattedOutputNumber($value)
Определения service.php:125
static read($recipientId)
Определения postingmanager.php:67
$data['IS_AVAILABLE']
Определения .description.php:13
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$result
Определения get_property_values.php:14
$text
Определения template_pdf.php:79