Capture events with WaitEvent and read them in real time on a web page

I’m using the AMI manager and I need access to a certain event as it happens and then display it on a web page.
I’m not sure how to do this, I have an api in which I call the action: WaitEvent, but it only brings me when I do the get method, I want to access the event instantly instead of calling the get all the time time. Any tips for that?

Are you using AMI over HTTP? That’s the only case I can think of where WaitEvent is of any use, but it is very poorly supported and hardly anyone uses it.

The normal AMI protocol will send events immediately, as long as there isn’t an active, synchronous, request in progress. You can always open a second connection, on which you make no requests, except for Login.

I need to know when a certain number is talking in a conference, this generates a talking event, this event I need to put on the screen at the moment it happens.

AMI is really for a service/application to connect to. It’s not really meant for a browser to connect to directly. The way people generally handle this is they write an application that connects to Asterisk using AMI and credentials. This application then presents a secondary interface secured using their own mechanism to outside consumers, such as using websockets for browsers.

thanks for the tips
It was of great help!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.