'127.0.0.1', 'scheme' => 'tcp://', 'port' => 5038, 'username' => '', 'secret' => '', 'connect_timeout' => 10, 'read_timeout' => 10 ); $a = new ClientImpl($options); // Register an IEventListener: // This function is only to register the listener and start it // Check AsteriskEventsHandler class for events manipulation and control $a->registerEventListener(new AsteriskEventsHandler()); $a->open(); $time = time(); while(true){ usleep(1000); // 1ms delay $a->process(); } $a->close(); // send logoff and close the connection. } catch (Exception $e) { echo $e->getMessage() . "\n"; } return 0; } }