Add custom voicemail greeting
This commit is contained in:
parent
81ad290491
commit
346cd977d7
4 changed files with 42 additions and 4 deletions
1
.gitattributes
vendored
1
.gitattributes
vendored
|
|
@ -1,2 +1,3 @@
|
||||||
**/secrets/** filter=git-crypt diff=git-crypt
|
**/secrets/** filter=git-crypt diff=git-crypt
|
||||||
**/secrets.yaml diff=sops
|
**/secrets.yaml diff=sops
|
||||||
|
*.wav filter=lfs diff=lfs merge=lfs -text
|
||||||
|
|
|
||||||
9
hosts/aluminium/services/asterisk/README.md
Normal file
9
hosts/aluminium/services/asterisk/README.md
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
## custom voicemail greetings
|
||||||
|
|
||||||
|
Place `busy` and/or `unavail` file in users voicemail directory.
|
||||||
|
|
||||||
|
The file can be converted to the fitting format using sox
|
||||||
|
```bash
|
||||||
|
sox $input_file -t wav -b 16 -c 1 -r 8k -e signed-integer --endian little unavail.wav
|
||||||
|
```
|
||||||
|
|
||||||
|
|
@ -11,8 +11,23 @@ let
|
||||||
start = builtins.elemAt ports.asterisk-rtp.udp.range 0;
|
start = builtins.elemAt ports.asterisk-rtp.udp.range 0;
|
||||||
end = builtins.elemAt ports.asterisk-rtp.udp.range 1;
|
end = builtins.elemAt ports.asterisk-rtp.udp.range 1;
|
||||||
};
|
};
|
||||||
in
|
voicemail-sounds = pkgs.callPackage ./voicemail-sounds { };
|
||||||
{
|
in {
|
||||||
|
systemd.services.asterisk-voicemail-sounds = {
|
||||||
|
wantedBy = ["asterisk.service"];
|
||||||
|
after = ["asterisk.service"];
|
||||||
|
script = ''
|
||||||
|
ln -sfn \
|
||||||
|
${voicemail-sounds}/unavail.wav \
|
||||||
|
/var/spool/asterisk/voicemail/lechner/876/unavail.wav
|
||||||
|
'';
|
||||||
|
restartTriggers = [voicemail-sounds];
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
RemainAfterExit = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
services.asterisk = {
|
services.asterisk = {
|
||||||
enable = true;
|
enable = true;
|
||||||
confFiles = {
|
confFiles = {
|
||||||
|
|
@ -30,7 +45,7 @@ in
|
||||||
[sipgate-in]
|
[sipgate-in]
|
||||||
exten = _499846876,1,Noop(Processing an incoming call)
|
exten = _499846876,1,Noop(Processing an incoming call)
|
||||||
same = n,Dial(PJSIP/10&PJSIP/11,25,tT)
|
same = n,Dial(PJSIP/10&PJSIP/11,25,tT)
|
||||||
same = n,VoiceMail(876@lechner,u)
|
same = n,VoiceMail(876@lechner,uS)
|
||||||
same = n,Hangup()
|
same = n,Hangup()
|
||||||
|
|
||||||
exten => _4998469779781,1,Verbose(3,Incoming fax)
|
exten => _4998469779781,1,Verbose(3,Incoming fax)
|
||||||
|
|
@ -155,7 +170,7 @@ in
|
||||||
|
|
||||||
sops.secrets = (lib.listToAttrs (map
|
sops.secrets = (lib.listToAttrs (map
|
||||||
(name: lib.nameValuePair "asterisk-${name}" {
|
(name: lib.nameValuePair "asterisk-${name}" {
|
||||||
sopsFile = ../secrets.yaml;
|
sopsFile = ../../secrets.yaml;
|
||||||
owner = config.users.users.asterisk.name;
|
owner = config.users.users.asterisk.name;
|
||||||
})
|
})
|
||||||
secretConfigFiles));
|
secretConfigFiles));
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
{ lib, stdenvNoCC }:
|
||||||
|
|
||||||
|
stdenvNoCC.mkDerivation {
|
||||||
|
name = "voicemail-sounds";
|
||||||
|
|
||||||
|
src = ./.;
|
||||||
|
|
||||||
|
dontBuild = true;
|
||||||
|
installPhase = ''
|
||||||
|
mkdir $out
|
||||||
|
cp -r * $out
|
||||||
|
'';
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue