opkg update
opkg install asterisk16
root@OpenWrt:~# asterisk -cvvvvv
Asterisk 16.6.1, Copyright (C) 1999 - 2018, 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.
=========================================================================
Unable to open Asterisk database '/var/lib/asterisk/astdb.sqlite3': unable to open database file
ASTdb initialization failed. ASTERISK EXITING!
root@OpenWrt:~# cat /etc/os-release
NAME="OpenWrt"
VERSION="SNAPSHOT"
ID="openwrt"
ID_LIKE="lede openwrt"
PRETTY_NAME="OpenWrt SNAPSHOT"
VERSION_ID="snapshot"
HOME_URL="https://openwrt.org/"
BUG_URL="https://bugs.openwrt.org/"
SUPPORT_URL="https://forum.openwrt.org/"
BUILD_ID="r11756-bf43e5bbf9"
OPENWRT_BOARD="sunxi/cortexa7"
OPENWRT_ARCH="arm_cortex-a7_neon-vfpv4"
OPENWRT_TAINTS=""
OPENWRT_DEVICE_MANUFACTURER="OpenWrt"
OPENWRT_DEVICE_MANUFACTURER_URL="https://openwrt.org/"
OPENWRT_DEVICE_PRODUCT="Generic"
OPENWRT_DEVICE_REVISION="v0"
OPENWRT_RELEASE="OpenWrt SNAPSHOT r11756-bf43e5bbf9"
I don't have a full answer but I will point out that in OpenWrt, /var is a RAM disk, so it gets erased on reboot. You'll have to store any files that need to be persistent somewhere else.
Thanks @mk24, I could probably store it somewhere else, but where do I even get astdb.sqlite3 from? I think it's a bug if a package doesn't "just work" right out of the box?
It'll be created automatically if it does not exist. Please check permissions of folder /var/lib/asterisk. The user "asterisk" has write permissions in there? Is there enough free space available (df -h)?
Ah, wait, that explains it. You didn't use the init script. And now you created one or more directories manually without chowning them properly.
I suggest to use the init script to start asterisk. You may have to correct some permissions manually, because the init script will only create directories (with the correct permissions) if the directories don't exist. That is to say, it won't fix the permissions on existing folders.
uci set asterisk.general.enabled=1
/etc/init.d/asterisk start
I can now connect to it:
root@OpenWrt:~# asterisk -r
Asterisk 16.6.1, Copyright (C) 1999 - 2018, 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 16.6.1 currently running on OpenWrt (pid = 3287)
I now have Asterisk running as user asterisk. Cool! I wonder why the config file doesn't come enabled out of the box.