Closed ahmeaqas closed 1 year ago
You need to create dongle.conf
file in ./data/izpbx/etc/asterisk
directory.
Thank you so much @luzrain for your help. Now I have one more issue,
WARNING[1238]: chan_dongle.c:229 opentty: unable to open /dev/ttyUSB2: Permission
WARNING[1238]: chan_dongle.c:229 opentty: unable to open /dev/ttyUSB2: Permission
Hi, if you enter inside the container the file /dev/ttyUSB2 exist? permissions? can you print ls -al /dev/ttyUSB2
Thank you
ls -al /dev/ttyUSB2
produce following output
crw-rw---- 1 root games 188, 2 Mar 22 14:52 /dev/ttyUSB2
This is my docker compose file
`version: '3'
networks: izpbx: driver: bridge
#driver: macvlan
#driver_opts:
#parent: eth0
#ipam:
#config:
#- subnet: 10.1.1.0/24
services:
db:
#image: docker.io/mariadb:10.11.2
# previous long term release
image: docker.io/mariadb:10.6.12
container_name: izpbx-db
## WARNING: if you upgrade image tag enter the container and run mysql_upgrade:
## source .env ; docker exec -it izpbx-db mysql_upgrade -u root -p$MYSQL_ROOT_PASSWORD
command: --sql-mode=ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
restart: unless-stopped
env_file:
- .env
environment:
- TZ
- MYSQL_DATABASE
- MYSQL_USER
- MYSQL_PASSWORD
- MYSQL_ROOT_PASSWORD
#- MARIADB_RANDOM_ROOT_PASSWORD=${MYSQL_RANDOM_ROOT_PASSWORD}
#- MARIADB_ALLOW_EMPTY_ROOT_PASSWORD=${MYSQL_ALLOW_EMPTY_ROOT_PASSWORD}
volumes:
#- /etc/localtime:/etc/localtime:ro
- ./data/db:/var/lib/mysql
## NOTE: to avoid nat management use: 'network_mode: host'
#network_mode: host
## WARNING: if 'network_mode: host' is disabled, comment out the following lines
networks:
izpbx:
## WARNING: if commented out, the database will be exposed outside the container
ports:
- ${APP_PORT_MYSQL}:3306
izpbx: image: docker.io/izdock/izpbx-asterisk:20.16.5 container_name: izpbx
devices:
- /dev/ttyUSB0:/dev/ttyUSB1
- /dev/ttyUSB0:/dev/ttyUSB2
#hostname: ${APP_FQDN}
restart: unless-stopped
depends_on:
- db
env_file:
- .env
volumes:
#- /etc/localtime:/etc/localtime:ro
- ./data/izpbx:/data
## fail2ban need privileged mode to manage iptables
cap_add:
- NET_ADMIN
#security_opt:
#- seccomp=unconfined
privileged: true
ulimits:
nofile:
soft: 8192
hard: 32768
## NOTE: to avoid SIP-RTP NAT issues use: 'network_mode: host'
network_mode: host
## WARNING: if 'network_mode: host' is disabled, comment out the following lines
## ports are not needed if using 'network_mode: host' or macvlan network driver
## if you want use macvlan network driver comment out 'izpbx-ext:' too and change exposed IP according your needs
#networks:
# izpbx:
# izpbx-ext:
# ipv4_address: 10.1.1.221
#ports:
#- ${APP_PORT_HTTP}:${APP_PORT_HTTP}
#- ${APP_PORT_HTTPS}:${APP_PORT_HTTPS}
#- ${APP_PORT_IAX}:${APP_PORT_IAX}
#- ${APP_PORT_IAX}:${APP_PORT_IAX}/udp
#- ${APP_PORT_PJSIP}:${APP_PORT_PJSIP}
#- ${APP_PORT_PJSIP}:${APP_PORT_PJSIP}/udp
#- ${APP_PORT_SIP}:${APP_PORT_SIP}/udp
#- ${APP_PORT_SIP}:${APP_PORT_SIP}
#- ${APP_PORT_WEBRTC}:${APP_PORT_WEBRTC}
#- ${APP_PORT_UCP_HTTP}:${APP_PORT_UCP_HTTP}
#- ${APP_PORT_UCP_HTTPS}:${APP_PORT_UCP_HTTPS}
#- ${APP_PORT_AMI}:${APP_PORT_AMI}
#- ${APP_PORT_RTP_START}-${APP_PORT_RTP_END}:${APP_PORT_RTP_START}-${APP_PORT_RTP_END}
#- ${APP_PORT_RTP_START}-${APP_PORT_RTP_END}:${APP_PORT_RTP_START}-${APP_PORT_RTP_END}/udp
#- ${APP_PORT_DHCP}:${APP_PORT_DHCP}/udp
#- ${APP_PORT_TFTP}:${APP_PORT_TFTP}
#- ${APP_PORT_TFTP}:${APP_PORT_TFTP}/udp
#- ${APP_PORT_NTP}:${APP_PORT_NTP}/udp
#- ${APP_PORT_FOP2}:${APP_PORT_FOP2}
#- ${APP_PORT_ZABBIX}:${APP_PORT_ZABBIX}`
ls -al /dev/ttyUSB2
produce following output
crw-rw---- 1 root games 188, 2 Mar 22 14:52 /dev/ttyUSB2
can you run:
(izPBX)[root@pbx.initzero: /]# id asterisk
uid=1000(asterisk) gid=1000(asterisk) groups=1000(asterisk),10(wheel),48(apache)
(izPBX)[root@pbx.initzero: /]# gpasswd -a asterisk games
Adding user asterisk to group games
(izPBX)[root@pbx.initzero: /]# id asterisk
uid=1000(asterisk) gid=1000(asterisk) groups=1000(asterisk),10(wheel),20(games),48(apache)
supervisorctl restart izpbx
if works I must add asterisk users to games (in your distro)....
anyway can you print the GID number?
ls -aln /dev/ttyUSB2
tnx
I have run the following commands and it produces the same out.
(izPBX)[root@pbx.initzero: /]# id asterisk uid=1000(asterisk) gid=1000(asterisk) groups=1000(asterisk),10(wheel),48(apache)
(izPBX)[root@pbx.initzero: /]# gpasswd -a asterisk games Adding user asterisk to group games
(izPBX)[root@pbx.initzero: /]# id asterisk uid=1000(asterisk) gid=1000(asterisk) groups=1000(asterisk),10(wheel),20(games),48(apache)
Moreover,
ls -aln /dev/ttyUSB2 produces the following output
crw-rw---- 1 0 20 188, 2 Mar 22 14:52 /dev/ttyUSB2
I am still getting the same permission error.
ok, you must add asterisk user to group id: 188
(the games group from what env came from? ouside or inside izpbx docker container)
anyway try with:
id asterisk ; usermod -G wheel,apache,188 asterisk ; id asterisk
supervisorctl restart izpbx
the games group from what env came from? ouside or inside izpbx docker
inside izpx docker
Error experienced
id asterisk ; usermod -G wheel,apache,188 asterisk ; id asterisk
usermod: group '188' does not exist
I have resolved the issue. Hope this article will help someone else.
Hello @ugoviti,
What a great project, I congratulate you for making Asterisk and FreeBPX install such easy.
I have just grabbed release 20.16.5, unzipped it and copied default.env to .env and deploy it using docker compose on a PC with fresh install of UBUNTU 20.04.
Containers are up and running with no error. As per changelog, Chan_dongle is supported since 18.16.10.
But I have accessed the asterisk CLI of the container but
core show help
does not show dongle supported commands.May you please put light on further steps to go on?