1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
service.php
См. документацию.
1
<?php
8
9
namespace
Bitrix\Sender\Integration\VoxImplant;
10
11
use Bitrix\Main\Loader;
12
use Bitrix\Sender\PostingManager;
13
18
class
Service
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
122
CallLogTable::removeByCallId
($callId);
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
}
Bitrix\Main\Loader\includeModule
static includeModule($moduleName)
Определения
loader.php:67
Bitrix\Sender\Integration\VoxImplant\CallLogTable\removeByCallId
static removeByCallId($callId=null)
Определения
calllog.php:71
Bitrix\Sender\Integration\VoxImplant\CallLogTable\getRecipientIdByCallId
static getRecipientIdByCallId($callId)
Определения
calllog.php:40
Bitrix\Sender\Integration\VoxImplant\Service\onInfoCallResult
static onInfoCallResult($callId, $callData)
Определения
service.php:109
Bitrix\Sender\Integration\VoxImplant\Service\send
static send($outputNumber, $number, $text, $voiceLanguage='', $voiceSpeed='', $voiceVolume='')
Определения
service.php:48
Bitrix\Sender\Integration\VoxImplant\Service\canUse
static canUse()
Определения
service.php:25
Bitrix\Sender\Integration\VoxImplant\Service\sendFile
static sendFile($outputNumber, $number, $fileUrl)
Определения
service.php:81
Bitrix\Sender\Integration\VoxImplant\Service\getFormattedOutputNumber
static getFormattedOutputNumber($value)
Определения
service.php:125
Bitrix\Sender\PostingManager\read
static read($recipientId)
Определения
postingmanager.php:67
$data
$data['IS_AVAILABLE']
Определения
.description.php:13
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$result
$result
Определения
get_property_values.php:14
Bitrix\Main\Service
$text
$text
Определения
template_pdf.php:79
bitrix
modules
sender
lib
integration
voximplant
service.php
Создано системой
1.14.0