Cannot access recordings - 404 Error

Hello -

Recently I have been unable to download any recordings. Every time I click on the download link, I get a 404 error. This has always worked in the past and I have made no recent updates to my system (nor is there anything to update, presently).

The 404 error only happens when the “recindex” variable is passed. If I remove it, the page is blank and no error presents. I think this might be a PHP session issue, but I’ve cleared all session info and even rebooted the server, all to no avail.

[edit] This happens across multiple browsers on multiple computers, so it’s not a local thing either. [/edit]

Anyone else have any other ideas I can try?

Thanks in advance,
Jay

Bump.

Anyone?

A 404 error means “file not found”.

Look at the URL for the recording and check to make sure the file you are looking for is actually at the location. While everyone would agree that it should be there, obviously there’s a problem with the pointer.

The audio file is there as is the script file itself (as I said the 404 error only occurs when passing the recindex variable).

I think it’s a permissions or session issue, but I cannot seem to resolve it.

OK, so are you using the “asterisk” user as the owner of the Web Server, or are you using different users (webuser for the web server and asterisk for the phone system)?

Yes. Apache is running as asterisk.

[[email protected] ~]# ps -ef | egrep '(httpd|apache2|apache)' | grep -v `whoami` | grep -v root | head -n1 | awk '{print $1}'
asterisk

posting the output from 'ps -ef | egrep ‘(httpd|apache2|apache)’ ’ would have been just fine. That would have actually given us some information.

I can’t read your mind or access your system to tell you what is going on. Did you look at the recording files to see who they are owned by? If the answer is “asterisk”, then this isn’t a permissions problem. If they are not owned by asterisk, then that’s your problem.

I don’t see how this can be a session issue. Enlighten us.

I still suspect a problem with your directory tree starting at /var/www/html (which is where the recordings “link” starts). Since you can’t (or won’t) actually tell us what is not working (only that it doesn’t), I’m afraid no one is going to be able to help you more than the generic “Good luck.”

Here’s the output you requested:

[[email protected] ~]#  ps -ef | egrep '(httpd|apache2|apache)'
root      1604     1  0 Sep26 ?        00:00:10 /usr/sbin/httpd
root      2647  3095  0 10:29 pts/0    00:00:00 egrep (httpd|apache2|apache)
asterisk  7177  1604  0 Oct02 ?        00:00:00 /usr/sbin/httpd
asterisk  7180  1604  0 Oct02 ?        00:00:00 /usr/sbin/httpd
asterisk  7181  1604  0 Oct02 ?        00:00:00 /usr/sbin/httpd
asterisk  7182  1604  0 Oct02 ?        00:00:00 /usr/sbin/httpd
asterisk  7183  1604  0 Oct02 ?        00:00:00 /usr/sbin/httpd
asterisk  7184  1604  0 Oct02 ?        00:00:00 /usr/sbin/httpd
asterisk  7185  1604  0 Oct02 ?        00:00:00 /usr/sbin/httpd
asterisk  7186  1604  0 Oct02 ?        00:00:00 /usr/sbin/httpd

Recording files are all owned by asterisk (all in /var/spool/asterisk/monitor/), so I agree it doesn’t appear to be a permissions problem (unless I’m missing something).

I believe it’s a session issue because the the 404 error only occurs when I pass the script a GET variable, and the variable is a generic reference which couldn’t possibly reference a file directly. I suspect session variables are being stored and the ‘recindex’ value is part of the session array.

I did some quick detective work and ‘audio.php’ references a session variable to get the path of the recordings:

 $path = $_SESSION['ari_user']['recfiles'][$_GET['recindex']];

I altered the script to output the entire $_SESSION array and unfortunately, there’s no key named ‘ari_user’. That would certainly cause my problems.

I’m going to dig deeper into some of the included files in that script, but I’m not sure why it all of a sudden changed without my making any changes to my box.

I do appreciate your help so far. :slight_smile:

OK - you actually said what I was driving at, so I don’t think you’re seeing it.

You check the files in /var/spool/asterisk/monitor/
When you check the files through the web browser, you are checking /var/www/html/{something}.

Unless you can see the link (and have follow-links enabled) from inside the /var/www/html/{something} tree, you are going to get a 404 error.

You can double check your path names by looking at the /var/log/httpd/error_log and seeing what file the system is looking for. As a matter of course, it will tell you the file name it couldn’t find relative to the /var/www/html directory. Check for imporper permissions on the link and that the link from that web directory points to the /var/spool/asterisk/monitor/ directory.