[SOLVED] Asterisk13 or 15 sqlite3 database problem

#1

Hi

I'm sure there should be many users with the same issue, so desperately need an advice:

asterisk can't start with the following warning:

[ Initializing Custom Configuration Options ]
Couldn't prepare statement 'CREATE TABLE IF NOT EXISTS astdb(key VARCHAR(256), value VARCHAR(256), PRIMARY KEY(key))': malformed database schema (?)
Couldn't create astdb table: malformed database schema (?)
ASTdb initialization failed.  ASTERISK EXITING!

/var/lib/asterisk/astdb.sqlite3 exists and is r/writable

Any ideas?

#2

Hello,

Looks like the db is damaged. Or maybe no space left?

You probably didn't create the db yourself? Asterisk created it? What happens when you back up the db externally (just in case) and then remove it from /var/lib/asterisk/. Can you start Asterisk and it creates a fresh db?

When you search the internet for "Couldn't prepare statement 'CREATE TABLE IF NOT EXISTS astdb" you find a lot of hits. Probably they're gonna help you.

Good luck!

#3

I really appreciate your prompt response, thank you!

Posting here is the LAST thing I did, after I've been searching for the solution for several years, since Barrier Breaker. I even tried to compile Asterisk natively on the router...
I was hoping new versions will resolve the issue... But this never happened. (

And of course I was permanently digging Google for the error phrases... ))

This problem occurred since Asterisk started using sqlite DB. THE ONLY VERSION Asterisk works - is OpenWrt 14.07, Asterisk11. (ipx4xx architecture)
But since then many packages upgraded, so I need to use fresh versions.

Answers to your questions are:

  1. PROBABLY DB is damaged, but it's always a fresh install (and it always was - 14.07, 15.04 etc etc), so may be DB comes damaged with the package.
  2. There's plenty of space - I use extroot disk.
  3. I can't create DB myself. sqlite3 comes with Asterisk built-in, so with the database itself.
  4. Yes, Asterisk creates DB. Even if deleted - the same size file appears in /var/lib/asterisk after asterisk restart.

Asterisk is NOT present as a service.
And I can't start Asterisk console. asterisk -cvvvvv shows errors I've mentioned above.

#4

A SQLite database is a certain format of file. There are other "clients" that can open the database file to show you the data inside and see how it is structured etc. For example there is DB Browser for desktop Linux.

By far the largest problem with deploying SQLite is that the account user/group that the client program runs as does not have rights on the DB file. Even on OpenWrt, most of the "big" server applications set up an unprivileged account running most of the processes for better security.

1 Like
#5

mk, TNX.

99% I don't believe it's a broken DB. Various Asterisk versions and various OpenWRT releases, all freshly installed - but the same problem all time.

So, user/account rights problem is what I'm thinking about.

HOWEVER, astdb.sqlite3 file belongs to root. And all this is by OpenWRT default, I didn't change it.

Where/what should I check to be sure sqlite is able to read root's files?

UPDATE Sorry, top | grep asterisk DOESN'T show asterisk is loaded! So, it doesn't even start.

UPDATE2 Thanks to mk24, I tried to open database with third party tool (DB Browser for Sqlite) in Debian. When tried to create a Table - I got the same error message as Asterisk issues: database disk image is malformed.
So, seems it's a DB issue!

Can anyone upload asterisk 13 or 15 empty database please?
OR maybe describe its structure so I could create it manually.

UPDATE3 Compiled fresh Asterisk 15.3.0 on Debian, just to get astdb.sqlite3 file.
(Although on OpenWRT opkg shows asterisk version 15.3.0-5, asterisk doesn't have such release, so seems it's Owrt variation. But the database most likely must be the same format and version).
Fresh compiled file size is - 3072 (same as in asterisk11 in Barrier Breaker)
"Native" Owrt 18.06.2 asterisk 15.3.0 astdb file size is - 12288 (!)

Both appear as "malformed". Who compiled Owrt asterisk package? Can't believe they didn't try to run it after. Something is broken obviously.
Still need help please.

#6

Hello @portuquesa

Sure we run-test Asterisk. And it runs fine, otherwise we'd have looked into it.

/var is usually on tmpfs in OpenWrt, so astdb.sqlite3 gets created when Asterisk first starts after a reboot.

I'm willing to test this for you. Let me know the OpenWrt version you use. And what Asterisk packages I need to install (minimal set of packages with which you can reproduce). And let me know what configuration I need to put.

I'll let you know after if it runs fine or not. This will be a test without ext-root (I never set it up before and I don't have the time for that).

Kind regards,
Seb

#7

Hello Seb and thank you for your help (which is really needed desperately )))

USR8200 router. ixp4xx Intel arc.

I tried ALL these Openwrt releases: 14.07, 15.05, LEDE, now 18.06.02. r7676-cddd7b4c77
Asterisk was installed from packages. I've tried all asterisk packages which are available for the relevant OpenWRT release (1.8, 11, 13, 15).

Under all versions (not sure about 1.8) astdb.sqlite3 is created OK after attempt to run asterisk, even after DB file was deleted. But DB is malformed.

The only version asterisk was started successfully is Owrt14.07+asterisk11.

I didn't install any packages, except asterisk itself.

As of Asterisk configs - these should not matter at this stage, as we need to RUN asterisk first, then adjust it. Problem is that it should start with DEFAULT configs, but it doesn't.

And THANK YOU for your time!

#8

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:

#9

Hello and thank you Plonk.

I totally understand what u're saying and agree that asterisk should run under other user, not root. But root GUARANTEES everything starts up at least. I wanted to change user/group later.

