404 not found for download voicemail and call monitor

26 posts / 0 new
Last post
sadzas
sadzas's picture
404 not found for download voicemail and call monitor

Hi guys

Asterisk version: 1.4.22
FreePBX version: 2.4.1.2

I really need help with this. I tried to change the code from audio.php and recording_popup.php but there was no change in the results.

I already tried this:
http://www.freepbx.org/trac/ticket/2565

I have a new Asterisk and FreePBX refresh install. Where do I have to watch to fix this?

thanks in advance.

fskrotzki
fskrotzki's picture
How about you start by

How about you start by upgrading to the latest FreePBX and test it there. Many of those fixes were rolled out in the 2.5 branch so the problem should be all gone now.

sadzas
sadzas's picture
Ok, thanks but, same

Ok, thanks but, same problem.

FreePBX 2.5.1.1

When I want to hear my voicemail or download it from User Portal, the "404 Not found" error appears.

There is some patch for this?

fskrotzki
fskrotzki's picture
Then you have something

Then you have something miss-configured.

sadzas
sadzas's picture
I don't changed anything. Is

I don't changed anything. Is it possible that a firewall it s give me problems? I don't think so, but in this point, I don't know what else to think...

fskrotzki
fskrotzki's picture
404 means that the the link

404 means that the the link that you clicked on does not exist. So either the files are missing, the link that it is pointing to does not exist at that location, or they were not moved to the right location on install.

without knowing the details of your system, it's OS, (hand installed, distro, etc). We don't know if you did something different then normal on setting up your apache or /var/www/html/ directories.

Maybe the files exist but you don't have permissions set.

More details will lead to more potential answers.

sadzas
sadzas's picture
Ok, thanks fskrotzki! you're

Ok, thanks fskrotzki! you're right!

OS: Ubuntu 8.04
Asterisk: 1.4.22

Directory Monitor: /var/spool/asterisk/monitor
Directory Voicemail: /var/spool/asterisk/voicemail/device/xxx
Directory php files: /var/www/html/recordings/misc (audio; recording_popup)

Apache: by default.
(In fact, at most everything is by default)

Both "/var/spool/asterisk/monitor" and "/var/www/html/recordings/misc" has full permissions.

thanks in advance.

fskrotzki
fskrotzki's picture
so each of these directories

so each of these directories have owner and group of asterisk correct? and apache is running as the user asterisk? If not that can be the issue right there.

Use this command to reset the permissions: amportal chown

bendig
bendig's picture
I had the same Problem. You

I had the same Problem. You must patch the asterisk-sources. Remove all chown's in the app_voicemail.c and compile again. So it works by me with FPBX.
Regards Frank

fskrotzki
fskrotzki's picture
no you don't if you follow

no you don't if you follow the directions for properly setting up asterisk to run as the asterisk user. If you which to discuss your issues with hacking asterisk for your purposes please take that up with the asterisk development team.

Yes it would be nice to not have that as a constraint but they do for their reasons and that is outside of FreePBX.

If asterisk is configured properly as it is documented to be then FreePBX works just fine as tens of thousands of installations can attest to.

sadzas
sadzas's picture
# /etc/init.d/apache2,

# /etc/init.d/apache2, /etc/logrotate.d/apache2, etc.
export APACHE_RUN_USER=asterisk
export APACHE_RUN_GROUP=asterisk
export APACHE_PID_FILE=/var/run/apache2.pid

The same happens when I want to view my panel:

"Internet explorer can not show.... etc etc"

iframe width="97%" height="600" frameborder="0" align="top" src="../panel/index_amp.php?context='.$deptname.'">'.
/div>';

Everything else is OK! I don't understand.

Should I use the command "amportal chown"? Why?

fskrotzki
fskrotzki's picture
sadzas, The "amportal chown"

sadzas,

The "amportal chown" command will go through all the directories that asterisk and FreePBX use setting the permissions to what they should be based on a properly configured system following the asterisk and FreePBX setup documentation.

The owner and group permissions should be the user asterisk (as you have found in the file above). Apache should also be run as the user asterisk. Configuring it to run as another user has implications, and quirks which have to be handed very carefully. If that is done finding support for it here on the FreePBX boards while possible limits the number of people who can help you properly versus doing it the proper documented way.

sadzas
sadzas's picture
Thanks fskrotzki, I followed

Thanks fskrotzki, I followed the FreePBX documentation for his correct installation. May be does exist another documentation for UBUNTU server, I don't know, or may be the permissions are wrong and is just that.

What kind of permissions should I have to define for this? This is what I have:

$ sudo chown asterisk /var/run/asterisk
$ sudo chgrp asterisk /var/run/asterisk
$ sudo chmod 770 /var/run/asterisk
$ sudo chown asterisk:asterisk /var/run/asterisk
$ sudo chown -R asterisk:asterisk /var/www/
$ sudo chmod -R 775 /var/www
$ sudo chown -R asterisk:asterisk /var/log/asterisk
$ sudo chmod -R 775 /var/log/asterisk
$ sudo chown -R asterisk:asterisk /var/lib/asterisk
$ sudo chmod -R 775 /var/lib/asterisk
$ sudo chown -R asterisk:asterisk /usr/lib/asterisk
$ sudo chmod -R 775 /usr/lib/asterisk
$ sudo chown -R asterisk:asterisk /etc/asterisk
$ sudo chmod -R 775 /etc/asterisk
$ sudo chown –R asterisk:asterisk /etc/amportal.conf
$ sudo chmod 775 /etc/amportal.conf

