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.

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.

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?

Then you have something miss-configured.

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…

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.

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.

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

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

/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?

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,

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.

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

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.

–> Run the amportal chown command.

I did it. Same thing…

[email protected]:~$ sudo amportal chown

SETTING FILE PERMISSIONS
Permissions OK

Do I have to do something else?

I’m still with the same. Any idea?

thanks!

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…

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 [email protected] IDENTIFIED BY ‘amp109’;” | mysql -u root
$ sudo echo “GRANT ALL PRIVILEGES ON asterisk.* TO [email protected] 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!

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

I don’t have that directory.

[email protected]:~$ sudo chown asterisk /var/lib/php/session/
chown: cannot access `/var/lib/php/session/’: No such file or directory

…¿?

Is it the problem?