From 1b8bad256d37b853d7d03e9c26f0bb998b60225a Mon Sep 17 00:00:00 2001 From: kat witch Date: Thu, 25 Feb 2021 06:00:24 +0000 Subject: [PATCH] Fixed Asterisk. Multi-numbers now. Some other things, too. I guess. --- config/hosts/athame/{phone.nix => asterisk.nix} | 17 ++++++++++++----- config/hosts/athame/configuration.nix | 2 +- config/hosts/athame/virtualhosts.nix | 3 +++ config/users/kat/desktop.nix | 1 + 4 files changed, 17 insertions(+), 6 deletions(-) rename config/hosts/athame/{phone.nix => asterisk.nix} (89%) diff --git a/config/hosts/athame/phone.nix b/config/hosts/athame/asterisk.nix similarity index 89% rename from config/hosts/athame/phone.nix rename to config/hosts/athame/asterisk.nix index 1e78659b..e760359a 100644 --- a/config/hosts/athame/phone.nix +++ b/config/hosts/athame/asterisk.nix @@ -5,19 +5,26 @@ in { services.asterisk = { enable = true; confFiles = { + "rtp.conf" = '' + [general] + rtpstart=10000 + rtpend=20000 + ''; "extensions.conf" = '' [outbound] exten => _1NXXNXXXXXX,1,Dial(PJSIP/''${EXTEN}@signalwire) [from-signalwire] exten => s,1,Set(numb=''${CUT(CUT(PJSIP_HEADER(read,To),@,1),:,2)}) - same => n,Goto(''${numb:1},1) ; Using ''${numb:1} simply strips away the first character or number, in this case a‘+’ - exten => ${secrets.hosts.athame.phone.number},1,Dial(SIP/1337,20) + same => n,Dial(SIP/1337,20) [from-internal] - exten => _.,1,Set(CALLERID(all)="kat" <+${secrets.hosts.athame.phone.number}>) - same => n,Dial(PJSIP/''${EXTEN}@signalwire) - same => n(end),Hangup() + exten => _1X.,1,Set(CALLERID(all)="kat" <+${secrets.hosts.athame.phone.number.us}>) + same => n,Dial(PJSIP/''${EXTEN:1}@signalwire) + same => n(end),Hangup() + exten => _2X.,1,Set(CALLERID(all)="kat" <+${secrets.hosts.athame.phone.number.canada}>) + same => n,Dial(PJSIP/''${EXTEN:1}@signalwire) + same => n(end),Hangup() ''; "pjproject.conf" = '' ; Common pjproject options diff --git a/config/hosts/athame/configuration.nix b/config/hosts/athame/configuration.nix index d67bb8eb..eb68c2e9 100644 --- a/config/hosts/athame/configuration.nix +++ b/config/hosts/athame/configuration.nix @@ -10,7 +10,7 @@ ./virtualhosts.nix # services ./mail.nix - ./phone.nix + ./asterisk.nix ./gitea.nix ./nextcloud.nix ./bitwarden.nix diff --git a/config/hosts/athame/virtualhosts.nix b/config/hosts/athame/virtualhosts.nix index 057758b0..efd911d4 100644 --- a/config/hosts/athame/virtualhosts.nix +++ b/config/hosts/athame/virtualhosts.nix @@ -30,6 +30,9 @@ in { ''; }; } // common; + "athame.kittywit.ch" = { + root = "/var/www/athame"; + } // common; "vault.kittywit.ch" = { locations = { "/".proxyPass = "http://127.0.0.1:4000"; diff --git a/config/users/kat/desktop.nix b/config/users/kat/desktop.nix index 5618b3e7..f786af34 100644 --- a/config/users/kat/desktop.nix +++ b/config/users/kat/desktop.nix @@ -25,6 +25,7 @@ in { mumble obs-studio xfce.ristretto + audacity avidemux vlc ffmpeg-full