[Asterisk-Dev] How to use PHP to monitor manager output

Tzafrir Cohen tzafrir.cohen at xorcom.com
Mon Jul 25 00:20:59 MST 2005


On Mon, Jul 25, 2005 at 07:17:03AM +0000, Obelix wrote:
> 
> I want to use PHP to monitor the * Manager output.

php is a programming language. It can be run from a number of different
platforms. Do you refer to php embedded in an apache process? an
independent script interpeter? PHP embedded in an Asterisk process ;-) ?

> 
> I have tried a PHP script, and I realise that compared with using a forwarded
> SSH terminal, the events arrived slowly in PHP. The PHP output screen could be
> idle for many of seconds, then a number of events would arrive in a batch,
> whereas in the SSH session the events appeared more or less in realtime.
> 
> The problem is I need to log the time the events happen, and the late arrival in
> PHP makes that difficult. Another thing with the manager api is it does not
> indicate the exact time the events occurred.

Why duplicate the work of the logger, then?

send the events to a specific log. And watch that log.

Something in the lines of:

  tail -f log_file | your_custom_filter

This way you can afford waiting a bit more, as you already have a
time-stamp. And thus you don't need to compete for immediate CPU access
with Asterisk itself.

-- 
Tzafrir Cohen     icq#16849755  +972-50-7952406
tzafrir.cohen at xorcom.com  http://www.xorcom.com



More information about the asterisk-dev mailing list