Fixed Asterisk. Multi-numbers now.

Some other things, too. I guess.
This commit is contained in:
kat witch 2021-02-25 06:00:24 +00:00
parent 099c17528c
commit 1b8bad256d
No known key found for this signature in database
GPG key ID: 1B477797DCA5EC72
4 changed files with 17 additions and 6 deletions

View file

@ -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

View file

@ -10,7 +10,7 @@
./virtualhosts.nix
# services
./mail.nix
./phone.nix
./asterisk.nix
./gitea.nix
./nextcloud.nix
./bitwarden.nix

View file

@ -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";

View file

@ -25,6 +25,7 @@ in {
mumble
obs-studio
xfce.ristretto
audacity
avidemux
vlc
ffmpeg-full