From 6d622c49378856276b2eb8a779d0d5b0e6cbfa27 Mon Sep 17 00:00:00 2001 From: kurogeek Date: Tue, 28 Oct 2025 16:03:13 +0700 Subject: [PATCH] mob next [ci-skip] [ci skip] [skip ci] lastFile:modules/clan/phonebox/default.nix --- machines/rigel/networking.nix | 1 - modules/clan/phonebox/default.nix | 39 +++++++++++++++++++++++++++---- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/machines/rigel/networking.nix b/machines/rigel/networking.nix index c0ace45..1381fc5 100644 --- a/machines/rigel/networking.nix +++ b/machines/rigel/networking.nix @@ -47,7 +47,6 @@ in domain = "localhost"; dhcp-range = [ "192.168.254.100,192.168.254.100,255.255.255.0,24h" - "${ipv6Subnet}10,${ipv6Subnet}240,slaac" ]; dhcp-option = [ "3,192.168.254.1" diff --git a/modules/clan/phonebox/default.nix b/modules/clan/phonebox/default.nix index f9c9597..acfe7d6 100644 --- a/modules/clan/phonebox/default.nix +++ b/modules/clan/phonebox/default.nix @@ -11,6 +11,11 @@ lib, ... }: + let + ata-interface = ""; + rtpPortFrom = 10000; + rtpPortTo = 20000; + in { networking.interfaces = { ${ata-interface} = { @@ -37,7 +42,6 @@ ]; dhcp-option = [ "3,192.168.254.1" - "option6:information-refresh-time,3600" ]; interface = [ ata-interface ]; }; @@ -56,8 +60,8 @@ networking.firewall.allowedUDPPortRanges = [ { - from = 10000; - to = 20000; + from = rtpPortFrom; + to = rtpPortTo; } ]; @@ -69,7 +73,6 @@ networking.firewall.allowedTCPPorts = [ 53 80 - 443 ]; services.asterisk = { @@ -106,6 +109,12 @@ exten => 8001,1,Dial(PJSIP/8001@kurogeek,20) ''; + "rtp.conf" = '' + [general] + rtpstart=10000 + rtpend=20000 + ''; + "pjsip.conf" = '' [transport-udp] type=transport @@ -116,6 +125,28 @@ protocol=udp bind=:: + [base_endpoint](!) + type=endpoint + disallow=all + allow=ulaw,alaw,g722,gsm + direct_media=no + + [internal_endpoint](!,base_endpoint) + context=from-internal + + [external_endpoint](!,base_endpoint) + context=from-external + + [userpass_auth](!) + type=auth + auth_type=userpass + + [ip_auth](!) + type=identify + endpoint=external + + [dynamiic_aor](!) + [kurogeek] type=endpoint context=from-kurogeek