From ef4b45925c9e20e8194507209eb02df587667979 Mon Sep 17 00:00:00 2001 From: Stefan Bethke Date: Sun, 6 Jul 2025 19:07:27 +0200 Subject: [PATCH] Move lines over to yate Basic functionality should be working for incoming calls: * Fux Intercom to 1337 * Fonial to the Hamburg number * EPVPN Still to do: clean up internal extensions and more extensive testing --- inventories/z9/host_vars/yate.sops.yaml | 14 ++++--- .../z9/yate/docker_compose/accfile.conf.j2 | 25 ++++------- .../z9/yate/docker_compose/regexroute.conf.j2 | 35 +++++++++++++--- .../z9/yate/docker_compose/regfile.conf.j2 | 42 +++++++++++-------- 4 files changed, 71 insertions(+), 45 deletions(-) diff --git a/inventories/z9/host_vars/yate.sops.yaml b/inventories/z9/host_vars/yate.sops.yaml index f28fce6..e918e14 100644 --- a/inventories/z9/host_vars/yate.sops.yaml +++ b/inventories/z9/host_vars/yate.sops.yaml @@ -1,11 +1,13 @@ #ENC[AES256_GCM,data:Oc2DdKVMymwkIHbS84TeTQY=,iv:UMhNafqQrHaF5iqFSev6D1uqHPFpKQTkOpYV6JncjsU=,tag:mAmBMyGdzER3hkSkV2Fjtw==,type:comment] -secret__sip_trunk_epvpn: ENC[AES256_GCM,data:d3iilbnE29J1hyL3,iv:PWYRqumnPkqhQvXNCnWVGpwkOoiljzoX4W7ngeZzw0A=,tag:uChMn2/d3rl+7XAAZ1ACzg==,type:str] -secret__sip_trunk_fonial: ENC[AES256_GCM,data:Cm0ajT2OCfWxsw==,iv:+JUIhZeFrbx0M4uKJTt22qnL/rTiPv09B58Vxyrnu1Y=,tag:gH1EmyByqTxvIVnyPmO1ag==,type:str] -secret__sip_trunk_fux: ENC[AES256_GCM,data:Ea7SDDXydgXWtQ==,iv:8G/w40wfH7pjhJJQOLt3u82iIC7hFonDQ2JEdD9E1mQ=,tag:bcPJPAU4/TkJbj2MCY3htQ==,type:str] -secret__sip_trunk_fritzbox: ENC[AES256_GCM,data:nRJr4jdrZlP6/7NCahbi,iv:O6xwD8z6hjrP51ZwUuC91SGi46Fc6hAFs6/MeMTPUQ0=,tag:nBG5J1Rbh4q0vYkIWJcY0w==,type:str] +secret__yate__sip_trunk_epvpn: ENC[AES256_GCM,data:BkdNaCooUjsDlCXJ,iv:saO4IGsz1HAinvW5ZGAMA4WEtBbo+UNdfBkr0g29uag=,tag:t8RM0GNYhl1w/RMNO8wKbQ==,type:str] +secret__yate__sip_trunk_fonial: ENC[AES256_GCM,data:N18C3XZHIi1/IA==,iv:vs9dCYNRp+1ptxRajdUO5ODTOmNREJslF99xnFL92XM=,tag:IUmnlPeRI1WTRYELzZRk/w==,type:str] +secret__yate__sip_trunk_fux: ENC[AES256_GCM,data:zcVxNjyS3BE2dw==,iv:Prmy8nP1yeFrVI5mQaPJPKHGFCzuZp84f6fH04I9zJM=,tag:X15wqvaaifMU2/kcqLqUZQ==,type:str] +secret__yate__sip_extension_fritzbox_analog1: ENC[AES256_GCM,data:+ayQ6P4P34D5hTNOFv3HVA==,iv:UD71G07Z633mDmvnJVei9SKgHyM+JFXJdtOhyBhvKGY=,tag:0ISsYGQCIMMgToLWA09JwQ==,type:str] +secret__yate__sip_extension_fritzbox_analog2: ENC[AES256_GCM,data:DbFmTcZ8wW2fqstm09yUWw==,iv:jKUqtSXaGF/QpIwPJ6hKQWZvv9xtZeIQBiPHt2xm+3I=,tag:MkWzODFnWZc8o+pVLR3KJw==,type:str] +secret__yate__sip_extension_fritzbox_dect1: ENC[AES256_GCM,data:87MFTNA0DXmfhesT/M++ug==,iv:qDM8HWZhG9FADLFNPRJXkadN2jXD6/CfroDShNPzA+o=,tag:Ylf56nCczEdDaOGko5GrBw==,type:str] sops: - lastmodified: "2025-07-05T09:09:46Z" - mac: ENC[AES256_GCM,data:uESZwlbt5HttxnrATrQNqaTIpupIJebgFmjlAbEF20jmI5Wx1XoeihckTSgFAYvVAX+cy73DdZLZVBmsuAkMb4aEYn2w0uYW9poOkWlM0h6k+S5pEDvNnwWzWkU77sWalO0f8rw6Hhhe9ivq1TrENmiWZm8G+/2zfE/ZowwzjQY=,iv:bqGCbmZGWyTRUfqi1L6DfSkfW9YNcAulxbGqJ+4jiO8=,tag:myQprRD/f/wJ+wA9SQ3gcw==,type:str] + lastmodified: "2025-07-06T16:29:39Z" + mac: ENC[AES256_GCM,data:icI7rk+KiSlQOpUYVFFSLUqQ6x7gC+tLMrbCLJmmQlThxYNevnL1G5IdKL/qsqleKaU9lrvGatFWP4MjavhXvcvRkMzllwmKG2VwZ65BzXq5JGsdu/Su5hJlJpya4dA412v2WBXuR8+ZgIIIEYG6scalyOWbRp4/u1d934J9VBE=,iv:vkz/rfJ8N6UrUgNF/thcx3kVJ7hzr6/XVG5J+PV4Pro=,tag:8yiIXKDzK2VWTMxirjeGwg==,type:str] pgp: - created_at: "2025-07-04T17:33:05Z" enc: |- diff --git a/resources/z9/yate/docker_compose/accfile.conf.j2 b/resources/z9/yate/docker_compose/accfile.conf.j2 index cd99009..4ce65e3 100644 --- a/resources/z9/yate/docker_compose/accfile.conf.j2 +++ b/resources/z9/yate/docker_compose/accfile.conf.j2 @@ -2,41 +2,34 @@ ; see https://github.com/eventphone/yate/blob/master/conf.d/accfile.conf.sample [epvpn_ccchh] -enabled=no +enabled=yes protocol=sip description=Eventphone EPVPN CCCHH username=1008 authname=1008 -password={{ secret__sip_trunk_epvpn }} +password={{ secret__yate__sip_trunk_epvpn }} interval=120 registrar=hg.eventphone.de +keepalive=1 [fonial_ccchh] -enabled=no +enabled=yes protocol=sip description=Fonial CCCHH username=fo370381tr317349_00 authname=fo370381tr317349_00 -password={{ secret__sip_trunk_fonial }} +password={{ secret__yate__sip_trunk_fonial }} interval=120 registrar=sip.plusnet.de +keepalive=1 [fux_intercom] -enabled=no +enabled=yes protocol=sip description=Fux Intercom CCCHH doorbell username=1337 authname=1337 -password={{ secret__sip_trunk_fux }} +password={{ secret__yate__sip_trunk_fux }} interval=120 registrar=172.16.210.2 - -[fritzbox] -enabled=yes -protocol=sip -description=yate-fritz betatest -username=624 -authname=624 -password={{ secret__sip_trunk_fritzbox }} -interval=120 -registrar=10.31.210.86:5060 \ No newline at end of file +keepalive=1 diff --git a/resources/z9/yate/docker_compose/regexroute.conf.j2 b/resources/z9/yate/docker_compose/regexroute.conf.j2 index d717aa3..198340a 100644 --- a/resources/z9/yate/docker_compose/regexroute.conf.j2 +++ b/resources/z9/yate/docker_compose/regexroute.conf.j2 @@ -7,11 +7,18 @@ 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 +${called}^1337$=inbound_fux +${called}^1008$=inbound_epvpn +${called}^04023830150$=inbound_fonial +${called}^fo370381tr317349_00$=inbound_fonial +;${called}.*=inbound + +;^[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: +^[0-9]\{3\}=outbound ^[a-z0-9]\{4,\}=outbound ; calls from internal users ^.*$=fallback ; Whatever calls managed to not be handled yet @@ -37,15 +44,33 @@ route=90 [outbound] ; Calls from internal users +^.*$=echo [outbound] "\0" ${caller}->${called} ; log for debug +^[0-9]\{3\}$=jump internal ^[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 +^.*$=line/\0;line=epvpn_ccchh ; Route everything (.*) to the specified accfile line + +[inbound_epvpn] +^.*$=echo [inbound_epvpn] ${caller}->${called} +^.*$=return;callername=EPVPN ${caller};called=0 ; TODO which extension do we want to route to? + +[inbound_fux] +^.*$=echo [inbound_fux] ${caller}->${called} +^.*$=return;callername=Door ${caller};called=0 ; TODO which extension do we want to route to? + +[inbound_fonial] +^.*$=echo [inbound_fonial] ${caller}->${called} +^.*$=return;callername=Fonial ${caller};called=0 ; TODO which extension do we want to route to? [inbound] ; Calls from EPVPN or outside world -^.*$=echo [inbound] "\0" ${caller}->${called} user:${user} ; log +^.*$=echo [inbound] "\0" ${caller}->${called} user:${user} callername:${callername} callsource:${callsource} ; log ^.*$=return;callername=EXTERN ${caller};called=0 ; set call recipient to 0 (shared alias between ; all clients in regfile.conf +[internal] +^.*$=echo [internal] "\0" ${caller}->${called} +^.*$=return;called=\0 + [z9] ; Internal calls ^.*$=echo [z9] "\0" ${caller}->${called} ; log diff --git a/resources/z9/yate/docker_compose/regfile.conf.j2 b/resources/z9/yate/docker_compose/regfile.conf.j2 index 229a228..d77e14f 100644 --- a/resources/z9/yate/docker_compose/regfile.conf.j2 +++ b/resources/z9/yate/docker_compose/regfile.conf.j2 @@ -4,67 +4,73 @@ route=100 file=/var/lib/yate/regfile.swap +[610] +password={{ secret__yate__sip_extension_fritzbox_dect1 }} +alternatives=0,1008,1337 +callername=DECT-1 + +[100] +password=test100 +callername=Test 100 + + [echt] password=test -alternatives=0,9,91,3248 +alternatives=0,9,91,3248,1337 [test] password=test -alternatives=0,9,92,3248 +alternatives=0,9,92,3248,1337 [unittest1] password=test -alternatives=93,3248 +alternatives=93,3248,1337 + [unittest2] password=test -alternatives=94,3248 +alternatives=94,3248,1337 [door] password=test -alternatives=0,1,11,3248 +alternatives=0,1,11,3248,1337 callername=Main Door [kitchen] password=test -alternatives=0,1,12,3248 +alternatives=0,1,12,3248,1337 callername=Kitchen [desk] password=test -alternatives=0,1,13,3248 +alternatives=0,1,13,3248,1337 callername=Desk [workshop] password=test -alternatives=0,2,21,3248 +alternatives=0,2,21,3248,1337 callername=Workshop Lobby [clean] password=test -alternatives=0,2,22,3248 +alternatives=0,2,22,3248,1337 callername=Clean Workshop [dirty] password=test -alternatives=0,2,23,3248 +alternatives=0,2,23,3248,1337 callername=Dirty Workshop [dect1] password=test -alternatives=0,3,31,3248 +alternatives=0,3,31,3248,1337 callername=DECT-1 -[dect2] -password=test -alternatives=0,3,32,3248 -callername=DECT-2 - [analog1] password=test -alternatives=0,4,41,3248 +alternatives=0,4,41,3248,1337 callername=Analog-1 [analog2] password=test -alternatives=0,4,42,3248 +alternatives=0,4,42,3248,1337 callername=Analog-2