100 lines
2.3 KiB
Nix
100 lines
2.3 KiB
Nix
# SPDX-FileCopyrightText: 2020 Luke Granger-Brown <depot@lukegb.com>
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
{ depot, lib, pkgs, config, ... }:
|
|
|
|
{
|
|
services.asterisk = {
|
|
enable = true;
|
|
confFiles = {
|
|
"pjsip.conf" = ''
|
|
[transport-udp]
|
|
type=transport
|
|
protocol=udp
|
|
bind=92.118.28.3
|
|
|
|
[transport-udp-v6]
|
|
type=transport
|
|
protocol=udp
|
|
bind=2a09:a441::3
|
|
|
|
[eventphone-registration]
|
|
type=registration
|
|
transport=transport-udp
|
|
outbound_auth=eventphone-auth
|
|
server_uri=sip:voip.eventphone.de
|
|
client_uri=sip:5422@voip.eventphone.de
|
|
contact_user=5422
|
|
retry_interval=60
|
|
forbidden_retry_interval=600
|
|
expiration=3600
|
|
line=yes
|
|
endpoint=eventphone
|
|
|
|
[eventphone-auth]
|
|
type=auth
|
|
auth_type=userpass
|
|
username=5422
|
|
password=BPun1r0l7JJZ
|
|
realm=voip.eventphone.de
|
|
|
|
[eventphone]
|
|
type=endpoint
|
|
allow=!all,ulaw,alaw
|
|
context=eventphone-incoming
|
|
outbound_auth=eventphone-auth
|
|
transport=transport-udp
|
|
aors=eventphone-aor
|
|
from_domain=voip.eventphone.de
|
|
|
|
[eventphone-aor]
|
|
type=aor
|
|
contact=sip:voip.eventphone.de
|
|
max_contacts=10
|
|
|
|
[eventphone-identify]
|
|
type=identify
|
|
endpoint=eventphone
|
|
match=45.15.105.12/32
|
|
'';
|
|
"motif.conf" = ''
|
|
[default](!)
|
|
disallow=all
|
|
allow=ulaw
|
|
allow=h264
|
|
context=incoming-motif
|
|
|
|
[prosody](default)
|
|
transport=ice-udp
|
|
connection=prosody
|
|
'';
|
|
"xmpp.conf" = ''
|
|
[general]
|
|
debug=yes
|
|
|
|
[prosody]
|
|
type=component
|
|
serverhost=localhost
|
|
username=asterisk.lukegb.com
|
|
secret=thisisasampleofspeex
|
|
port=5347
|
|
context=xmpp-incoming
|
|
debug=yes
|
|
usetls=no
|
|
usesasl=no
|
|
autoregister=yes
|
|
buddy=lukegb@lukegb.com
|
|
'';
|
|
"extensions.conf" = ''
|
|
[eventphone-incoming]
|
|
exten => _X.,1,Answer()
|
|
exten => _X.,n,Dial(Motif/prosody/lukegb@lukegb.com)
|
|
|
|
[xmpp-incoming]
|
|
exten => _X.,1,Dial(PJSIP/''${EXTEN:1}@eventphone)
|
|
'';
|
|
};
|
|
package = pkgs.callPackage ./asterisk-override.nix {};
|
|
};
|
|
}
|