1 | <?php |
||
34 | class AmiClient |
||
35 | { |
||
36 | /** |
||
37 | * @var Client |
||
38 | */ |
||
39 | protected $amiClient = null; |
||
40 | |||
41 | /** |
||
42 | * @var WebSocket |
||
43 | */ |
||
44 | protected $wsClient; |
||
45 | |||
46 | /** |
||
47 | * @var LoopInterface |
||
48 | */ |
||
49 | protected $eventLoop; |
||
50 | |||
51 | /** |
||
52 | * @var LoggerInterface |
||
53 | */ |
||
54 | protected $logger; |
||
55 | |||
56 | /** |
||
57 | * @var ActionSender |
||
58 | */ |
||
59 | protected $actionSender = null; |
||
60 | |||
61 | 88 | public function __construct(WebSocket $wsClient, LoopInterface $eventLoop, LoggerInterface $logger) |
|
67 | |||
68 | /** |
||
69 | * Connect to AMI and start emitting events. |
||
70 | * |
||
71 | * @param string $address Example uaername:password@localhost:5038 |
||
72 | * @return \React\Promise\Promise |
||
73 | */ |
||
74 | 88 | public function connect($address) |
|
93 | |||
94 | /** |
||
95 | * @return Client |
||
96 | */ |
||
97 | public function getClient() |
||
101 | |||
102 | /** |
||
103 | * @return ActionSender |
||
104 | */ |
||
105 | public function getActionSender() |
||
109 | |||
110 | } |
||
111 |