4.5. Directory (Dial-by-Name)

Though not part of the voice mail system per se, we discuss the Dial-by-Name directory here because it was developed along with Comedian Mail and gets its configuration from voicemail.conf.
Returning to our example for the Robinson family, the section called “The Robinson Family”, we make the following small changes:
[general]
format = gsm

[default]
; Syntax for new entries looks like this:
; MailboxNumber => password,firstname lastname,e-mail,pager,options
;                           ^^^^^^^^^^^^^^^^^^
200 => 1234,Dave Robinson
201 => 1234,Colleen Robinson
202 => 1234,Matthew Robinson,matt@robinsonfamily.name
203 => 1234,Lisa Robinson,lisa@robinsonfamily.name,,delete=yes
From here it is a simple matter to generate a Dial-by-Name directory. We use the Asterisk application Directory() in extensions.conf:
exten => 800,1,Directory(default,from-internal)

Syntax

Directory(vm-context[,dial-context[,options]])
vm-context
The directory is always generated from a specific context (that is, only the entries in this defined context are entered in the directory). In most cases, the default context is sufficient. In a larger enterprise, you may want to separate directories by department; in this case, you will need additional contexts.
dial-context
The directory is used to call to a specific person; dial-context defines which context is used for the call. If undefined, vm-context is used instead.
If the caller presses "0" (zero), the call will be sent to the "o" (small letter o) extension in this context. If he presses "*" (asterisk, or star), the call will be sent to the "a" (small letter a) context.
options
Option f sets searching by first name rather than last name.

Operation

The caller is asked to enter the first three letters of the person's last name (if option f is specified, the first name is used) using the telephone keypad. The application searches for the entry in the directory and connects the caller after checking that the entry is the correct one.