diff --git a/modules/clan/phonebox/default.nix b/modules/clan/phonebox/default.nix index 70c53ad..335b3ad 100644 --- a/modules/clan/phonebox/default.nix +++ b/modules/clan/phonebox/default.nix @@ -9,14 +9,40 @@ perInstance.nixosModule = { lib, + config, ... }: let ata-interface = ""; rtpPortFrom = 10000; rtpPortTo = 20000; + + genServerSIPEndpoint = + { hostname, address }: + '' + [${hostname}](internal_endpoint) + aors=${hostname} + + [${hostname}](ip_auth) + endpoint=${hostname} + match=[${address}] + + [${hostname}](dynamiic_aor) + contact=sip:[${address}] + ''; + + genLocalSIPEndpoint = {number in { + clan.core.vars.generators.phonebox = { + files = { + server-prefix.secret = false; + ata-number.secret = false; + ata-password.secret = true; + }; + script = ''''; + }; + networking.interfaces = { ${ata-interface} = { useDHCP = false; @@ -135,7 +161,7 @@ context=from-internal [external_endpoint](!,base_endpoint) - context=from-external + context=from-internal [userpass_auth](!) type=auth @@ -146,70 +172,10 @@ endpoint=external [dynamiic_aor](!) - - [kurogeek] - type=endpoint - context=from-kurogeek - disallow=all - allow=ulaw - allow=alaw - allow=g722 - allow=gsm - aors=kurogeek - direct_media=no - - [kurogeek] type=aor - contact=sip:[fd79:fada:fbe9:8c5d:d899:932b:d36d:b8cc] - [kurogeek] - type=identify - endpoint=kurogeek - match=[fd79:fada:fbe9:8c5d:d899:932b:d36d:b8cc] - [6001] - type=endpoint - context=from-internal - disallow=all - allow=ulaw - allow=alaw - allow=g722 - allow=gsm - auth=6001 - aors=6001 - direct_media=no - [6001] - type=auth - auth_type=userpass - password=unsecurepassword - username=6001 - - [6001] - type=aor - max_contacts=1 - - [6002] - type=endpoint - context=from-internal - disallow=all - allow=ulaw - allow=alaw - allow=g722 - allow=gsm - auth=6002 - aors=6002 - direct_media=no - - [6002] - type=auth - auth_type=userpass - password=unsecurepassword - username=6002 - - [6002] - type=aor - max_contacts=1 ''; }; };