The next application we'll cover is named Directory(), because it presents the callers with a dial-by-name directory. It asks the caller to enter the first few digits of the person's name, and then attempts to find matching names in the specified voice mail context in voicemail.conf. If the matching mailboxes have a recorded name greeting, Asterisk will play that greeting. Otherwise, Asterisk will spell out the person's name letter by letter.
The Directory() application takes three parameters:
This is the context within voicemail.conf in which to search for a matching directory entry. If not specified , the [docs:default] context will be searched.
When the caller finds the directory entry they are looking for, Asterisk will dial the extension matching their mailbox in this context.
A set of options for controlling the dial-by-name directory. Common options include f for searching based on first name instead of last name and e to read the extension number as well as the name.
Let's add a dial-by-name directory to our dialplan. Simply add this line to your [docs:users] context in extensions.conf:
Now you should be able to dial extension 6501 to test your dial-by-name directory.