Add yate
Some checks failed
/ Ansible Lint (push) Failing after 3m4s

This commit is contained in:
Stefan Bethke 2025-07-04 20:51:14 +02:00
commit eefcbe0c43
8 changed files with 448 additions and 0 deletions

View file

@ -0,0 +1,12 @@
# Yate Configuration
Yate has a [beginners guide](https://docs.yate.ro/wiki/Beginners_in_Yate). Otherwise, you need to refer to the [sample config files](https://github.com/eventphone/yate/tree/master/conf.d).
For our limited setup, we only need three files:
* accfile.conf for defining SIP registrars that we want to register with (EPVPN, Fonial, and the Fux door intercom system)
* regexroute.conf for the call routing rules
* regfile.conf for the phones that connect to yate.ccchh.net
## Docker Compose Setup
yate runs as a container wiht host networking. The image is build through https://git.hamburg.ccc.de/CCCHH/yate-image, it is using the Eventphone fork of yate.

View file

@ -0,0 +1,51 @@
; Yate will register to these SIP services
; see https://github.com/eventphone/yate/blob/master/conf.d/accfile.conf.sample
[epvpn_test]
enabled=no
protocol=sip
description= testing in/outbound routing
username=
authname=
password=
interval=120
registrar=hg.eventphone.de
[ccchh]
enabled=no
protocol=sip
description=yate.hamburg.ccc.de
username=1008
authname=1008
password=5kVLqoQ7CmCV
interval=120
registrar=hg.eventphone.de
[landline]
enabled=no
protocol=sip
description=CCCHH landline
username=
authname=
password=
interval=120
registrar=
[doorbell]
enabled=no
protocol=sip
description=CCCHH doorbell powered by fux-infra
username=
authname=
interval=120
registrar=
[fritzbox]
enabled=yes
protocol=sip
description=yate-fritz betatest
username=624
authname=624
password=n0vr3jn305894j2
interval=120
registrar=10.31.210.86:5060

View file

@ -0,0 +1,20 @@
---
services:
yate:
image: git.hamburg.ccc.de/ccchh/yate-image/yate-image:latest
# command:
# - sh
# - "-c"
# - "while :; do sleep 10; done"
environment:
DEBUG: true
network_mode: host
# ports:
# - "127.0.0.1:3000:3000"
restart: unless-stopped
volumes:
- ./configs/accfile.conf:/opt/yate/etc/yate/accfile.conf
- ./configs/regexroute.conf:/opt/yate/etc/yate/regexroute.conf
- ./configs/regfile.conf:/opt/yate/etc/yate/regfile.conf
- ./lib-yate:/var/lib/yate

View file

@ -0,0 +1,69 @@
; Call routing
; see https://github.com/eventphone/yate/blob/master/conf.d/regexroute.conf.sample
[priorities]
; route: int: Priority of the routing message handler
route=90
[contexts]
; INBOUND CALLS:
^[0-9]\{4\}$=inbound ; Calls from 4 digit numbers: EPVPN
^+\?[0-9]\{5,\}$=inbound ; Calls from longer numbers, optionally starting with +
^*\{1,2\}[0-9]\{1,3\}$=inbound ; Internal fritzbox calls
; OUTBOUND CALLS:
^[a-z0-9]\{4,\}=outbound ; calls from internal users
^.*$=fallback ; Whatever calls managed to not be handled yet
[default] ; unused
^.*$=echo [default]"\0"
[test] ; unused
^.*$=echo [test] "\0"
^99991001$=tone/dial
^99991002$=tone/busy
^99991003$=tone/ring
^99991004$=tone/specdial
^99991005$=tone/congestion
^99991006$=tone/outoforder
^99991007$=tone/milliwatt
^99991008$=tone/info
; DEBUG HELPER
; ^.*$=echo match \0 adr ${address} src ${callsource} form ${formats} id ${id} peer ${peerid} type ${type} user ${username} caller ${caller} called ${called}
^[0-9]\{1,2\}$=return;called=\0
[outbound] ; Calls from internal users
^[0-9]\{1,2\}$=jump z9 ; To internal -> z9
^.*$=echo [outbound] "\0" ${caller}->${called} ; log for debug
^.*$=line/\0;line=fritzbox ; Route everything (.*) to the specified accfile line
[inbound] ; Calls from EPVPN or outside world
^.*$=echo [inbound] "\0" ${caller}->${called} user:${user} ; log
^.*$=return;callername=EXTERN ${caller};called=0 ; set call recipient to 0 (shared alias between
; all clients in regfile.conf
[z9] ; Internal calls
^.*$=echo [z9] "\0" ${caller}->${called} ; log
; test service numbers
^91$=sip/sip:ha@10.31.208.10:5060; called=ha;format=opus ; Homeassistant
^98$=external/playrec/echo.sh ; Echotest
^99$=external/play/tts.sh;mode=text;text=Hallo Hallo Hallo ; TTS test
^.*$=return;called=\0 ; Any remaining internal calls to all
; Context: Calls to regfile.conf aliases are always
; handled directly and should never get here
[special]
^.*$=echo [special] "\0"
^.*$=tone/info
[fallback]
^.*$=echo [fallback] \0 adr ${address} src ${callsource} form ${formats} id ${id} peer ${peerid} type ${type} user ${username} caller ${caller} called ${called}
^*\{1,2\}[0-9]\{1,3\}$=jump outbound
^.*$=tone/busy

View file

@ -0,0 +1,70 @@
; YATE offers registration to these SIP devices (ie. phones)
; see https://github.com/eventphone/yate/blob/master/conf.d/regfile.conf.sample
route=100
file=/var/lib/yate/regfile.swap
[echt]
password=test
alternatives=0,9,91,3248
[test]
password=test
alternatives=0,9,92,3248
[unittest1]
password=test
alternatives=93,3248
[unittest2]
password=test
alternatives=94,3248
[door]
password=test
alternatives=0,1,11,3248
callername=Main Door
[kitchen]
password=test
alternatives=0,1,12,3248
callername=Kitchen
[desk]
password=test
alternatives=0,1,13,3248
callername=Desk
[workshop]
password=test
alternatives=0,2,21,3248
callername=Workshop Lobby
[clean]
password=test
alternatives=0,2,22,3248
callername=Clean Workshop
[dirty]
password=test
alternatives=0,2,23,3248
callername=Dirty Workshop
[dect1]
password=test
alternatives=0,3,31,3248
callername=DECT-1
[dect2]
password=test
alternatives=0,3,32,3248
callername=DECT-2
[analog1]
password=test
alternatives=0,4,41,3248
callername=Analog-1
[analog2]
password=test
alternatives=0,4,42,3248
callername=Analog-2