What is missing?

(Remember please: Everything is by default;
user: asterisk
group: asterisk)

thanks in advance

fskrotzki
fskrotzki's picture
Which FreePBX documentation

Which FreePBX documentation for installation? From the documentation section, you select installation and there is documentation for Ubuntu 6 and 7.04 but NOT 8.04.

Run the amportal chown command.

sadzas
sadzas's picture
--> Run the amportal chown

--> Run the amportal chown command.

I did it. Same thing...

asterisco@asterisco:~$ sudo amportal chown

SETTING FILE PERMISSIONS
Permissions OK

Do I have to do something else?

sadzas
sadzas's picture
I'm still with the same. Any

I'm still with the same. Any idea?

thanks!

fskrotzki
fskrotzki's picture
Which FreePBX documentation

Which FreePBX documentation for installation? From the documentation section, you select installation and there is documentation for Ubuntu 6 and 7.04 but NOT 8.04.

you didn't answer the question so I can't review the directions you used to see if there is anything. It's all in the details and providing information...

sadzas
sadzas's picture
I'm sorry! This is what I

I'm sorry! This is what I have been following:

$ sudo apt-get install libxml2 libxml2-dev libtiff4 libtiff4-dev apache2 mysql-client mysql-server php5-cli php5 php-pear php5-mysql php5-gd perl libaudiofile-dev curl sox unzip lynx ncftp mime-construct libphp-jpgraph lame liblame-dev

$ sudo pear install DB

$ sudo nano /etc/apache2/envvars
(I changed user and group)

$ sudo mysqladmin create asterisk
$ sudo mysqladmin create asteriskcdrdb

$ sudo mysql -u root asteriskcdrdb < /usr/src/freepbx-2.4.0/SQL/cdr_mysql_table.sql

$ sudo mysql -u root asterisk < /usr/src/freepbx-2.4.0/SQL/newinstall.sql

$ sudo echo "GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY 'amp109';" | mysql -u root
$ sudo echo "GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY 'amp109';" | mysql -u root

$ sudo chown -R asterisk:asterisk /var/www/
$ sudo chmod -R 775 /var/www
$ sudo chown -R asterisk:asterisk /var/log/asterisk
$ sudo chmod -R 775 /var/log/asterisk
$ sudo chown -R asterisk:asterisk /var/lib/asterisk
$ sudo chmod -R 775 /var/lib/asterisk
$ sudo chown -R asterisk:asterisk /usr/lib/asterisk
$ sudo chmod -R 775 /usr/lib/asterisk
$ sudo chown -R asterisk:asterisk /etc/asterisk
$ sudo chmod -R 775 /etc/asterisk

$ sudo nano /etc/asterisk/asterisk.conf
(I changed astrundir...)

$ sudo ./install_amp --username=asteriskuser --password=amp109

$ sudo chown –R asterisk:asterisk /etc/amportal.conf
$ sudo chmod 775 /etc/amportal.conf
$ sudo nano /etc/amportal.conf
(AUTHTYPE=database)

$ sudo nano /var/www/html/admin/views/panel.php
(src="../panel/index_amp.php?)

What is wrong?

Thanks!

fskrotzki
fskrotzki's picture
also do chown asterisk

also do chown asterisk /var/lib/php/session/

sadzas
sadzas's picture
I don't have that

I don't have that directory.

asterisco@asterisco:~$ sudo chown asterisk /var/lib/php/session/
chown: cannot access `/var/lib/php/session/': No such file or directory

..¿?

Is it the problem?

fskrotzki
fskrotzki's picture
Take a look around ubuntu

Take a look around ubuntu probably has it located someplace slightly different.

bendig
bendig's picture
404 and so...

hello,
at first buy a book about apache2, read it,
then patch the app_voicemail und than install Quicktimeplayer at your Windows..

fskrotzki
fskrotzki's picture
bendig, You really seem

bendig,

You really seem stuck on hacking asterisk because you don't like that it insists on running apache as asterisk. Please this is not the proper site or forum for this. Take it up with the asterisk developers (I really hope you win as it would address other issues), but here we try and work within the confines of now a required piece of software is needs to be installed. I has a lot to do with people can normally barely follow directions and hacking and patching asterisk to make it work the way you keep insisting on going is not something most can handle.

sadzas has asterisk and apache installed in a proper way as asterisk needs, something just got missed, or something new has happened (a update chaning something) that has not yet been addressed.

sadzas
sadzas's picture
Thanks fskrotzki for your

Thanks fskrotzki for your help.

I really don't know what I have to looking for, because I searched "session" and I didn't find it.

Actually, I just find this (searching PHP):

asterisco@asterisco:~$ sudo find / -name php
/etc/alternatives/php
/var/lib/dpkg/alternatives/php
/usr/bin/php
/usr/share/php

sasargen
sasargen's picture
Session files are in /var/lib/php5 by default

Session files for Ubuntu 8.04 are in /var/lib/php5/ by default. This is set in /etc/php5/apache2/php.ini. Look for session.save_path = .

sqlguy
sqlguy's picture
page.recordings.php

I bet page.recordings.php is missing from your recordings module folder. This happened to me on Elastix. No clue why. Happened to over 10 installs nearly the same time.