marcelog / PAMI

PHP Asterisk Manager Interface ( AMI ) supports synchronous command ( action )/ responses and asynchronous events using the pattern observer-listener. Supports commands with responses with multiple events. Very suitable for development of operator consoles and / or asterisk / channels / peers monitoring through SOA, etc
http://marcelog.github.com/PAMI
Apache License 2.0
405 stars 282 forks source link

How can I continuously listen events from AMI ? #180

Open tuhinhossain opened 5 years ago

tuhinhossain commented 5 years ago

If I have an incoming call how can I detect that there is an incoming call on asterisk from my php server using PAMI? Please help.

I tried with $a->registerEventListener(new A());. It only listen current action event not listening other event

sigmund-avila commented 4 years ago

Hello!

You may use this code below:

`$running = true;

// Main loop while($running) { $pamiClient->process(); usleep(1000); }`

ldo commented 2 years ago

That’s busy-waiting, which can potentially be CPU-intensive.

Does PHP have any select/poll support?