Upgrade 3CX to v18 and get it hosted free!

Asterisk cmd Directory

Author image

Asterisk Directory Command

Synopsis

Provide directory of voicemail extensions

Syntax


  Directory(vm-context[|dial-context[|options]]) - 1.4
  Directory(vm-context[,dial-context[,options]]) - 1.6

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 dialling 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

  • hidefromdir: Hides the entry from the directory.

Example:
100 => 1234,John Doe,[email protected],,hidefromdir=yes

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 Asterisk channels on exit to enter the
extension the user selected.

See also


Asterisk | Applications | Functions | Variables | Expressions | Asterisk FAQ


Article Reviews

Write a Review

Your email address will not be published. Required fields are marked *

Required Field. Minimum 5 characters.

Required Field. Minimum 5 characters, maximum 50.

Required field.There is an error with this field.

Required Field.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

There are no reviews for this article. Be the first one to write a review.

Related Posts:

Get 3CX - Absolutely Free!
Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.