如何在PAMI中获取事件

I successfully insttalled PAMI in my server where asterisk is setup. And i wrote a new php file which

class A implements IEventListener
{
    public function handle(EventMessage $event)
    {
        print_r("Inside");
    }
}

$pamiClient = new PamiClient($pamiClientOptions);


$pamiClient->registerEventListener(new A());
$pamiClient->open();


$running = true;
while($running) {
    $pamiClient->process();
    usleep(1000);
    }
$pamiClient->close();

But when i generate a call it doesnot catch the event. How can i know it is connected with asterisk, and how can i test this? Iam justng running this php file .

How i can know it connected to asterisk:

tcpdump -vv dst port 5038

how can i test this

Use debugger.