-
Notifications
You must be signed in to change notification settings - Fork 35
/
BridgeAttendedTransfer.php
272 lines (235 loc) · 7.67 KB
/
BridgeAttendedTransfer.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
<?php
/*
* Copyright 2014 Brian Smith <wormling@gmail.com>.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace phparia\Events;
use phparia\Client\AriClient;
use phparia\Resources\Channel;
use phparia\Resources\Bridge;
/**
* Notification that an attended transfer has occurred.
*
* @author Brian Smith <wormling@gmail.com>
*/
class BridgeAttendedTransfer extends BridgeTransfer
{
/**
* @var string (optional) - Application that has been transferred into
*/
private $destinationApplication;
/**
* @var string (optional) - Bridge that survived the merge result
*/
private $destinationBridge;
/**
* @var Channel (optional) - First leg of a link transfer result
*/
private $destinationLinkFirstLeg;
/**
* @var Channel (optional) - Second leg of a link transfer result
*/
private $destinationLinkSecondLeg;
/**
* @var Bridge (optional) - Bridge that survived the threeway result
*/
private $destinationThreewayBridge;
/**
* @var Channel (optional) - Transferer channel that survived the threeway result
*/
private $destinationThreewayChannel;
/**
* @var string How the transfer was accomplished
*/
private $destinationType;
/**
* @var boolean Whether the transfer was externally initiated or not
*/
private $isExternal;
/**
* @var Channel (optional) - The channel that is replacing transferer_first_leg in the swap
*/
private $replaceChannel;
/**
* @var string The result of the transfer attempt
*/
private $result;
/**
* @var Channel (optional) - The channel that is being transferred to
*/
private $transferTarget;
/**
* @var Channel (optional) - The channel that is being transferred
*/
private $transferee;
/**
* @var Channel First leg of the transferer
*/
private $transfererFirstLeg;
/**
* @var Bridge (optional) - Bridge the transferer first leg is in
*/
private $transfererFirstLegBridge;
/**
* @var Channel Second leg of the transferer
*/
private $transfererSecondLeg;
/**
* @var Bridge (optional) - Bridge the transferer second leg is in
*/
private $transfererSecondLegBridge;
/**
* @return string (optional) - Application that has been transferred into
*/
public function getDestinationApplication()
{
return $this->destinationApplication;
}
/**
* @return string (optional) - Bridge that survived the merge result
*/
public function getDestinationBridge()
{
return $this->destinationBridge;
}
/**
* @return Channel (optional) - First leg of a link transfer result
*/
public function getDestinationLinkFirstLeg()
{
return $this->destinationLinkFirstLeg;
}
/**
* @return Channel (optional) - Second leg of a link transfer result
*/
public function getDestinationLinkSecondLeg()
{
return $this->destinationLinkSecondLeg;
}
/**
* @return Bridge (optional) - Bridge that survived the threeway result
*/
public function getDestinationThreewayBridge()
{
return $this->destinationThreewayBridge;
}
/**
* @return Channel (optional) - Transferer channel that survived the threeway result
*/
public function getDestinationThreewayChannel()
{
return $this->destinationThreewayChannel;
}
/**
* @return string How the transfer was accomplished
*/
public function getDestinationType()
{
return $this->destinationType;
}
/**
* @return boolean Whether the transfer was externally initiated or not
*/
public function isExternal()
{
return $this->isExternal;
}
/**
* @return Channel (optional) - The channel that is replacing transferer_first_leg in the swap
*/
public function getReplaceChannel()
{
return $this->replaceChannel;
}
/**
* @return string The result of the transfer attempt
*/
public function getResult()
{
return $this->result;
}
/**
* @return Channel (optional) - The channel that is being transferred to
*/
public function getTransferTarget()
{
return $this->transferTarget;
}
/**
* @return Channel (optional) - The channel that is being transferred
*/
public function getTransferee()
{
return $this->transferee;
}
/**
* @return Channel First leg of the transferer
*/
public function getTransfererFirstLeg()
{
return $this->transfererFirstLeg;
}
/**
* @return Bridge (optional) - Bridge the transferer first leg is in
*/
public function getTransfererFirstLegBridge()
{
return $this->transfererFirstLegBridge;
}
/**
* @return Channel Second leg of the transferer
*/
public function getTransfererSecondLeg()
{
return $this->transfererSecondLeg;
}
/**
* @return Bridge (optional) - Bridge the transferer second leg is in
*/
public function getTransfererSecondLegBridge()
{
return $this->transfererSecondLegBridge;
}
/**
* @param AriClient $client
* @param string $response
*/
public function __construct(AriClient $client, $response)
{
parent::__construct($client, $response);
$this->destinationApplication = $this->getResponseValue('destination_application');
$this->destinationBridge = $this->getResponseValue('destination_bridge');
$this->destinationLinkFirstLeg = $this->getResponseValue('destination_link_first_leg',
'\phparia\Resources\Channel', $client);
$this->destinationLinkSecondLeg = $this->getResponseValue('destination_link_second_leg');
$this->destinationThreewayBridge = $this->getResponseValue('destination_threeway_bridge',
'\phparia\Resources\Bridge', $client);
$this->destinationThreewayChannel = $this->getResponseValue('destination_threeway_channel',
'\phparia\Resources\Channel', $client);
$this->destinationType = $this->getResponseValue('destination_type');
$this->isExternal = $this->getResponseValue('is_external');
$this->replaceChannel = $this->getResponseValue('replace_channel', '\phparia\Resources\Channel', $client);
$this->result = $this->getResponseValue('result');
$this->transferTarget = $this->getResponseValue('transfer_target', '\phparia\Resources\Channel', $client);
$this->transferee = $this->getResponseValue('transferee', '\phparia\Resources\Channel', $client);
$this->transfererFirstLeg = $this->getResponseValue('transferer_first_leg', '\phparia\Resources\Channel',
$client);
$this->transfererFirstLegBridge = $this->getResponseValue('transferer_first_leg_bridge',
'\phparia\Resources\Bridge', $client);
$this->transfererSecondLeg = $this->getResponseValue('transferer_second_leg', '\phparia\Resources\Channel',
$client);
$this->transfererSecondLegBridge = $this->getResponseValue('transferer_second_leg_bridge',
'\phparia\Resources\Bridge', $client);
}
}