Php stream file and directories

This is probably one of the “simple” answers, if you already know the answer…

I am using phpagi and trying to stream a file in a subdirectory of asterisk/sounds (e.g. asterisk/sounds/tts). The file (tts-foo.wav) exists, is owned by Asterisk, and has rw permissions for everybody. If i move it to the asterisk/sounds directory (and adjust stream_file parameter accordingly), the file plays. However, sitting in the subdirectory, it DOESN’T play.

here’s my code:
$agi->stream_file(“tts/tts-foo”,"#");

here’s the CLI output:
AGI Rx << STREAM FILE tts/tts-foo “#” 0
AGI Tx >> 200 result=0 endpos=0

what’s the correct answer?

if you put the absolute path works?

actually, yes, the full path to the file works, as does the relative path i was trying to use.

the problem, as it turns out, was that the file wasn’t playable AND it was in a directory that precluded playing. I created a new directory, moved one of the sample asterisk files into the new directory, and it worked. resampled the file i was trying to play (sox -r 8000 -c 1), and THAT worked, too.

as for the directory, the directory permissions were the same (rwx rx rx) and the ownership the same (root:root) between the two directories. i did chmod 777 on the “bad” directory, then chmod o-w and chmod g-w, and now it works. Not sure the exact issue, but whatever it was, it’s fixed now.

windows media player would play the file just fine, so i didn’t think there was an issue playing it through asterisk (doh!)