fix: write correct voicemail at all places
This commit is contained in:
parent
af8cd3c4ca
commit
6bb30f8227
4 changed files with 18 additions and 8 deletions
|
|
@ -291,9 +291,9 @@ let
|
||||||
"exten => ${ic.extension},1,Dial(PJSIP/${ic.endpoint},30)"
|
"exten => ${ic.extension},1,Dial(PJSIP/${ic.endpoint},30)"
|
||||||
) intercomEntries
|
) intercomEntries
|
||||||
|
|
||||||
# Voicemail check (*97 — uses VOICEMAIL_MAILBOX set on the endpoint)
|
# Voicemail check — uses VOICEMAIL_MAILBOX set on the endpoint
|
||||||
+ lib.optionalString hasAnyMailbox
|
+ lib.optionalString hasAnyMailbox
|
||||||
"\nexten => *97,1,VoiceMailMain(${av "VOICEMAIL_MAILBOX"}@voicemail,sa(0))"
|
"\nexten => ${cfg.voicemailCheckExtension},1,VoiceMailMain(${av "VOICEMAIL_MAILBOX"}@voicemail,sa(0))"
|
||||||
# Shared mailbox direct check extension
|
# Shared mailbox direct check extension
|
||||||
+ lib.optionalString hasSharedMailbox
|
+ lib.optionalString hasSharedMailbox
|
||||||
"\nexten => ${cfg.sharedMailbox.checkExtension},1,VoiceMailMain(${cfg.sharedMailbox.mailboxId}@voicemail,sa(0))"
|
"\nexten => ${cfg.sharedMailbox.checkExtension},1,VoiceMailMain(${cfg.sharedMailbox.mailboxId}@voicemail,sa(0))"
|
||||||
|
|
|
||||||
|
|
@ -306,6 +306,12 @@ in {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
voicemailCheckExtension = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "*97";
|
||||||
|
description = "Extension dialled to check personal voicemail (via VoiceMailMain with VOICEMAIL_MAILBOX).";
|
||||||
|
};
|
||||||
|
|
||||||
extensions = lib.mkOption {
|
extensions = lib.mkOption {
|
||||||
default = {};
|
default = {};
|
||||||
description = ''
|
description = ''
|
||||||
|
|
|
||||||
|
|
@ -51,13 +51,15 @@ pkgs.linkFarm "voip-tftp-root" (
|
||||||
|
|
||||||
files = t.mkFiles ({
|
files = t.mkFiles ({
|
||||||
mac = key;
|
mac = key;
|
||||||
inherit (phone) label password displayName;
|
inherit (phone) label password displayName extension;
|
||||||
inherit blfPersons;
|
inherit blfPersons;
|
||||||
serverAddress = cfg.serverAddress;
|
serverAddress = cfg.serverAddress;
|
||||||
ntpServer = cfg.ntpServer;
|
ntpServer = cfg.ntpServer;
|
||||||
sipPort = cfg.sipPort;
|
sipPort = cfg.sipPort;
|
||||||
directoryPort = cfg.directoryPort;
|
directoryPort = cfg.directoryPort;
|
||||||
inherit allExtensions allStarExtensions hasTrunk hasIntercomButton pageExtension intercomLineIndex;
|
inherit allExtensions allStarExtensions hasTrunk hasIntercomButton pageExtension intercomLineIndex;
|
||||||
|
voicemailCheckExtension = cfg.voicemailCheckExtension;
|
||||||
|
familyLineCheckExtension = if cfg.sharedMailbox != null then cfg.sharedMailbox.checkExtension else cfg.voicemailCheckExtension;
|
||||||
} // lib.optionalAttrs (cfg.intercomPrefix != null) {
|
} // lib.optionalAttrs (cfg.intercomPrefix != null) {
|
||||||
intercomEnabled = true;
|
intercomEnabled = true;
|
||||||
intercomPassword = phone.password;
|
intercomPassword = phone.password;
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ in {
|
||||||
# Return a list of { name, content } provisioning files for this phone.
|
# Return a list of { name, content } provisioning files for this phone.
|
||||||
# provisioning/default.nix wraps each with pkgs.writeText for the linkFarm.
|
# provisioning/default.nix wraps each with pkgs.writeText for the linkFarm.
|
||||||
mkFiles =
|
mkFiles =
|
||||||
{ mac, label, displayName, password, serverAddress, ntpServer
|
{ mac, label, displayName, extension, password, serverAddress, ntpServer
|
||||||
, sipPort ? 5060
|
, sipPort ? 5060
|
||||||
, directoryPort ? 8080
|
, directoryPort ? 8080
|
||||||
, familyLineEnabled ? false
|
, familyLineEnabled ? false
|
||||||
|
|
@ -24,6 +24,8 @@ in {
|
||||||
, hasIntercomButton ? false
|
, hasIntercomButton ? false
|
||||||
, pageExtension ? null
|
, pageExtension ? null
|
||||||
, blfPersons ? []
|
, blfPersons ? []
|
||||||
|
, voicemailCheckExtension ? "*97"
|
||||||
|
, familyLineCheckExtension ? "*97"
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
# Line button assignments:
|
# Line button assignments:
|
||||||
|
|
@ -111,7 +113,7 @@ in {
|
||||||
<sipLines>
|
<sipLines>
|
||||||
<line button="1" lineIndex="1">
|
<line button="1" lineIndex="1">
|
||||||
<featureID>9</featureID>
|
<featureID>9</featureID>
|
||||||
<featureLabel>${displayName}</featureLabel>
|
<featureLabel>${displayName} · ${extension}</featureLabel>
|
||||||
<proxy>USECALLMANAGER</proxy>
|
<proxy>USECALLMANAGER</proxy>
|
||||||
<port>${toString sipPort}</port>
|
<port>${toString sipPort}</port>
|
||||||
<name>${mac}</name>
|
<name>${mac}</name>
|
||||||
|
|
@ -123,7 +125,7 @@ in {
|
||||||
<authName>${mac}</authName>
|
<authName>${mac}</authName>
|
||||||
<authPassword>${password}</authPassword>
|
<authPassword>${password}</authPassword>
|
||||||
<messageWaitingLampPolicy>1</messageWaitingLampPolicy>
|
<messageWaitingLampPolicy>1</messageWaitingLampPolicy>
|
||||||
<messagesNumber>*97</messagesNumber>
|
<messagesNumber>${voicemailCheckExtension}</messagesNumber>
|
||||||
<contact>${mac}</contact>
|
<contact>${mac}</contact>
|
||||||
<forwardCallInfoDisplay>
|
<forwardCallInfoDisplay>
|
||||||
<callerName>true</callerName>
|
<callerName>true</callerName>
|
||||||
|
|
@ -147,7 +149,7 @@ in {
|
||||||
<authName>${mac}-l2</authName>
|
<authName>${mac}-l2</authName>
|
||||||
<authPassword>${familyLinePassword}</authPassword>
|
<authPassword>${familyLinePassword}</authPassword>
|
||||||
<messageWaitingLampPolicy>3</messageWaitingLampPolicy>
|
<messageWaitingLampPolicy>3</messageWaitingLampPolicy>
|
||||||
<messagesNumber>*97</messagesNumber>
|
<messagesNumber>${familyLineCheckExtension}</messagesNumber>
|
||||||
<contact>${mac}-l2</contact>
|
<contact>${mac}-l2</contact>
|
||||||
<forwardCallInfoDisplay>
|
<forwardCallInfoDisplay>
|
||||||
<callerName>true</callerName>
|
<callerName>true</callerName>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue