Simple php web page


its nice to be back in posting about questions.

does anyone know a simple php web page that would display and browseable for recorded conversation? and i like the user to listen those recorded conversation in this page.

also i would like to use this page to pop-up the name of the caller (we have records of the callers in our database server they have account and PIN so they’ll be recognized everytime they make a call) while her call is being received at adjacent hardphone

any idea please

Thanks really

Well i did a page in php for where i work if you want i can give you the source. It don’t do the pop-up thing but it could be very easy because i already put the callerid in a variable. Here what my page do :

  • Parse the /var/spool/asterisk/monitor directory and read filename.
  • You have to use my way to name your record files. (something-unixtimestamp-from-to.wav)
  • Display info in a html table. With 3 link on listen (Open a media player in the page) one delete(delete the file !) and one download.
  • Here a screenshot : … _324lo.JPG
    Its in french but it would be pretty easy for you the put in in english.

Tell me if your want it. I wont give you a lot of support because i already have alot to do at work but if you have some question i may be able to help you.

two apps … YAC and ARI … both on the wiki


thanks for immediate reply, it sound great please give me those source
so i could apply to my * system actually i already did the mixmonitor
with ${DIALEDPEERNUMBER} concanated with the ${TIMESTAMP} for the filename in wav format.

thanks in advance really.


thanks for immediate reply i will aslo see those two apps

Ok there you go :
First you have to make link of your monitor folder into your web server root directory and you also have to fix permission so apache can delete files.

You may also have to change a few things in my code because its right now is a program made for my server and it still in beta. I did change my server ip adresse for in the code but i think it would be best if you put your server ip adresse.

Good luck and if you have any question ask me.

amazing im gonna try this right away.

thank you very much i really mean it

No problem ,
By the way this is a developement version i know there is some feature missing. Like pages gestion … And if you find there is some other features missing tell me.

yes i will let you know:)
and expect me to ask some question

hi alexis

i have copy and pasted the script for parse testing when i make a link to the url i receive this error

/* Show asterisk monitor files part of phpaster made by Alexis Gingras copyright 2007 Torrent Corporation */
Fatal error: Call to a member function on a non-object in /var/www/converse.php on line 14

i guess the script call for a certain function which i dont have

likewise i dont have mysql installed in the system but postgreSQL so
how its gonna be?

[quote]/* Show asterisk monitor files part of phpaster made by Alexis Gingras copyright 2007 Torrent Corporation */
Fatal error: Call to a member function on a non-object in /var/www/converse.php on line 14

i figured it out i commented the line that connect to MySQL .

and i can play and donwload the wav file

my last problem now is the “Delete” option when i click that button
i got this error

i already set the permission with chmod 777 *.php in that folder
where i got wrong or what is lucking?

My file name was monitor.php so i hope you change the links in the page from monitor.php to converse.php.

And sorry for the mysql thing i forgot to remove it.

Ok you have to set the permission of the folder /var/spool/asterisk/monitor .

And im not sure you use the right way to name you monitor file, in dialplan it should look something like this sometext-${EPOCH}-FROM-TO.wav

Hope it help you

i spend 30 minutes on debugging but i still have the same result

here is my code in extensions.conf which i believe it work well

and my converse.php

i already fix the permission issue and i believe ${EPOCH} FROMT-TO.wav
doesnt affect the problem as i recall i can play and download only i can not delete it seems it point out the wrong file to be deleted

Strange work very well for me. Can you post the result of

ls -l /var/www/asteriskweb/monitor


ls -l /var/www/asteriskweb/monitor/

And also try this

chmod 777 /var/spool/asterisk/monitor/*

And after try to delete one of the file you already have in this folder. If it work that mean you will have to had a line like this in extensions.conf :

exten=>s,n,System(Chmod 777 /var/spool/asterisk/monitor/nameofthefile)

each time you record a call.

ok for ls -l /var/www/asteriskweb/monitor

ls -l /var/www/asteriskweb/monitor/

rendezvous:/var/www/asteriskweb# chmod 777 /var/spool/asterisk/monitor/*

…no result as in it tell that it goes well

however after those commands i tried to browse still i have those errors

i already have the system script above

but still i encounter the same issue

in anyway, i have noticed that recording the conversation will consume big hard drive space as 9 minutes eat 8MB. is there a way to reduce this
recorded files? what would be the requirements?

im not the best with permission problems. My advice would be to go on and explain on the forum your problem. I remember that one day i had the same problem and what i did is :

mkdir /monitor
chmod 777 /monitor
cp /var/spool/asterisk/monitor/* /monitor
rm -rf /var/spool/asterisk/monitor
ln -s /monitor /var/spool/asterisk/monitor

after you just have to make your link in your web directory point on the /monitor folder.

I don’t say its the best way and im sure its not … but it worked for me.

ok il try that when im in office. its 6:09 AM here in the phils and my woking office will start at 8:00 AM

how about this do you have any idea?

okey you’re right now i can delete … its great…

by the way do you have any idea how to reduce those recorded files
as iv said conversation for 9 minutes will consume 8MB. can i use wav49
or what just to minimize? hope to hear you about this.