Hi i use an Lantiq device with POTS and Asterisk 13 (different versions) since years
And i can not remember on this problem, but i have a littlebit modifie my configuration, because i do not want to run the asterisk program with root rights.
I use the user asterisk and group asterisk
first i have add asterisk to the password files:
/etc/passwd
...
asterisk:x:1000:1000::/home/asterisk:/bin/false
/etc/group
...
asterisk:x:1000:
/etc/shadow
...
asterisk:x:0:0:99999:7:::
/etc/asterisk/asterisk.conf
[directories]
astetcdir => /etc/asterisk
astmoddir => /usr/lib/asterisk/modules
astvarlibdir => /usr/lib/asterisk
astdbdir => /usr/lib/asterisk
astkeydir => /usr/lib/asterisk
astdatadir => /usr/lib/asterisk
astagidir => /usr/lib/asterisk/agi-bin
astspooldir => /var/spool/asterisk
astrundir => /var/run/asterisk
astlogdir => /var/log/asterisk
astsbindir => /usr/sbin
[options]
verbose = 3
debug = 3
;alwaysfork = yes ; Same as -F at startup.
;nofork = yes ; Same as -f at startup.
;quiet = yes ; Same as -q at startup.
;timestamp = yes ; Same as -T at startup.
;execincludes = yes ; Support #exec in config files.
;console = yes ; Run as console (same as -c at startup).
;highpriority = yes ; Run realtime priority (same as -p at
; startup).
;initcrypto = yes ; Initialize crypto keys (same as -i at
; startup).
;nocolor = yes ; Disable console colors.
;dontwarn = yes ; Disable some warnings.
;dumpcore = yes ; Dump core on crash (same as -g at startup).
;languageprefix = yes ; Use the new sound prefix path syntax.
;systemname = my_system_name ; Prefix uniqueid with a system name for
; Global uniqueness issues.
;autosystemname = yes ; Automatically set systemname to hostname,
; uses 'localhost' on failure, or systemname if
; set.
;mindtmfduration = 80 ; Set minimum DTMF duration in ms (default 80 ms)
; If we get shorter DTMF messages, these will be
; changed to the minimum duration
;maxcalls = 10 ; Maximum amount of calls allowed.
;maxload = 0.9 ; Asterisk stops accepting new calls if the
; load average exceed this limit.
;maxfiles = 1000 ; Maximum amount of openfiles.
;minmemfree = 1 ; In MBs, Asterisk stops accepting new calls if
; the amount of free memory falls below this
; watermark.
;cache_record_files = yes ; Cache recorded sound files to another
; directory during recording.
;record_cache_dir = /tmp ; Specify cache directory (used in conjunction
; with cache_record_files).
;transmit_silence = yes ; Transmit silence while a channel is in a
; waiting state, a recording only state, or
; when DTMF is being generated. Note that the
; silence internally is generated in raw signed
; linear format. This means that it must be
; transcoded into the native format of the
; channel before it can be sent to the device.
; It is for this reason that this is optional,
; as it may result in requiring a temporary
; codec translation path for a channel that may
; not otherwise require one.
;transcode_via_sln = yes ; Build transcode paths via SLINEAR, instead of
; directly.
runuser = asterisk ; The user to run as.
rungroup = asterisk ; The group to run as.
;lightbackground = yes ; If your terminal is set for a light-colored
; background.
;forceblackbackground = yes ; Force the background of the terminal to be
; black, in order for terminal colors to show
; up properly.
;defaultlanguage = en ; Default language
documentation_language = en_US ; Set the language you want documentation
; displayed in. Value is in the same format as
; locale names.
;hideconnect = yes ; Hide messages displayed when a remote console
; connects and disconnects.
;lockconfdir = no ; Protect the directory containing the
; configuration files (/etc/asterisk) with a
; lock.
;stdexten = gosub ; How to invoke the extensions.conf stdexten.
; macro - Invoke the stdexten using a macro as
; done by legacy Asterisk versions.
; gosub - Invoke the stdexten using a gosub as
; documented in extensions.conf.sample.
; Default gosub.
live_dangerously = no ; Enable the execution of 'dangerous' dialplan
; functions from external sources (AMI,
; etc.) These functions (such as SHELL) are
; considered dangerous because they can allow
; privilege escalation.
; Default yes, for backward compatability.
; Changing the following lines may compromise your security.
[files]
astctlpermissions = 0660
astctlowner = nobody
astctlgroup = nogroup
astctl = asterisk.ctl
[compat]
pbx_realtime=1.6
res_agi=1.6
app_set=1.6
look at:
runuser = asterisk
rungroup = asterisk
/etc/init.d/asterisk
#!/bin/sh /etc/rc.common
# Copyright (C) 2014 OpenWrt.org
START=99
APP=asterisk
OPTIONS=
DEST=
BIN_FILE=$DEST/usr/sbin/$APP
PID_FILE=$DEST/var/run/$APP/$APP.pid
start() {
[ -d $DEST/var/run/asterisk ] || mkdir -p $DEST/var/run/asterisk
[ -d $DEST/var/log/asterisk ] || mkdir -p $DEST/var/log/asterisk
[ -d $DEST/var/spool/asterisk ] || mkdir -p $DEST/var/spool/asterisk
[ -d $DEST/var/lib ] || mkdir -p $DEST/var/lib
[ -h $DEST/var/lib/asterisk ] || ln -s /usr/lib/asterisk /var/lib/asterisk
[ -d $DEST/var/lib/asterisk/keys ] || mkdir -p $DEST/var/lib/asterisk/keys
[ -d $DEST/var/log/asterisk/cdr-csv/ ] || mkdir -p $DEST/var/log/asterisk/cdr-csv
[ -d $DEST/usr/lib/asterisk/sounds/ ] || mkdir -p $DEST/usr/lib/asterisk/sounds
chown -R asterisk:asterisk $DEST/var/run/asterisk
chown -R asterisk:asterisk $DEST/var/log/asterisk
chown -R asterisk:asterisk $DEST/var/spool/asterisk
chown -R asterisk:asterisk /var/lib/asterisk
chown asterisk:asterisk /usr/lib/asterisk
chown asterisk:asterisk /usr/lib/asterisk/astdb.sqlite3
chown -R asterisk:asterisk /lib/firmware/ifx_firmware.bin
chmod 0400 /lib/firmware/voice_ar9_firmware.bin
chmod 0400 /lib/firmware/ifx_firmware.bin
SERVICE_PID_FILE="/var/run/asterisk/asterisk.pid"
service_start $BIN_FILE $OPTIONS
}
stop() {
SERVICE_PID_FILE="/var/run/asterisk/asterisk.pid"
service_stop $BIN_FILE
}
reload() {
SERVICE_PID_FILE="/var/run/asterisk/asterisk.pid"
service_reload $BIN_FILE
}
And for the Lantiq POTS (not required if on Router without FXS)
/etc/init.d/vmmc
#!/bin/sh /etc/rc.common
#
# Activate Voice CPE TAPI subsystem LL driver for VMMC
START=31
start() {
local c=10
[ ! -c /dev/vmmc$c ] && {
while [ $c -le 18 ] ; do
mknod /dev/vmmc$c c 122 $c
chown asterisk:asterisk /dev/vmmc$c
c=$(($c+1)) ; done
}
}
I think it is a general a good idea to not using root for asterisk and i can have be done a pullrequest but i have no idea how can i add a new user when a package will be installed.
(I hope i have find the right words for saying what i want)
#################################################################
For more qualified help you should post
- your asterisk.conf
- The logfile: /var/log/asterisk/messages
- stop asterisk by running /etc/init.d/asterisk stop
and then run asterisk inside the console:
asterisk -vvvvv -ddddd
and post the output here (or pastebin)
I thing the reason are: