commit f35d0d704193be5bcf83b0acff6b7a05bf7b2009
parent ee092700f91d6c3849d6e7c63c9580fc0fa91850
Author: MTRNord <mtrnord1@gmail.com>
Date: Wed, 16 Aug 2023 00:42:26 +0200
Hellow world
Diffstat:
1 file changed, 65 insertions(+), 1 deletion(-)
diff --git a/nixos/worker-1/configuration.nix b/nixos/worker-1/configuration.nix
@@ -481,7 +481,71 @@
# FIXME: Remove at some point. This is a test tbh
services.asterisk = {
enable = true;
- extraConfig = "";
+ confFiles = {
+ "extensions.con" = ''
+ [from-internal]
+ exten = 100,1,Answer()
+ same = n,Wait(1)
+ same = n,Playback(hello-world)
+ same = n,Hangup()
+
+ [unauthorized]
+ '';
+
+ "sip.conf" = ''
+ [general]
+ allowguest=no ; Require authentication
+ context=unauthorized ; Send unauthorized users to /dev/null
+ srvlookup=no ; Don't do DNS lookup
+ udpbindaddr=0.0.0.0 ; Listen on all interfaces
+
+ [6001](!)
+ type=friend ; Match on username first, IP second
+ context=from-internal ; Send to from-internal context in
+ ; extensions.conf file
+ host=dynamic ; Device will register with asterisk
+ secret=meow
+ disallow=all ; Manually specify codecs to allow
+ allow=g722
+ allow=ulaw
+ allow=alaw
+ '';
+
+ "logger.conf" = ''
+ [general]
+
+ [logfiles]
+ ; Add debug output to log
+ syslog.local0 => notice,warning,error,debug
+ '';
+
+ "pjsip.conf" = ''
+ [transport-udp]
+ type=transport
+ protocol=udp
+ bind=0.0.0.0
+
+ [6001]
+ type=endpoint
+ context=from-internal
+ disallow=all
+ allow=g722
+ allow=ulaw
+ allow=alaw
+ auth=6001
+ aors=6001
+
+ [6001]
+ type=auth
+ auth_type=userpass
+ password=meow
+ username=6001
+
+ [6001]
+ type=aor
+ max_contacts=1
+ '';
+ };
};
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion