[SOLVED]Sound files not playing with Background()

Upgraded from Asterisk 1.4 on CentOS 5.3 to Asterisk 10.1.3 on CentOS 6.2 on a new machine. I am still using the same dialplan. Now Asterisk will not play sound files using Background() application. Error is:

Executing [s@macro-ans_svc:3] BackGround(“DAHDI/2-1”, “/var/lib/asterisk/sounds/en/vm-goodbye”) in new stack
[Mar 3 22:28:08] WARNING[4699]: file.c:698 ast_openstream_full: File /var/lib/asterisk/sounds/en/vm-goodbye does not exist in any format
[Mar 3 22:28:08] WARNING[4699]: file.c:1021 ast_streamfile: Unable to open /var/lib/asterisk/sounds/en/vm-goodbye (format (ulaw)): No such file or directory
[Mar 3 22:28:08] WARNING[4699]: pbx.c:9939 pbx_builtin_background: ast_streamfile failed on DAHDI/2-1 for /var/lib/asterisk/sounds/en/vm-goodbye

I coded the full path and used the file vm-goodbye for testing. I have a custom main-menu_jv file that I ultimately want to use. I checked that vm-goodbye exists as a .wav and .gsm:

[root@asterisk en]# ls -l vm-goodbye.wav
-rw-r–r--. 1 root root 16104 Apr 25 2011 vm-goodbye.wav
[root@asterisk en]# pwd
/var/lib/asterisk/sounds/en

Dialplan: I updated my Macro() applications to Gosub() as documentation recommended, no luck.

[incoming_zap]
exten => s,1,Verbose(1,incoming call ZAP Exten s)
exten => s,n,Gosub(macro-ans_svc,s,1)
exten => s,n,Hangup()

[macro-ans_svc]
exten => s,1,Answer()
exten => s,n,Verbose(1,Answering Service Macro)
;exten => s,n,Background(main-menu_jv)
exten => s,n,BackGround(/var/lib/asterisk/sounds/en/vm-goodbye)
exten => s,n,WaitExten(5)
exten => s,n,Return()
exten => t,n,Hangup()

Also, my asterisk.conf shows:
astvarlibdir => /var/lib/asterisk

but if I change this to /var/lib/asterisk/sounds/en and restart Asterisk, is does not seem to change in the CLI>core show settings, command output. So I put the vm-goodbye.wav into the /var/lib/asterisk folder, and same problem.

I have searched similar problems in the forum and none of those fixed my problem. Permission level of all folders are 755.

Update: If I place the sound files into the / directory, and code the complete path in my dialplan as such:

exten => s,n,Background(/vm-goodbye)

It will work. Here is the CLI> output:

– Executing [s@macro-ans_svc:3] BackGround(“SIP/MooseLaptop-0000000a”, “/vm-goodbye”) in new stack
– <SIP/MooseLaptop-0000000a> Playing ‘/vm-goodbye.ulaw’ (language ‘en’)

Permissions on the sound files are set to 644. If I create another directory under / such as /temp_sounds/ and place the sounds there and code the proper path into the dialplan, it will not work.

Solved: I hope this can help someone else, as I fought with this all weekend.

[root@localhost selinux]# setenforce permissive
[root@localhost selinux]# sestatus
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: permissive
Mode from config file: enforcing
Policy version: 24
Policy from config file: targeted

Selinux was the problem. Also, to keep selinux permissive through a reboot, you must modify /etc/selinux/config file. I am not sure what security risks this has, so possibly adding an selinux policy for Asterisk would be better, but I haven’t figured out how to do it yet.