Answering your questions:

  1. There's NO file /var/log/asterisk/messages
  2. asterisk -vvvvv -ddddd
    Seeding global EID '00:c0:49:f4:31:16' from 'eth1' using 'siocgifhwaddr'
    Parsing /etc/asterisk/asterisk.conf
  3. asterisk.conf
[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
astsbindir => /usr/sbin

[options]
;verbose = 3
;debug = 3
;refdebug = yes			; Enable reference count debug logging.
;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_media_frames = yes	; Cache media frames for performance
				; Disable this option to help track down media frame
				; mismanagement when using valgrind or MALLOC_DEBUG.
				; The cache gets in the way of determining if the
				; frame is used after being freed and who freed it.
				; NOTE: This option has no effect when Asterisk is
				; compiled with the LOW_MEMORY compile time option
				; enabled because the cache code does not exist.
				; Default yes
;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 = root		; The user to run as.
rungroup = root		; 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 no
;entityid=00:11:22:33:44:55	; Entity ID.
				; This is in the form of a MAC address.
				; It should be universally unique.
				; It must be unique between servers communicating
				; with a protocol that uses this value.
				; This is currently is used by DUNDi and
				; Exchanging Device and Mailbox State
				; using protocols: XMPP, Corosync and PJSIP.
;rtp_use_dynamic = yes          ; When set to "yes" RTP dynamic payload types
                                ; are assigned dynamically per RTP instance vs.
                                ; allowing Asterisk to globally initialize them
                                ; to pre-designated numbers (defaults to "yes").
;rtp_pt_dynamic = 35		; Normally the Dynamic RTP Payload Type numbers
				; are 96-127, which allow just 32 formats. The
				; starting point 35 enables the range 35-63 and
				; allows 29 additional formats. When you use
				; more than 32 formats in the dynamic range and
				; calls are not accepted by a remote
				; implementation, please report this and go
				; back to value 96.

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

PS Changing directories according your conf file didn't work.

#10

Hello @portuquesa,

I installed 18.06.2. No special extra config, just configured LAN port and WAN port so I could connect and access the Internet. Log below, it worked fine.

Looks like with just the main package installed the database just contains the UUID.

How much RAM has your device? What device is it?

Regards,
Seb

ssh root@192.168.0.1
The authenticity of host '192.168.0.1 (192.168.0.1)' can't be established.
RSA key fingerprint is SHA256:whatever
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.0.1' (RSA) to the list of known hosts.


BusyBox v1.28.4 () built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 18.06.2, r7676-cddd7b4c77
 -----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@OpenWrt:~# opkg update
Downloading http://downloads.openwrt.org/releases/18.06.2/targets/ar71xx/generic/packages/Packages.gz
<snip>
root@OpenWrt:~# opkg install asterisk15
Installing asterisk15 (15.3.0-5) to root...
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mips_24kc/telephony/asterisk15_15.3.0-5_mips_24kc.ipk
Installing uclibcxx (0.2.4-3) to root...
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mips_24kc/base/uclibcxx_0.2.4-3_mips_24kc.ipk
Installing jansson (2.10-1) to root...
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mips_24kc/packages/jansson_2.10-1_mips_24kc.ipk
Installing libcap (2.25-2) to root...
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mips_24kc/packages/libcap_2.25-2_mips_24kc.ipk
Installing terminfo (6.1-1) to root...
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mips_24kc/base/terminfo_6.1-1_mips_24kc.ipk
Installing libncurses (6.1-1) to root...
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mips_24kc/base/libncurses_6.1-1_mips_24kc.ipk
Installing libedit (20170329-3.1-1) to root...
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mips_24kc/packages/libedit_20170329-3.1-1_mips_24kc.ipk
Installing zlib (1.2.11-2) to root...
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mips_24kc/base/zlib_1.2.11-2_mips_24kc.ipk
Installing libopenssl (1.0.2r-1) to root...
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mips_24kc/base/libopenssl_1.0.2r-1_mips_24kc.ipk
Installing libsqlite3 (3260000-2) to root...
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mips_24kc/packages/libsqlite3_3260000-2_mips_24kc.ipk
Installing librt (1.1.19-1) to root...
Downloading http://downloads.openwrt.org/releases/18.06.2/targets/ar71xx/generic/packages/librt_1.1.19-1_mips_24kc.ipk
Installing libuuid (2.32-2) to root...
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mips_24kc/base/libuuid_2.32-2_mips_24kc.ipk
Installing libxml2 (2.9.8-4) to root...
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mips_24kc/packages/libxml2_2.9.8-4_mips_24kc.ipk
Configuring terminfo.
Configuring uclibcxx.
Configuring jansson.
Configuring libcap.
Configuring libncurses.
Configuring libedit.
Configuring zlib.
Configuring libopenssl.
Configuring libsqlite3.
Configuring librt.
Configuring libuuid.
Configuring libxml2.
Configuring asterisk15.
root@OpenWrt:~# ps |grep aster
 2110 root     13252 S    /usr/sbin/asterisk
 2136 root      1200 S    grep aster
root@OpenWrt:~# grep  mkdir /etc/init.d/asterisk 
       [ -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/asterisk ] || mkdir -p $DEST/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
root@OpenWrt:~# ls -lh /var/run/asterisk /var/log/asterisk /var/spool/asterisk /var/lib/asterisk /var/lib/asterisk/keys /var/log/asterisk/cdr-csv
/var/lib/asterisk:
-rw-r--r--    1 root     root       12.0K May 13 19:24 astdb.sqlite3
drwxr-xr-x    2 root     root          40 May 13 19:24 keys

/var/lib/asterisk/keys:

/var/log/asterisk:
drwxr-xr-x    2 root     root          40 May 13 19:24 cdr-csv
-rw-r--r--    1 root     root         828 May 13 19:24 messages
-rw-r--r--    1 root     root          38 May 13 19:24 queue_log

/var/log/asterisk/cdr-csv:

/var/run/asterisk:
srwxr-xr-x    1 root     root           0 May 13 19:24 asterisk.ctl
-rw-r--r--    1 root     root           5 May 13 19:24 asterisk.pid

/var/spool/asterisk:
root@OpenWrt:~#asterisk -r
Asterisk 15.3.0, Copyright (C) 1999 - 2016, Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Connected to Asterisk 15.3.0 currently running on OpenWrt (pid = 2110)
OpenWrt*CLI> module show 
Module                         Description                              Use Count  Status      Support Level
app_dial.so                    Dialing Application                      0          Running              core
app_echo.so                    Simple Echo Application                  0          Running              core
app_macro.so                   Extension Macros                         0          Running              core
app_playback.so                Sound File Playback Application          0          Running              core
func_callerid.so               Party ID related dialplan functions (Cal 0          Running              core
func_logic.so                  Logical dialplan functions               0          Running              core
func_strings.so                String handling dialplan functions       0          Running              core
func_timeout.so                Channel timeout dialplan functions       0          Running              core
pbx_config.so                  Text Extension Configuration             0          Running              core
res_crypto.so                  Cryptographic Digital Signatures         1          Running              core
10 modules loaded
OpenWrt*CLI>exit
Asterisk cleanly ending (0).
Executing last minute cleanups
root@OpenWrt:~# ps |grep aster
 2110 root     13004 S    /usr/sbin/asterisk
 2142 root      1200 S    grep aster
root@OpenWrt:~#opkg install sqlite3-cli
Installing sqlite3-cli (3260000-2) to root...
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mips_24kc/packages/sqlite3-cli_3260000-2_mips_24kc.ipk
Installing libreadline (7.0-1) to root...
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mips_24kc/base/libreadline_7.0-1_mips_24kc.ipk
Configuring libreadline.
Configuring sqlite3-cli.
root@OpenWrt:~# /etc/init.d/asterisk stop
root@OpenWrt:~# ps |grep aster
 2250 root      1200 S    grep aster
root@OpenWrt:~# /etc/init.d/asterisk start
root@OpenWrt:~# ps |grep aster
 2254 root     14484 S    /usr/sbin/asterisk
 2280 root      1200 S    grep aster
root@OpenWrt:~# /etc/init.d/asterisk stop
root@OpenWrt:~# ps |grep aster
 2287 root      1200 R    grep aster
root@OpenWrt:~# sqlite3 /var/lib/asterisk/
astdb.sqlite3  keys/
root@OpenWrt:~# sqlite3 /var/lib/asterisk/astdb.sqlite3 
SQLite version 3.26.0 2018-12-01 12:34:55
Enter ".help" for usage hints.
sqlite> .tables
astdb
sqlite> SELECT * FROM astdb;
/pbx/UUID|95a29389-a6b1-4cbc-bdfa-720850f31847
sqlite> .q   
root@OpenWrt:~# cd /var/log/asterisk/
root@OpenWrt:/tmp/log/asterisk# ls -lh
drwxr-xr-x    2 root     root          40 May 13 19:24 cdr-csv
-rw-r--r--    1 root     root        2.1K May 13 19:29 messages
-rw-r--r--    1 root     root          76 May 13 19:29 queue_log
root@OpenWrt:/tmp/log/asterisk# cat messages 
[May 13 19:24:16] Asterisk 15.3.0 built by nobody @ buildd.debian.org on a unknown running Linux on 2019-05-06 10:44:26 UTC
[May 13 19:24:16] ERROR[2110] config_options.c: Unable to load config file 'cdr.conf'
[May 13 19:24:16] NOTICE[2110] cdr.c: Failed to process CDR configuration; using defaults
[May 13 19:24:16] NOTICE[2110] cdr.c: CDR simple logging enabled.
[May 13 19:24:16] NOTICE[2110] loader.c: 11 modules will be loaded.
[May 13 19:24:16] WARNING[2110] loader.c: Error loading module 'res_musiconhold.so': Error loading shared library /usr/lib/asterisk/modules/res_musiconhold.so: No such file or directory
[May 13 19:24:16] WARNING[2110] res_crypto.c: Unable to open key directory '/usr/share/asterisk/keys'
[May 13 19:24:16] WARNING[2110] pbx.c: Context 'local' tries to include nonexistent context 'parkedcalls'
[May 13 19:26:15] WARNING[2112] asterisk.c: The canary is no more.  He has ceased to be!  He's expired and gone to meet his maker!  He's a stiff!  Bereft of life, he rests in peace.  His metabolic processes are now history!  He's off the twig!  He's kicked the bucket.  He's shuffled off his mortal coil, run down the curtain, and joined the bleeding choir invisible!!  THIS is an EX-CANARY.  (Reducing priority)
[May 13 19:26:15] WARNING[2112] asterisk.c: Unable to set regular thread priority on main thread
[May 13 19:29:01] Asterisk 15.3.0 built by nobody @ buildd.debian.org on a unknown running Linux on 2019-05-06 10:44:26 UTC
[May 13 19:29:02] ERROR[2254] config_options.c: Unable to load config file 'cdr.conf'
[May 13 19:29:02] NOTICE[2254] cdr.c: Failed to process CDR configuration; using defaults
[May 13 19:29:02] NOTICE[2254] cdr.c: CDR simple logging enabled.
[May 13 19:29:02] NOTICE[2254] loader.c: 11 modules will be loaded.
[May 13 19:29:02] WARNING[2254] loader.c: Error loading module 'res_musiconhold.so': Error loading shared library /usr/lib/asterisk/modules/res_musiconhold.so: No such file or directory
[May 13 19:29:02] WARNING[2254] res_crypto.c: Unable to open key directory '/usr/share/asterisk/keys'
[May 13 19:29:02] WARNING[2254] pbx.c: Context 'local' tries to include nonexistent context 'parkedcalls'
root@OpenWrt:/tmp/log/asterisk# asterisk -cfvvv
Asterisk 15.3.0, Copyright (C) 1999 - 2016, Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
[ Initializing Custom Configuration Options ]
Manager registered action DBGet
Manager registered action DBPut
Manager registered action DBDel
Manager registered action DBDelTree
PBX UUID: 95a29389-a6b1-4cbc-bdfa-720850f31847
Registered 'audio' codec 'codec2' at sample rate '8000' with id '1'
Created cached format with name 'codec2'
Registered 'audio' codec 'g723' at sample rate '8000' with id '2'
Created cached format with name 'g723'
Registered 'audio' codec 'ulaw' at sample rate '8000' with id '3'
Created cached format with name 'ulaw'
Registered 'audio' codec 'alaw' at sample rate '8000' with id '4'
Created cached format with name 'alaw'
Registered 'audio' codec 'gsm' at sample rate '8000' with id '5'
Created cached format with name 'gsm'
Registered 'audio' codec 'g726' at sample rate '8000' with id '6'
Created cached format with name 'g726'
Registered 'audio' codec 'g726aal2' at sample rate '8000' with id '7'
Created cached format with name 'g726aal2'
Registered 'audio' codec 'adpcm' at sample rate '8000' with id '8'
Created cached format with name 'adpcm'
Registered 'audio' codec 'slin' at sample rate '8000' with id '9'
Created cached format with name 'slin'
Registered 'audio' codec 'slin' at sample rate '12000' with id '10'
Created cached format with name 'slin12'
Registered 'audio' codec 'slin' at sample rate '16000' with id '11'
Created cached format with name 'slin16'
Registered 'audio' codec 'slin' at sample rate '24000' with id '12'
Created cached format with name 'slin24'
Registered 'audio' codec 'slin' at sample rate '32000' with id '13'
Created cached format with name 'slin32'
Registered 'audio' codec 'slin' at sample rate '44100' with id '14'
Created cached format with name 'slin44'
Registered 'audio' codec 'slin' at sample rate '48000' with id '15'
Created cached format with name 'slin48'
Registered 'audio' codec 'slin' at sample rate '96000' with id '16'
Created cached format with name 'slin96'
Registered 'audio' codec 'slin' at sample rate '192000' with id '17'
Created cached format with name 'slin192'
Registered 'audio' codec 'lpc10' at sample rate '8000' with id '18'
Created cached format with name 'lpc10'
Registered 'audio' codec 'g729' at sample rate '8000' with id '19'
Created cached format with name 'g729'
Registered 'audio' codec 'speex' at sample rate '8000' with id '20'
Created cached format with name 'speex'
Registered 'audio' codec 'speex' at sample rate '16000' with id '21'
Created cached format with name 'speex16'
Registered 'audio' codec 'speex' at sample rate '32000' with id '22'
Created cached format with name 'speex32'
Registered 'audio' codec 'ilbc' at sample rate '8000' with id '23'
Created cached format with name 'ilbc'
Registered 'audio' codec 'g722' at sample rate '16000' with id '24'
Created cached format with name 'g722'
Registered 'audio' codec 'siren7' at sample rate '16000' with id '25'
Created cached format with name 'siren7'
Registered 'audio' codec 'siren14' at sample rate '32000' with id '26'
Created cached format with name 'siren14'
Registered 'audio' codec 'testlaw' at sample rate '8000' with id '27'
Created cached format with name 'testlaw'
Registered 'audio' codec 'g719' at sample rate '48000' with id '28'
Created cached format with name 'g719'
Registered 'audio' codec 'opus' at sample rate '48000' with id '29'
Created cached format with name 'opus'
Registered 'image' codec 'jpeg' at sample rate '0' with id '30'
Created cached format with name 'jpeg'
Registered 'image' codec 'png' at sample rate '0' with id '31'
Created cached format with name 'png'
Registered 'video' codec 'h261' at sample rate '1000' with id '32'
Created cached format with name 'h261'
Registered 'video' codec 'h263' at sample rate '1000' with id '33'
Created cached format with name 'h263'
Registered 'video' codec 'h263p' at sample rate '1000' with id '34'
Created cached format with name 'h263p'
Registered 'video' codec 'h264' at sample rate '1000' with id '35'
Created cached format with name 'h264'
Registered 'video' codec 'mpeg4' at sample rate '1000' with id '36'
Created cached format with name 'mpeg4'
Registered 'video' codec 'vp8' at sample rate '1000' with id '37'
Created cached format with name 'vp8'
Registered 'video' codec 'vp9' at sample rate '1000' with id '38'
Created cached format with name 'vp9'
Registered 'text' codec 'red' at sample rate '0' with id '39'
Created cached format with name 'red'
Registered 'text' codec 't140' at sample rate '0' with id '40'
Created cached format with name 't140'
Registered 'image' codec 't38' at sample rate '0' with id '41'
Created cached format with name 't38'
Registered 'audio' codec 'none' at sample rate '8000' with id '42'
Created cached format with name 'none'
Registered 'audio' codec 'silk' at sample rate '8000' with id '43'
Created cached format with name 'silk8'
Registered 'audio' codec 'silk' at sample rate '12000' with id '44'
Created cached format with name 'silk12'
Registered 'audio' codec 'silk' at sample rate '16000' with id '45'
Created cached format with name 'silk16'
Registered 'audio' codec 'silk' at sample rate '24000' with id '46'
Created cached format with name 'silk24'
Sorcery registered wizard 'bucket'
Sorcery registered wizard 'bucket_file'
  == Message handler 'dialplan' registered.
  == Registered custom function 'MESSAGE'
  == Registered custom function 'MESSAGE_DATA'
  == Registered application 'MessageSend'
  == Manager registered action MessageSend
  == Registered channel type 'Surrogate' (Surrogate channel used to pull channel from an application)
  == Manager registered action BridgeTechnologyList
  == Manager registered action BridgeTechnologySuspend
  == Manager registered action BridgeTechnologyUnsuspend
  == Registered DNS resolver 'system' with priority '2147483647'
 Asterisk Dynamic Loader Starting:
  == Registered custom function 'FEATURE'
  == Registered custom function 'FEATUREMAP'
  == Registered application 'Bridge'
  == Manager registered action Bridge
    -- Registered indication country 'at'
    -- Registered indication country 'au'
    -- Registered indication country 'bg'
    -- Registered indication country 'br'
    -- Registered indication country 'be'
    -- Registered indication country 'ch'
    -- Registered indication country 'cl'
    -- Registered indication country 'cn'
    -- Registered indication country 'cz'
    -- Registered indication country 'de'
    -- Registered indication country 'dk'
    -- Registered indication country 'ee'
    -- Registered indication country 'es'
    -- Registered indication country 'fi'
    -- Registered indication country 'fr'
    -- Registered indication country 'gr'
    -- Registered indication country 'hu'
    -- Registered indication country 'il'
    -- Registered indication country 'in'
    -- Registered indication country 'it'
    -- Registered indication country 'lt'
    -- Registered indication country 'jp'
    -- Registered indication country 'mx'
    -- Registered indication country 'my'
    -- Registered indication country 'nl'
    -- Registered indication country 'no'
    -- Registered indication country 'nz'
    -- Registered indication country 'ph'
    -- Registered indication country 'pl'
    -- Registered indication country 'pt'
    -- Registered indication country 'ru'
    -- Registered indication country 'se'
    -- Registered indication country 'sg'
    -- Registered indication country 'th'
    -- Registered indication country 'uk'
    -- Registered indication country 'us'
    -- Registered indication country 'us-old'
    -- Registered indication country 'tw'
    -- Registered indication country 've'
    -- Registered indication country 'za'
    -- Setting default indication country to 'us'
[May 13 19:35:06] ERROR[2334]: config_options.c:706 aco_process_config: Unable to load config file 'cdr.conf'
[May 13 19:35:06] NOTICE[2334]: cdr.c:4360 process_config: Failed to process CDR configuration; using defaults
[May 13 19:35:06] NOTICE[2334]: cdr.c:4495 cdr_toggle_runtime_options: CDR simple logging enabled.
 Asterisk PBX Core Initializing
  == Registering builtin functions:
  == Registered custom function 'EXCEPTION'
  == Registered custom function 'TESTTIME'
  == Manager registered action ShowDialPlan
  == Manager registered action ExtensionStateList
  == Registered application 'Answer'
  == Registered application 'BackGround'
  == Registered application 'Busy'
  == Registered application 'Congestion'
  == Registered application 'ExecIfTime'
  == Registered application 'Goto'
  == Registered application 'GotoIf'
  == Registered application 'GotoIfTime'
  == Registered application 'ImportVar'
  == Registered application 'Hangup'
  == Registered application 'Incomplete'
  == Registered application 'NoOp'
  == Registered application 'Proceeding'
  == Registered application 'Progress'
  == Registered application 'RaiseException'
  == Registered application 'Ringing'
  == Registered application 'SayAlpha'
  == Registered application 'SayAlphaCase'
  == Registered application 'SayDigits'
  == Registered application 'SayNumber'
  == Registered application 'SayPhonetic'
  == Registered application 'SetAMAFlags'
  == Registered application 'Wait'
  == Registered application 'WaitDigit'
  == Registered application 'WaitExten'
  == Registered application 'Set'
  == Registered application 'MSet'
  == Registered channel type 'Local' (Local Proxy Channel Driver)
  == Manager registered action LocalOptimizeAway
  == Manager registered action Ping
  == Manager registered action Events
  == Manager registered action Logoff
  == Manager registered action Login
  == Manager registered action Challenge
  == Manager registered action Hangup
  == Manager registered action Status
  == Manager registered action Setvar
  == Manager registered action Getvar
  == Manager registered action GetConfig
  == Manager registered action GetConfigJSON
  == Manager registered action UpdateConfig
  == Manager registered action CreateConfig
  == Manager registered action ListCategories
  == Manager registered action Redirect
  == Manager registered action Atxfer
  == Manager registered action CancelAtxfer
  == Manager registered action Originate
  == Manager registered action Command
  == Manager registered action ExtensionState
  == Manager registered action PresenceState
  == Manager registered action AbsoluteTimeout
  == Manager registered action MailboxStatus
  == Manager registered action MailboxCount
  == Manager registered action ListCommands
  == Manager registered action SendText
  == Manager registered action UserEvent
  == Manager registered action WaitEvent
  == Manager registered action CoreSettings
  == Manager registered action CoreStatus
  == Manager registered action Reload
  == Manager registered action LoggerRotate
  == Manager registered action CoreShowChannels
  == Manager registered action ModuleLoad
  == Manager registered action ModuleCheck
  == Manager registered action AOCMessage
  == Manager registered action Filter
  == Manager registered action BlindTransfer
  == Registered custom function 'AMI_CLIENT'
  == Registered application 'CallCompletionRequest'
  == Registered application 'CallCompletionCancel'
 Asterisk Dynamic Loader Starting:
[May 13 19:35:06] NOTICE[2334]: loader.c:1494 load_modules: 11 modules will be loaded.
[May 13 19:35:06] WARNING[2334]: loader.c:577 load_dlopen: Error loading module 'res_musiconhold.so': Error loading shared library /usr/lib/asterisk/modules/res_musiconhold.so: No such file or directory
 Loading res_crypto.so.
[May 13 19:35:06] WARNING[2334]: res_crypto.c:506 crypto_load: Unable to open key directory '/usr/share/asterisk/keys'
  == res_crypto.so => (Cryptographic Digital Signatures)
 Loading app_echo.so.
  == Registered application 'Echo'
  == app_echo.so => (Simple Echo Application)
 Loading pbx_config.so.
  == Manager registered action DialplanExtensionAdd
  == Manager registered action DialplanExtensionRemove
  == Setting global variable 'CONSOLE' to 'Console/dsp'
  == Setting global variable 'IAXINFO' to 'guest'
  == Setting global variable 'TRUNK' to 'DAHDI/G2'
  == Setting global variable 'TRUNKMSD' to '1'
    -- Including switch 'DUNDi/e164' in context 'dundi-e164-switch'
    -- Time to scan old dialplan and merge leftovers back into the new: 0.000015 sec
    -- Time to restore hints and swap in new dialplan: 0.000136 sec
    -- Time to delete the old dialplan: 0.000005 sec
    -- Total time merge_contexts_delete: 0.000156 sec
    -- pbx_config successfully loaded 0 contexts (enable debug for details).
[May 13 19:35:06] WARNING[2334]: pbx.c:8691 ast_context_verify_includes: Context 'local' tries to include nonexistent context 'parkedcalls'
  == pbx_config.so => (Text Extension Configuration)
 Loading func_logic.so.
  == Registered custom function 'ISNULL'
  == Registered custom function 'SET'
  == Registered custom function 'EXISTS'
  == Registered custom function 'IF'
  == Registered custom function 'IFTIME'
  == Registered custom function 'IMPORT'
  == func_logic.so => (Logical dialplan functions)
 Loading app_playback.so.
  == Registered application 'Playback'
  == app_playback.so => (Sound File Playback Application)
 Loading app_dial.so.
  == Registered application 'Dial'
  == Registered application 'RetryDial'
  == app_dial.so => (Dialing Application)
 Loading func_timeout.so.
  == Registered custom function 'TIMEOUT'
  == func_timeout.so => (Channel timeout dialplan functions)
 Loading func_strings.so.
  == Registered custom function 'FIELDQTY'
  == Registered custom function 'FIELDNUM'
  == Registered custom function 'FILTER'
  == Registered custom function 'REPLACE'
  == Registered custom function 'STRREPLACE'
  == Registered custom function 'LISTFILTER'
  == Registered custom function 'REGEX'
  == Registered custom function 'ARRAY'
  == Registered custom function 'QUOTE'
  == Registered custom function 'CSV_QUOTE'
  == Registered custom function 'LEN'
  == Registered custom function 'STRFTIME'
  == Registered custom function 'STRPTIME'
  == Registered custom function 'EVAL'
  == Registered custom function 'KEYPADHASH'
  == Registered custom function 'HASHKEYS'
  == Registered custom function 'HASH'
  == Registered application 'ClearHash'
  == Registered custom function 'TOUPPER'
  == Registered custom function 'TOLOWER'
  == Registered custom function 'SHIFT'
  == Registered custom function 'POP'
  == Registered custom function 'PUSH'
  == Registered custom function 'UNSHIFT'
  == Registered custom function 'PASSTHRU'
  == func_strings.so => (String handling dialplan functions)
 Loading app_macro.so.
  == Registered application 'MacroExit'
  == Registered application 'MacroIf'
  == Registered application 'MacroExclusive'
  == Registered application 'Macro'
  == app_macro.so => (Extension Macros)
 Loading func_callerid.so.
  == Registered custom function 'CALLERPRES'
  == Registered custom function 'CALLERID'
  == Registered custom function 'CONNECTEDLINE'
  == Registered custom function 'REDIRECTING'
  == func_callerid.so => (Party ID related dialplan functions (Caller-ID, Connected-line, Redirecting))
Asterisk Ready.
*CLI> Asterisk cleanly ending (0).
Executing last minute cleanups
  == Manager unregistered action DBGet
  == Manager unregistered action DBPut
  == Manager unregistered action DBDel
  == Manager unregistered action DBDelTree
root@OpenWrt:/tmp/log/asterisk# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 2.5M      2.5M         0 100% /rom
tmpfs                    61.2M    684.0K     60.5M   1% /tmp
/dev/mtdblock5           11.9M      3.7M      8.3M  31% /overlay
overlayfs:/overlay       11.9M      3.7M      8.3M  31% /
tmpfs                   512.0K         0    512.0K   0% /dev
root@OpenWrt:/tmp/log/asterisk# free
             total       used       free     shared    buffers     cached
Mem:        125272      29540      95732        684       2000      13204
-/+ buffers/cache:      14336     110936
Swap:            0          0          0
root@OpenWrt:/tmp/log/asterisk# /etc/init.d/asterisk start
root@OpenWrt:/tmp/log/asterisk# free
             total       used       free     shared    buffers     cached
Mem:        125272      31024      94248        692       2000      13212
-/+ buffers/cache:      15812     109460
Swap:            0          0          0
root@OpenWrt:/tmp/log/asterisk# ps | grep aster
 2366 root     14484 S    /usr/sbin/asterisk
 2393 root      1200 S    grep aster
root@OpenWrt:/tmp/log/asterisk# top
Mem: 31008K used, 94264K free, 692K shrd, 2000K buff, 13216K cached
CPU:   0% usr   0% sys   0% nic  99% idle   0% io   0% irq   0% sirq
Load average: 0.00 0.04 0.07 1/64 2394
  PID  PPID USER     STAT   VSZ %VSZ %CPU COMMAND
 2394  1526 root     R     1200   1%   0% top
  115     2 root     SW       0   0%   0% [kworker/0:1]
  906     1 root     S     1652   1%   0% /sbin/netifd
 1507   849 root     S     1132   1%   0% /usr/sbin/dropbear -F -P /var/run/dropbear.1.pid -p 22 -K 300 -T 3
 2366     1 root     S    13244  11%   0% /usr/sbin/asterisk
    1     0 root     S     1544   1%   0% /sbin/procd
  770     1 root     S     1528   1%   0% /sbin/rpcd -s /var/run/ubus.sock -t 30
  944     1 root     S     1420   1%   0% /usr/sbin/odhcpd
 1396     1 dnsmasq  S     1316   1%   0% /usr/sbin/dnsmasq -C /var/etc/dnsmasq.conf.cfg01411c -k -x /var/run/dnsmasq/dnsmasq.cfg01411c.pid
 1000     1 root     S     1296   1%   0% /usr/sbin/uhttpd -f -h /www -r OpenWrt -x /cgi-bin -t 60 -T 30 -k 20 -A 1 -n 1 -N 100 -R -p 0.0.0.0:80 -p [::]:80
  751     1 root     S     1224   1%   0% /sbin/logd -S 64
 1526  1507 root     S     1204   1%   0% -ash
 1246     1 root     S<    1204   1%   0% /usr/sbin/ntpd -n -N -S /usr/sbin/ntpd-hotplug -p 0.openwrt.pool.ntp.org -p 1.openwrt.pool.ntp.org -p 2.openwrt.pool.ntp.org -p 3.openwrt.pool.ntp.org
  506     1 root     S     1192   1%   0% /sbin/ubusd
  849     1 root     S     1064   1%   0% /usr/sbin/dropbear -F -P /var/run/dropbear.1.pid -p 22 -K 300 -T 3
 1280   906 root     S     1028   1%   0% odhcp6c -s /lib/netifd/dhcpv6.script -P0 -t120 eth0.2
  507     1 root     S      900   1%   0% /sbin/askfirst /usr/libexec/login.sh
  210     2 root     SW       0   0%   0% [spi0]
    3     2 root     SW       0   0%   0% [ksoftirqd/0]
    6     2 root     SW       0   0%   0% [kworker/u2:0]
  392     2 root     SW       0   0%   0% [kworker/0:2]
  434     2 root     SWN      0   0%   0% [jffs2_gcd_mtd5]
  246     2 root     SW<      0   0%   0% [bioset]
  241     2 root     SW<      0   0%   0% [bioset]
  252     2 root     SW<      0   0%   0% [bioset]
  231     2 root     SW<      0   0%   0% [bioset]
  219     2 root     SW<      0   0%   0% [bioset]
  225     2 root     SW<      0   0%   0% [bioset]
  236     2 root     SW<      0   0%   0% [bioset]
  258     2 root     SW<      0   0%   0% [bioset]
  102     2 root     SW<      0   0%   0% [watchdogd]
   82     2 root     SW<      0   0%   0% [bioset]
   81     2 root     SW<      0   0%   0% [crypto]
   84     2 root     SW<      0   0%   0% [kblockd]
   77     2 root     SW       0   0%   0% [oom_reaper]
    7     2 root     SW<      0   0%   0% [lru-add-drain]
  574     2 root     SW<      0   0%   0% [cfg80211]
  366     2 root     SW<      0   0%   0% [ipv6_addrconf]
  269     2 root     SW       0   0%   0% [kworker/u2:2]
  373     2 root     SW<      0   0%   0% [kworker/0:1H]
   78     2 root     SW<      0   0%   0% [writeback]
    5     2 root     SW<      0   0%   0% [kworker/0:0H]
    2     0 root     SW       0   0%   0% [kthreadd]
   80     2 root     SW       0   0%   0% [kcompactd0]
  122     2 root     SW       0   0%   0% [kswapd0]
^C264     2 root     SW<      0   0%   0% [bioset]
root@OpenWrt:/tmp/log/asterisk#

#11

This is not much the reason are the verbosity will be defined in the asterisk.conf
please change the following lines and try again:

...
verbose = 3
debug = 3
...

try level 3
and if we do not found any reason try a higher level (no idea how much are possible 10 ?)

#12

Plonk
Changed verbose level gradually. NO changes in exhaust.

Seb
USR8200 (US Robotics)

Memory
Total Available 25884 kB / 61120 kB (42%)
Free 19996 kB / 61120 kB (32%)
Buffered 5888 kB / 61120 kB (9%)

free
             total       used       free     shared    buffers     cached
Mem:         61120      40288      20832       1156       5928      18164
-/+ buffers/cache:      16196      44924
Swap:       102396          0     102396

df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 2.3M      2.3M         0 100% /rom
tmpfs                    29.8M      1.1M     28.7M   4% /tmp
/dev/sda1               975.9M    314.8M    593.8M  35% /
tmpfs                   512.0K         0    512.0K   0% /dev

sqlite3 /var/lib/asterisk/astdb.sqlite3
SQLite version 3.26.0 2018-12-01 12:34:55
Enter ".help" for usage hints.
sqlite> .tables
sqlite> SELECT * FROM astdb;
Error: no such table: astdb
sqlite>
#13

This is strange because you should get a lot of output, in my case more them as my console are long.
which additional packages do you want to install in future ?
Possible that any modules missed or not loaded that are required for working, because my minimal packages always:
asterisk13 asterisk13-pjsip asterisk13-bridge-simple asterisk13-codec-alaw asterisk13-res-rtp-asterisk asterisk13-app-stack
or
asterisk13 asterisk13-app-stack asterisk13-chan-lantiq asterisk13-codec-alaw asterisk13-codec-ulaw asterisk13-codec-a-mu asterisk13-chan-sip asterisk13-res-rtp-asterisk

How looks the /etc/asterisk/modules.conf
my is:

;
; Asterisk configuration file
;
; Module Loader configuration file
;

[modules]
autoload=yes
;
; Any modules that need to be loaded before the Asterisk core has been
; initialized (just after the logger has been initialized) can be loaded
; using 'preload'. This will frequently be needed if you wish to map all
; module configuration files into Realtime storage, since the Realtime
; driver will need to be loaded before the modules using those configuration
; files are initialized.
;
; An example of loading ODBC support would be:
;preload => res_odbc.so
;preload => res_config_odbc.so
;
; Uncomment the following if you wish to use the Speech Recognition API
;preload => res_speech.so
;
; If you want Asterisk to fail if a module does not load, then use
; the "require" keyword. Asterisk will exit with a status code of 2
; if a required module does not load.
;
; require = chan_sip.so
; If you want you can combine with preload
; preload-require = res_odbc.so
;
; If you want, load the GTK console right away.
;
noload => pbx_gtkconsole.so
;load => pbx_gtkconsole.so
;
load => res_musiconhold.so
;
; Load one of: chan_oss, alsa, or console (portaudio).
; By default, load chan_oss only (automatically).
;
noload => chan_alsa.so
;noload => chan_oss.so
noload => chan_console.so
;
#14

In this case i am not an expert but i miss your overlay fs

add me:

/dev/root                 8.8M      8.8M         0 100% /rom
tmpfs                    28.1M      1.1M     27.0M   4% /tmp
/dev/mtdblock6            5.1M      1.5M      3.6M  30% /overlay
overlayfs:/overlay        5.1M      1.5M      3.6M  30% /
tmpfs                   512.0K         0    512.0K   0% /dev

if your rootfs on /dev/sda1 them it should be replace /dev/mtdblock6

#15

modules.conf

;
; Asterisk configuration file
;
; Module Loader configuration file
;

[modules]
autoload=yes
;
; Any modules that need to be loaded before the Asterisk core has been
; initialized (just after the logger has been initialized) can be loaded
; using 'preload'. This will frequently be needed if you wish to map all
; module configuration files into Realtime storage, since the Realtime
; driver will need to be loaded before the modules using those configuration
; files are initialized.
;
; An example of loading ODBC support would be:
;preload => res_odbc.so
;preload => res_config_odbc.so
;
; Uncomment the following if you wish to use the Speech Recognition API
;preload => res_speech.so
;
; If you want Asterisk to fail if a module does not load, then use
; the "require" keyword. Asterisk will exit with a status code of 2
; if a required module does not load.
;
; require = chan_sip.so
; If you want you can combine with preload
; preload-require = res_odbc.so
;
; If you want, load the GTK console right away.
;
noload => pbx_gtkconsole.so
;load => pbx_gtkconsole.so
;
load => res_musiconhold.so
;
; Load one of: chan_oss, alsa, or console (portaudio).
; By default, load chan_oss only (automatically).
;
noload => chan_alsa.so
;noload => chan_oss.so
noload => chan_console.so
;

Overlay is not necessary, we have extroot here.

ANYWAY, installing without any external disk (overlay or extroot) has the same result- asterisk not starting.
MOREOVER, I have several routers (same model) - so, it's not one router failure.

**WHAT I'M THINKING - **
to cross-compile asterisk11 for 18.06.02.

But I need Makefile for it. Could you provide me with please?

#16

Hello,

Then I'm out of ideas. Wrong permissions? Something to do with ext-root? Does it work without ext-root? Target-related (ixp4xx)? Arch relatet (armeb-xscale)?

Don't have your hardware, and no time to try out ext-root myself.

Good luck!

Kind regards,
Seb

#17

OK, Seb thanks anyway.

Can you send me Makefile for asterisk11 please? Seems there's the only way to get it worked - to cross-compile asterisk11 for 18.06.

#18

Can't recommend 11, obviously, as it's end of life. But you can find the old Makefile on Github.

git clone https://github.com/openwrt/telephony.git
cd telephony/
git checkout 73c582d6b38437e77906a907a1b3e5d0f0118b04
#19

Nice, TNX!

This is for * 11.25.2

Can you point me also to 11.12.0 please...

#20

de224c8870c41e9622c57254129e139f985cc8d1