Asterisk cmd Directory
Asterisk Directory Command
Synopsis
Provide directory of voicemail extensionsSyntax
Directory(vm-context[|dial-context[|options]])
Presents the user with a directory of extensions from which they may select by name. The list of names and extensions is discovered from voicemail.conf. The vm-context argument is required, and specifies the context of voicemail.conf to use. The dial-context is the context to use for dialing the users, and defaults to the vm-context if unspecified. The 'f' option causes the directory to match based on the first name in voicemail.conf instead of the last name. Returns 0 unless the user hangs up. It also sets up the channel on exit to enter the extension the user selected.
Options
- e: In addition to the name, also read the extension number to the caller before presenting dialing options.
- f: Allow the caller to enter the first name of a user in the directory instead of using the last name.
- b: Allow the caller to enter the first name OR last name of a user in the directory.
Options can be applied together, such as ef or eb
To use b, patch 7151 must be applied
To use e, patch 6938 must be applied
Description
Presents the user with a directory of extensions from which they may select by name. This feature is known as 'Dial by name' on other vendors systems. The list of names and extensions is discovered from voicemail.conf. The vm-context argument is required, and specifies the context in which to interpret the extensions. The dial-context is the context to use for dialing the users, and defaults to the vm-context if unspecified.Limitations: Directory() in Asterisk 1.0.x does not support voicemail users stored in a database (MySQL, Postgres etc). According to bug 2475 this has been fixed for Asterisk 1.2.
Program flow
- Plays directory introduction file (dir-intro) and waits upto 5 seconds for 3 digits
- Intro file says "Please enter the first three letters of the persons last name..."
- Name is the last word found in in the <name> field in the voice mailbox entry in voicemail.conf
- Plays directory instructions file (dir-instr) for instructions on how to connect to that extension.
- Also plays the "name" as recorded by the voice mailbox owner to identify the extension. If this recording does not exist, it will speak the letters of the name (bee-oh-bee-space-ess-em-aye-tee-aich)
- If more than one matching last name is found, it will allow the caller to cycle through all the matches found.
- If no matches, it repeats the introduction
- Pressing "*" will exit
- Pressing "1" will exit setting up the channel to enter the extension selected
Return codes
Returns 0 unless the user hangs up. It also sets up the channel on exit to enter theextension the user selected.
See also
- VoiceMailMain
- VoiceMail
- voicemail.conf
- Patches to add feature to read numeric extension after lookup
Asterisk | Applications | Functions | Variables | Expressions | Asterisk FAQ

Comments
333Re: DOC UPDATE: voicemail.conf context
in voicemail.conf
default-context
6001 => 9999,John Johnson,joesemail@email.com ;1234 = users extension #, 9999 is password to retieve voicemail
voicemail module must be reloaded after voicemail.conf is modified, as follows:
cli> module reload app_voicemail.so
in extensions.conf
exten => 1234,n,Dial(SIP/jjohnson,10)
exten => 1234,n,Voicemail(6001@default)
:create an extension so that users can retrieve mail
exten => 5555,1,VoicemailMain(nameofcontext) ;in voicemail.conf that you want to manage
333
333Re: exclude mailbox from directory
(extension#) => (password),Sales Department,sales@sample.com,,hidefromdir=yes
333exclude mailbox from directory
Is it possible to exclude certian entries in the voicemail.conf from the directory, but still have mailboxes for them?
333New to Asterisk
Asterisk 1.2.0 built by root @ asterisk1.local on a i686 running Linux on 2005-11-29 15:51:44 UTC
333Aterisk@Home usage
include => app-directory-custom
exten => #,1,Wait(1)
exten => #,n,AGI(directory,${DIR-CONTEXT},from-did-direct,${DIRECTORY:0:1}${DIRECTORY_OPTS}o)
exten => #,n,Playback(vm-goodbye)
exten => #,n,Hangup
333what about dialing by extension?
333Pressing * does not exit.
333Voicemail number Extension number ?
333Re: Confused