OpenWrt Forum Archive

Topic: openWRT does not create /var/spool/asterisk dir

The content of this topic has been archived on 30 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi,

I installed Asterisk over openWRT RC5 and was able to setup two sip phones and make calls.

I then added the voicemail package, setup mailboxes and tried to leave a voicemail message. But then I got an error about missing var/spool/asterisk directory (it couldn't write the wav file into invalid location).
The error disapeared when I manualy created the mailbox directory manualy

Why the mailbox directory have not been created ? 
* I login as root

Any help will be welcomed

Thanx

Put something like :
mkdir -p /var/spool/asterisk

in your asterisk startup script.

macsat wrote:

Put something like :
mkdir -p /var/spool/asterisk

in your asterisk startup script.

Is it a bug of openWrt/asterisk which causes asterisk not to create the right directory (as it specified in asterisk.conf)?

I'm looking for a fix that will make asterisk to create the complete path to each mailbox (/var/spool/asterisk/<mailbox_name>/INBOX) once a mailbox is defined in the voicemail.conf file as it should do it in the first place.

Regards

The problem is that the /var directory, and hence the /var/spool/asterisk dir is in the ram area of OpenWrt.

This means it is limited to the space of RAM sizewise, and that it is erased at every boot.

You should create a directory on the external storage device, and use that instead. Specify in the conf file.

macsat wrote:

The problem is that the /var directory, and hence the /var/spool/asterisk dir is in the ram area of OpenWrt.

This means it is limited to the space of RAM sizewise, and that it is erased at every boot.

You should create a directory on the external storage device, and use that instead. Specify in the conf file.

Thanx for the speed-ligth-respond!

I'm using the WRT54GS which has 8M/16M mem

Please elaborate about "You should create a directory on the external storage device...."

regards

HI,

This is what I modified to my usage, hope it helps.

peng

root@OpenWrt:/# more /etc/init.d/asterisk



#!/bin/sh

DEFAULT=/etc/default/asterisk
OPTIONS=""
[ -f $DEFAULT ] && . $DEFAULT
[ "$ENABLE_ASTERISK" = "yes" ] || exit 0

case $1 in
start)
[ -d /var/run ] || mkdir -p /var/run
[ -d /var/log/asterisk ] || mkdir -p /var/log/asterisk
[ -d /var/spool/asterisk ] || mkdir -p /var/spool/asterisk
[ -d /var/spool/asterisk/voicemail ] || mkdir -p /var/spool/asterisk/voicemail
[ -d /var/spool/asterisk/voicemail/default ] || mkdir -p /var/spool/asterisk/voicemail/default
[ -d /var/spool/asterisk/voicemail/default/2001 ] || mkdir -p /var/spool/asterisk/voicemail/default/2001
[ -d /var/spool/asterisk/voicemail/default/2006 ] || mkdir -p /var/spool/asterisk/voicemail/default/2006
[ -d /var/spool/asterisk/voicemail/default/2010 ] || mkdir -p /var/spool/asterisk/voicemail/default/2010
[ -d /var/spool/asterisk/voicemail/default/2020 ] || mkdir -p /var/spool/asterisk/voicemail/default/2020
[ -d /var/spool/asterisk/voicemail/default/2001/INBOX ] || mkdir -p /var/spool/asterisk/voicemail/default/2001/INBOX
[ -d /var/spool/asterisk/voicemail/default/2006/INBOX ] || mkdir -p /var/spool/asterisk/voicemail/default/2006/INBOX
[ -d /var/spool/asterisk/voicemail/default/2010/INBOX ] || mkdir -p /var/spool/asterisk/voicemail/default/2010/INBOX
[ -d /var/spool/asterisk/voicemail/default/2020/INBOX ] || mkdir -p /var/spool/asterisk/voicemail/default/2020/INBOX
[ -d /usr/lib/asterisk/sounds/voicemail ] || mkdir -p /usr/lib/asterisk/sounds/voicemail
[ -d /usr/lib/asterisk/sounds/voicemail/default ] || mkdir -p /usr/lib/asterisk/sounds/voicemail/default

[ -d /usr/lib/asterisk/sounds/voicemail/default/2005 ] || mkdir -p /usr/lib/asterisk/sounds/voicemail/default/2005
/usr/sbin/asterisk $OPTIONS
;;
stop)
[ -f /var/run/asterisk.pid ] && kill $(cat /var/run/asterisk.pid) >/dev/null 2>&1
;;
*)
echo "usage: $0 (start|stop)"
exit 1
esac

exit $?

TWO years,good luck fou you .

Could you kindly post the URL for downloading the appropriate LinkSys image? I googled for LinkSys and found http://www.linksys.com/download/firmware.asp?fwid=178

This does not appear to be the correct URL, however. After installing this software, the router worked fine but the ping bug seemed to be fixed. I cannot seem to locate the URL for the older versions.

Thanks,

The discussion might have continued from here.