root/freepbx/branches/experimental/amp_conf/htdocs/panel/api_test

Revision 2140, 0.8 kB (checked in by gregmac, 2 years ago)

Initial work on DhtmlOperatorPanel

  • Property svn:mime-type set to text/plain
  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
1 #!/usr/bin/php
2 <?php
3
4 #this script is just for testing the server.. you can just run it and see what events the client sees
5
6 include('phpagi-asmanager.php');
7
8 $man = new AGI_AsteriskManager('panel.cfg');
9
10 var_dump( $man->connect() );
11
12
13 function link_handler($e, $parameters, $server, $port) {
14         echo "Got event: ";
15         var_dump($e);
16         var_dump($parameters);
17 }
18
19 $man->add_event_handler('link', 'link_handler');
20 $man->add_event_handler('unlink', 'link_handler');
21 $man->add_event_handler('hangup', 'link_handler');
22 $man->add_event_handler('newchannel', 'link_handler');
23 $man->add_event_handler('newcallerid', 'link_handler');
24 $man->add_event_handler('newstate', 'link_handler');
25 $man->add_event_handler('newexten', 'link_handler');
26
27
28 //an->events('on');
29
30 while (1) {
31         echo "looping..";
32         $man->wait_response(5);
33 }
34 $man->disconnect();
35
36 ?>
Note: See TracBrowser for help on using the browser.
Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads