Problem with the voicemail.conf

Hello,
at school i do a project, in wich I have to connect 3 clients (1 hardphone and 2 softphones) to an asterisk 14.7 server as a Voip. I try to configure the voicemail.conf to have an answering machine, but the voicemail is not answering. If I type into the CLI “voicemail show users” I always get the Error 4956: Couldn’t find mailbox 300 in context phones.

I’m sorry for my broken English I’m from Germany.
Could somebody help me, please?

This are my Config Fieles:
extensions.conf

[globals]

[general]

[internal]
exten => _XXX,1,Dial(SIP/${EXTEN})
exten => _XX,1,Dial(SIP/${EXTEN})
exten => _XXX,n,Voicemail(u,${EXTEN}@phones)
exten => _XXX,n,Hangup

[phones]
include => internal

################################################
sip.conf

general]
allowguest=no
port = 5060
bindaddr = 0.0.0.0
qualify = no
disable = all
allow = alaw
allow = ulaw
videosupport = yes
dtmfmode = rfc2833
srvlookup = yes
localnet=192.168.1.0/255.255.255.0
directmedia = no
nat = no
avpf=yes

[10]
permit=192.168.1.0/255.255.255.0
type=friend
context=phones
host=dynamic
secret=PASSWORT

[300]
permit=192.168.1.0/255.255.255.0
type=friend
context=phones
host=dynamic
secret=PASSWORT

[301]
permit=192.168.1.0/255.255.255.0
type=friend
context=phones
host=dynamic
secret=PASSWORT
###############################################
voicemail.conf

[general]
searchcontexts=yes
attach=yes
delete=no
format=wav
servermail=redbox@kammerath.net
fromstring = RedBox System
emailsubject = [RedBox] Neue Nachrichten (${VM_MSGNUM}) in Box ${VM_MAILBOX}
emailbody = Hallo ${VM_NAME}!nnEs ist eine neue Nachricht eingetroffen!nnDatum: ${VM$
emaildateformat=%d.%m.%Y %H:%M:%S
mailcmd=/usr/sbin/sendmail -t -f redbox@kammerath.net

[phones]
300 => 111, Markus Meier
301 => 111, Heike Müller
10 => 111, Kaja Kugler

Have you looked at the console output when Asterisk starts to see if app_voicemail provides any errors or hints?

Yes I have. This is the output

app_voicemail.c:2836 inboxcount2: Couldn’t find mailbox 300 in context phones
Jun 08 09:05:57 001314010519600.bs-intra asterisk[3540]: [Jun 8 09:05:57] ERROR[3540]: app_voicemail.c:2836 inboxcount2: Couldn’t find mailbox 301 in context phones
Jun 08 09:05:57 001314010519600.bs-intra asterisk[3540]: [Jun 8 09:05:57] ERROR[3540]: app_voicemail.c:2836 inboxcount2: Couldn’t find mailbox 10 in context phones
Jun 08 09:05:57 001314010519600.bs-intra asterisk[3540]: Asterisk Ready.

Not sure if the little things I spotted will make a difference.

In your extensions.conf:
exten => _XXX,n,Voicemail(u,${EXTEN}@phones)

should be:
exten => _XXX,1,Voicemail(${EXTEN},u)

If using priority “n” it needs to follow an “exten” that has a priority of 1. The “u” goes after ${EXTEN}, separated by a comma.

Might just be a typo here, but sip.conf is missing an opening bracket for context “general” at the beginning of the file.

I’ve also had better luck with setting “type=peer”.

For trouble shooting, try changing everything to “context=default” and go from there.