33namespace Clue \React \Ami ;
44
55use Clue \React \Ami \Client ;
6- use Clue \React \Ami \Protocol \ActionResponse ;
7- use Clue \React \Ami \Protocol \ActionRequest ;
6+ use Clue \React \Ami \Protocol \Response ;
7+ use Clue \React \Ami \Protocol \Action ;
88use UnexpectedValueException ;
9- use Clue \React \Ami \Protocol \EventMessage ;
9+ use Clue \React \Ami \Protocol \Event ;
1010
1111class Api
1212{
@@ -20,33 +20,33 @@ public function __construct(Client $client)
2020 public function login ($ username , $ secret , $ events = null )
2121 {
2222 $ events = $ this ->boolParam ($ events );
23- return $ this ->client ->request (new ActionRequest ('Login ' , array ('UserName ' => $ username , 'Secret ' => $ secret , 'Events ' => $ events )));
23+ return $ this ->client ->request (new Action ('Login ' , array ('UserName ' => $ username , 'Secret ' => $ secret , 'Events ' => $ events )));
2424 }
2525
2626 public function logout ()
2727 {
28- return $ this ->client ->request (new ActionRequest ('Logout ' ));
28+ return $ this ->client ->request (new Action ('Logout ' ));
2929 }
3030
3131 public function agentLogoff ($ agentId , $ soft = false )
3232 {
3333 $ bool = $ soft ? 'true ' : 'false ' ;
34- return $ this ->client ->request (new ActionRequest ('AgentLogoff ' , array ('Agent ' => $ agentId , 'Soft ' => $ bool )));
34+ return $ this ->client ->request (new Action ('AgentLogoff ' , array ('Agent ' => $ agentId , 'Soft ' => $ bool )));
3535 }
3636
3737 public function ping ()
3838 {
39- return $ this ->client ->request (new ActionRequest ('Ping ' ));
39+ return $ this ->client ->request (new Action ('Ping ' ));
4040 }
4141
4242 public function coreShowChannels ()
4343 {
44- return $ this ->client ->request (new ActionRequest ('CoreShowChannels ' ));
44+ return $ this ->client ->request (new Action ('CoreShowChannels ' ));
4545 }
4646
4747 public function command ($ command )
4848 {
49- return $ this ->client ->request (new ActionRequest ('Command ' , array ('Command ' => $ command )));
49+ return $ this ->client ->request (new Action ('Command ' , array ('Command ' => $ command )));
5050 }
5151
5252 public function events ($ eventMask )
@@ -59,42 +59,42 @@ public function events($eventMask)
5959 $ eventMask = implode (', ' , $ eventMask );
6060 }
6161
62- return $ this ->client ->request (new ActionRequest ('Events ' , array ('EventMask ' => $ eventMask )));
62+ return $ this ->client ->request (new Action ('Events ' , array ('EventMask ' => $ eventMask )));
6363 }
6464
6565 public function sipPeers ()
6666 {
67- return $ this ->client ->request (new ActionRequest ('SIPPeers ' ));
67+ return $ this ->client ->request (new Action ('SIPPeers ' ));
6868 }
6969
7070 public function sipShowPeer ($ peerName )
7171 {
72- return $ this ->client ->request (new ActionRequest ('SIPshowpeer ' , array ('Peer ' => $ peerName )));
72+ return $ this ->client ->request (new Action ('SIPshowpeer ' , array ('Peer ' => $ peerName )));
7373 }
7474
7575 public function listCommands ()
7676 {
77- return $ this ->client ->request (new ActionRequest ('ListCommands ' ));
77+ return $ this ->client ->request (new Action ('ListCommands ' ));
7878 }
7979
8080 public function sendText ($ channel , $ message )
8181 {
82- return $ this ->client ->request (new ActionRequest ('Sendtext ' , array ('Channel ' => $ channel , 'Message ' => $ message )));
82+ return $ this ->client ->request (new Action ('Sendtext ' , array ('Channel ' => $ channel , 'Message ' => $ message )));
8383 }
8484
8585 public function hangup ($ channel , $ cause )
8686 {
87- return $ this ->client ->request (new ActionRequest ('Hangup ' , array ('Channel ' => $ channel , 'Cause ' => $ cause )));
87+ return $ this ->client ->request (new Action ('Hangup ' , array ('Channel ' => $ channel , 'Cause ' => $ cause )));
8888 }
8989
9090 public function challenge ($ authType = 'MD5 ' )
9191 {
92- return $ this ->client ->request (new ActionRequest ('Challenge ' , array ('AuthType ' => $ authType )));
92+ return $ this ->client ->request (new Action ('Challenge ' , array ('AuthType ' => $ authType )));
9393 }
9494
9595 public function getConfig ($ filename , $ category = null )
9696 {
97- return $ this ->client ->request (new ActionRequest ('GetConfig ' , array ('Filename ' => $ filename , 'Category ' => $ category )));
97+ return $ this ->client ->request (new Action ('GetConfig ' , array ('Filename ' => $ filename , 'Category ' => $ category )));
9898 }
9999
100100 private function boolParam ($ value )
0 commit comments