Setup Dahdi for asterisk on LXC container

Dito

New Member
Oct 5, 2016
5
0
1
48
Hello all,
i am moving to LXC with care using the proxmox openvz for years ...
wanted to know if there is a similar command from PCT to those one :
vzctl set $VENUMBER --devnodes dahdi/pseudo:rw --save
vzctl exec $VENUMBER chown -R asterisk /dev/dahdi /lib/udev/devices/dahdi
vzctl exec $VENUMBER chgrp -R asterisk /dev/dahdi /lib/udev/devices/dahdi
those commands with vzctl will let the container to access the dahdi source on the node to make conferences work with asterisk pbx. i hope there is similar commands with PCT ..


 
Hi,

I bridged the USB dongles to my LXC container that runs asterisk. For this I added to the file /etc/pve/nodes/pve/lxc/_ctno_.conf

Code:
lxc.cgroup.devices.allow: c 188:* rwm
lxc.cgroup.devices.allow: c 189:* rwm
lxc.mount.entry: /dev/bus/usb dev/bus/usb none bind,optional,create=dir
lxc.mount.entry: /dev/ttyUSB0 dev/ttyUSB0 none bind,optional,create=file
lxc.mount.entry: /dev/ttyUSB1 dev/ttyUSB1 none bind,optional,create=file
lxc.mount.entry: /dev/ttyUSB2 dev/ttyUSB2 none bind,optional,create=file
lxc.mount.entry: /dev/ttyUSB3 dev/ttyUSB3 none bind,optional,create=file
lxc.mount.entry: /dev/ttyUSB4 dev/ttyUSB4 none bind,optional,create=file
lxc.mount.entry: /dev/ttyUSB5 dev/ttyUSB5 none bind,optional,create=file
lxc.cgroup.devices.allow: c 10:200 rwm

and for the PCI soundcard:
Code:
lxc.mount.entry: /dev/snd dev/snd none bind,create=dir,optional 0 0
lxc.cgroup.devices.allow: c 116:* rwm

In the container I had to create the /dev/snd entry point and for /dev/ttyUSB* I had to fix the user:group owner so that asterisk can access it.

I hope this helps,
Rares
 
  • Like
Reactions: Dito
Hi,

I bridged the USB dongles to my LXC container that runs asterisk. For this I added to the file /etc/pve/nodes/pve/lxc/_ctno_.conf

Code:
lxc.cgroup.devices.allow: c 188:* rwm
lxc.cgroup.devices.allow: c 189:* rwm
lxc.mount.entry: /dev/bus/usb dev/bus/usb none bind,optional,create=dir
lxc.mount.entry: /dev/ttyUSB0 dev/ttyUSB0 none bind,optional,create=file
lxc.mount.entry: /dev/ttyUSB1 dev/ttyUSB1 none bind,optional,create=file
lxc.mount.entry: /dev/ttyUSB2 dev/ttyUSB2 none bind,optional,create=file
lxc.mount.entry: /dev/ttyUSB3 dev/ttyUSB3 none bind,optional,create=file
lxc.mount.entry: /dev/ttyUSB4 dev/ttyUSB4 none bind,optional,create=file
lxc.mount.entry: /dev/ttyUSB5 dev/ttyUSB5 none bind,optional,create=file
lxc.cgroup.devices.allow: c 10:200 rwm

and for the PCI soundcard:
Code:
lxc.mount.entry: /dev/snd dev/snd none bind,create=dir,optional 0 0
lxc.cgroup.devices.allow: c 116:* rwm

In the container I had to create the /dev/snd entry point and for /dev/ttyUSB* I had to fix the user:group owner so that asterisk can access it.

I hope this helps,
Rares

thanks for the reply i start desesperating !
i just want to use ztdummy for the conferences ..
big regrets moving to lxc .. i was quite with openvz...
 
Hi Dito,

Did you manage to get it work? /dev/dahdi is a file or a folder? Can you adapt the example from /dev/ttyUSB that is a file or the one from /dev/snd that is a folder? To find the cgroup numbers you can just do a: ls -l /dev/dahdi

I have LXC working all over the place and no problems so far. I think it's just a matter of accommodation to the new system.

Rares
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!