AMI events not getting on web page


After trying so many time i didn’t success to get events of AMI on web while on cli terminal events are getting i have used all available function and all given solution in php.Anyone help me for this issue ???


You are asking for a solution but do not ask the question…

You are not able to do something in php, but you are not telling what you want to do.

I deduct from your post that you want to create an ami event by using php… correct?

Maybe you should give more information, than the chance of getting an answer will be a lot greater…


Hi sir i am asking about solutions if you have then shared, Actually i am asking about the events in php how i get events on web or in database,what is the process of getting events in php ami ,b’coz i have tried so many time but didn’t get any type of success,so there is a request to you please shared the method geeting events by php on web api or in database.


yes sir, i want to get the events of call originate and status of call (like answer,no answer,busy etc)


I’m confused by the references to both web pages and PHP., I will ignore the references to web pages.

From the questions we are getting from you company, I think at least half of your problem is not understanding PHP, which is not an appropriate subject for this forum.

From the Asterisk side, you need to provide manager.conf, and details of the AMI login you are attempting. You may also need to provide protocol traces showing the text that got sent between Asterisk and your PHP code.

At the moment though, I think you should be thinking in terms of bringing in a paid consultant, rather than trying to do this in house.


Mr. david i think you are not giving proper solutions or idea for this requirement that’s why you are saying about paid consultant , you all have solution / idea for this requirement but b’coz of money you are not giving.I want to take a best idea for doing this in my home, if you have then share otherwise don’t take advice to me for this for this and firstly i’ll do this in my home and if necessary then i will go for paid


Forums like this are not for giving complete solutions. They are for finding very specific faults in your own attempts or providing hints as to the information you need to design a solution for yourself.

Even to do that, the problem needs to be clearly stated, and adequate evidence of exactly how things are failing needs to be presented…

It is up to you to put events on a web page. All that Asterisk will do is sent them over a TCP stream.


These are at least some of the things you need to do in order to get help

  1. Share you manager.conf file
  2. post your PHP code to see how you re trying to catch events

due that you are doing this for learning purpose I won’t share my code with you. If you want to learn you have to write your own codes or at least to learn how to use google to search some examples.
I will give you some hints

fsockopen() to establish a connection with Asterisk
fputs() to send the needed actions, one of them WaitEvent acction
gets — to get the line from file pointer created before using the fsockopen() function
and finally echo() to print the results on your screen :grinning:


Thanks you so much sir for guidance manager.txt (7.3 KB)

sir i have tried many time but didn’t success please share some basic code so that i;ll do it


i will also try as per your instuctions and inform you once again thanks


I believe the OP is asking how to make a basic AMI connection using PHP.

The easiest option, is to find a PHP class library that supports AMI. There are many libraries to choose from. Google-fu: “asterisk ami php class library”

Most PHP class libraries will provide some basic examples, than you’ll have to figure out the AMI commands that solve the problem. ‘manager show commands’