mob next [ci-skip] [ci skip] [skip ci]

lastFile:modules/clan/asterisk/default.nix
This commit is contained in:
2025-10-22 16:22:09 +07:00
parent 4704dd43fa
commit f8079aaa47

View File

@@ -16,46 +16,52 @@
services.asterisk = { services.asterisk = {
enable = lib.mkDefault true; enable = lib.mkDefault true;
confFiles = { confFiles = {
# Dial plan config
"extensions.conf" = '' "extensions.conf" = ''
[tests] exten => 1001,1,Dial(PJSIP/user1,20)
; Dial 100 for "hello, world" exten => 1002,1,Dial(PJSIP/user2,20)
exten => 100,1,Answer() exten => 100,1,Answer()
same => n,Wait(1) same => n,Wait(1)
same => n,Playback(hello-world) same => n,Playback(hello-world)
same => n,Hangup() same => n,Hangup()
[softphones]
include => tests
[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
nat=force_rport,comedia ; Assume device is behind NAT
[softphone](!) "pjsip.conf" = ''
type=friend ; Match on username first, IP second [transport-udp]
context=softphones ; Send to softphones context in type=transport
; extensions.conf file protocol=udp
host=dynamic ; Device will register with asterisk bind=0.0.0.0,[::]
disallow=all ; Manually specify codecs to allow
allow=g722 [endpoint_internal](!)
type=endpoint
context=from-internal
disallow=all
allow=ulaw allow=ulaw
allow=alaw
[myphone](softphone) [auth_userpass](!)
secret=GhoshevFew ; Change this password! type=auth
''; auth_type=userpass
"logger.conf" = ''
[general]
[logfiles] [aor_dynamic](!)
; Add debug output to log type=aor
syslog.local0 => notice,warning,error,debug max_contacts=1
[user1](endpoint_internal)
auth=user1
aors=user1
[user1](auth_userpass)
password=user1
username=user1
[user1](aor_dynamic)
[user2](endpoint_internal)
auth=user2
aors=user2
[user2](auth_userpass)
password=user2
username=user2
[user2](aor_dynamic)
''; '';
}; };
}; };