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)"
|
||||
) intercomEntries
|
||||
|
||||
# Voicemail check (*97 — uses VOICEMAIL_MAILBOX set on the endpoint)
|
||||
# Voicemail check — uses VOICEMAIL_MAILBOX set on the endpoint
|
||||
+ 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
|
||||
+ lib.optionalString hasSharedMailbox
|
||||
"\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 {
|
||||
default = {};
|
||||
description = ''
|
||||
|
|
|
|||
|
|
@ -51,13 +51,15 @@ pkgs.linkFarm "voip-tftp-root" (
|
|||
|
||||
files = t.mkFiles ({
|
||||
mac = key;
|
||||
inherit (phone) label password displayName;
|
||||
inherit (phone) label password displayName extension;
|
||||
inherit blfPersons;
|
||||
serverAddress = cfg.serverAddress;
|
||||
ntpServer = cfg.ntpServer;
|
||||
sipPort = cfg.sipPort;
|
||||
directoryPort = cfg.directoryPort;
|
||||
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) {
|
||||
intercomEnabled = true;
|
||||
intercomPassword = phone.password;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ in {
|
|||
# Return a list of { name, content } provisioning files for this phone.
|
||||
# provisioning/default.nix wraps each with pkgs.writeText for the linkFarm.
|
||||
mkFiles =
|
||||
{ mac, label, displayName, password, serverAddress, ntpServer
|
||||
{ mac, label, displayName, extension, password, serverAddress, ntpServer
|
||||
, sipPort ? 5060
|
||||
, directoryPort ? 8080
|
||||
, familyLineEnabled ? false
|
||||
|
|
@ -23,7 +23,9 @@ in {
|
|||
, hasTrunk ? false
|
||||
, hasIntercomButton ? false
|
||||
, pageExtension ? null
|
||||
, blfPersons ? []
|
||||
, blfPersons ? []
|
||||
, voicemailCheckExtension ? "*97"
|
||||
, familyLineCheckExtension ? "*97"
|
||||
}:
|
||||
let
|
||||
# Line button assignments:
|
||||
|
|
@ -111,7 +113,7 @@ in {
|
|||
<sipLines>
|
||||
<line button="1" lineIndex="1">
|
||||
<featureID>9</featureID>
|
||||
<featureLabel>${displayName}</featureLabel>
|
||||
<featureLabel>${displayName} · ${extension}</featureLabel>
|
||||
<proxy>USECALLMANAGER</proxy>
|
||||
<port>${toString sipPort}</port>
|
||||
<name>${mac}</name>
|
||||
|
|
@ -123,7 +125,7 @@ in {
|
|||
<authName>${mac}</authName>
|
||||
<authPassword>${password}</authPassword>
|
||||
<messageWaitingLampPolicy>1</messageWaitingLampPolicy>
|
||||
<messagesNumber>*97</messagesNumber>
|
||||
<messagesNumber>${voicemailCheckExtension}</messagesNumber>
|
||||
<contact>${mac}</contact>
|
||||
<forwardCallInfoDisplay>
|
||||
<callerName>true</callerName>
|
||||
|
|
@ -147,7 +149,7 @@ in {
|
|||
<authName>${mac}-l2</authName>
|
||||
<authPassword>${familyLinePassword}</authPassword>
|
||||
<messageWaitingLampPolicy>3</messageWaitingLampPolicy>
|
||||
<messagesNumber>*97</messagesNumber>
|
||||
<messagesNumber>${familyLineCheckExtension}</messagesNumber>
|
||||
<contact>${mac}-l2</contact>
|
||||
<forwardCallInfoDisplay>
|
||||
<callerName>true</callerName>
|
||||
|
|
|
|||
Loading…
Reference in a new issue