IVR and Sounds

Running Asterisk 1.8.10.1 using FreePBX 2.11 core modules. I am running the web server under the username and group of www-data (web server is Lighttpd) and Asterisk is running under username of asterisk and group of www-data by modifying the asterisk.conf file with the following:

runuser = asterisk ; The user to run as.
rungroup = www-data ; The group to run as.

; Changing the following lines may compromise your security.
;[files]
astctlpermissions = 0660
astctlowner = root
astctlgroup = www-data
;astctl = asterisk.ctl

I updated the /var/lib/asterisk and /var/www/html/ directory to support asterisk:www-data owner and group ACLs.

I uploaded a sound recording in GSM WAV 8bit mono and it uploads the file to /var/lib/asterisk/sounds/custom/GREETING.wav.

I updated the IVR so that this recording is used but no luck on hearing it. I turned on verbose logging by running asterisk -rvvvvvvv and I get this message:

-- Executing [[email protected]:11] ExecIf("SIP/fpbx-1-f5c2bc0a-00000008", "1?Background(custom/GREETING)") in new stack

[2013-08-02 23:04:04] WARNING[28874]: file.c:663 ast_openstream_full: File custom/GREETING does not exist in any format
[2013-08-02 23:04:04] WARNING[28874]: file.c:958 ast_streamfile: Unable to open custom/GREETING (format 0x4 (ulaw)): No such file or directory
[2013-08-02 23:04:04] WARNING[28874]: pbx.c:9781 pbx_builtin_background: ast_streamfile failed on SIP/fpbx-1-f5c2bc0a-00000008 for custom/GREETING

What am I missing? Perhaps the encoding is not correct or file permissions? Maybe the file isn’t in the correct location? Tried everything I can think of, any help would be greatly appreciated.

  • Gabe

be careful with case and coding .WAV is not .wav, .gsm is not .GSM and neither are .wav

file (yourfile)

will show you what it really is.

e.g.

file /var/lib/asterisk/sounds/you-seem-impatient.wav

real .wav file will show
RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 8000 Hz

(it must be owned and readable by asterisk )

Thanks for the tip. Here’s what it spits back-

[email protected]:/usr/share# file /var/lib/asterisk/sounds/custom/GREETING.wav
/var/lib/asterisk/sounds/custom/GREETING.wav: RIFF (little-endian) data, WAVE audio, GSM 6.10, mono 8000 Hz
[email protected]:/usr/share# ls -l /var/lib/asterisk/sounds/custom/
total 24
-rw-rw-r-- 1 asterisk asterisk 22225 Aug 2 21:50 GREETING.wav
[email protected]:/usr/share#

I did install asterisk from apt-get and noticed that the default directories that are in the asterisk.conf file are these…

directories
astetcdir => /etc/asterisk
astmoddir => /usr/lib/asterisk/modules
astvarlibdir => /var/lib/asterisk
astdbdir => /var/lib/asterisk
astkeydir => /var/lib/asterisk
astdatadir => /usr/share/asterisk
astagidir => /usr/share/asterisk/agi-bin
astspooldir => /var/spool/asterisk
astrundir => /var/run/asterisk
astlogdir => /var/log/asterisk
astlogdir => /var/log/asterisk

I even copied the file to the /usr/share/asterisk/sounds/custom directory, although uploading from the web page puts it into the /var/lib/asterisk/sounds/custom folder…

Your .wav file need to return:-
and you will need to present it as what it really is, gsm,WAV, whateve a .wav file must return

RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 8000 Hz

if it doesn’t it is not a wav and asterisk will choke

I suggest you do not use “apt-get” in a debian like environement, it’s assumptions and directives are mostly alien to the FreePBX scripts, try the debian based recipes in the wiki first.

[email protected]:/var/lib/asterisk/sounds/custom# file GREETING.wav
GREETING.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 8000 Hz

Just updated the file and no luck, pretty sure its failing because it doesn’t know where the custom/GREETING file is… I’ll try the debian wiki. Have any good links?

I updated the asterisk.conf file to point to these locations and it works! Good to go. Thanks!

  • Gabe
    [directories]
    astetcdir => /etc/asterisk
    astmoddir => /usr/lib/asterisk/modules
    astvarlibdir => /var/lib/asterisk
    astdbdir => /var/lib/asterisk
    astkeydir => /var/lib/asterisk
    ;astdatadir => /usr/share/asterisk
    astdatadir => /var/lib/asterisk
    astagidir => /usr/share/asterisk/agi-bin
    astspooldir => /var/spool/asterisk
    astrundir => /var/run/asterisk
    astlogdir => /var/log/asterisk