I am trying to set up Asterisk chan_alsa
with a USB sound device which I plan to use as a SIP client (softphone).
opkg install kmod-usb-audio kmod-sound-core usbutils asterisk16-chan-alsa asterisk16-app-senddtmf alsa-utils shadow-usermod
Edited /etc/asound.conf
to contain
pcm.!default {
type hw
card 0
}
ctl.!default {
type hw
card 0
}
With this brute force method I get it to work:
root@Asterisk:~# chmod -R 777 /dev/snd/
root@Asterisk:~# chmod -R 777 /dev/audio
root@Asterisk:~# /etc/init.d/asterisk restart
root@Asterisk:~# asterisk -rvvvvvvvvv
console dial 6000@default
console hangup
But that is probably not the way to do it. How to do this correctly?
The following works once but stops working as soon as I unplug and replug the USB sound device:
root@Asterisk:~# usermod -a -G audio asterisk
root@Asterisk:~# chown -R asterisk /dev/snd
root@Asterisk:~# /etc/init.d/asterisk restart
root@Asterisk:~# asterisk -rvvvvvvvvv
console dial 6000@default
console hangup
How can I tell the system that the asterisk user is allowed to use /dev/snd
permanently?
I guess root@Asterisk:~# sed -i -e 's|audio|asterisk|g' /etc/hotplug.json
is not the way to go either? Although after a reboot it seems to "work"...