login | register
Tue 02 of Dec, 2008 [03:25 UTC]

voip-info.org

Discuss [16] History

Asterisk cmd Directory

Created by: oej,Last modification on Tue 19 of Feb, 2008 [21:37 UTC] by kwolff

Asterisk Directory Command


Synopsis

Provide directory of voicemail extensions

Syntax


 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 the
extension the user selected.

See also



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


Comments

Comments Filter
222

333Re: DOC UPDATE: voicemail.conf context

by jetdriver, Friday 24 of October, 2008 [01:31:33 UTC]
Here is my simple voicemail account set up. Hope it helps.
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

222

333

by ClarkFredenburg, Wednesday 05 of December, 2007 [23:20:10 UTC]
222

333Re: exclude mailbox from directory

by ClarkFredenburg, Wednesday 05 of December, 2007 [23:15:50 UTC]
Use the hidefromdir=yes option. For example:
(extension#) => (password),Sales Department,sales@sample.com,,hidefromdir=yes
222

333exclude mailbox from directory

by byo71, Wednesday 01 of August, 2007 [19:37:24 UTC]
I have voicemail boxes set up for my sales and support departments, but want to exclude them from the direstory. For example if you enter 725 it says " sales department"
Is it possible to exclude certian entries in the voicemail.conf from the directory, but still have mailboxes for them?
222

333New to Asterisk

by enkrypt3d, Tuesday 13 of June, 2006 [18:43:41 UTC]
Ok I am trying to get dialbyname working... I'm a linux engineer so I have a good idea of how the system works just not where to start? The phone system is up and running CentOS ... I inherited it from a former admin... I know how to get to the asterisk console by typing asterisk -r in the console..... and I can get to the web interface as well but nothing jumps out at me. In the asterisk -r console none of these commands are recognized... any ideas? Please help! Thanks!

Asterisk 1.2.0 built by root @ asterisk1.local on a i686 running Linux on 2005-11-29 15:51:44 UTC
222

333Aterisk@Home usage

by linker3000, Saturday 27 of May, 2006 [23:47:26 UTC]
Asterisk@Home 2.8 with FreePBX 2.1 assigns the following code to the pound (#) key to access the directory:

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

222

333what about dialing by extension?

by hackeron, Thursday 30 of March, 2006 [07:04:16 UTC]
Hey there, most PBX systems have a "if you know the party's extension, you may dial it at any time" yet when this directory application is running, extension is no longer being listened for :( - Is there anyway to have it so that if an exact extension is dialed, go to person, if not try to match in directory?
222

333Pressing * does not exit.

by asterid, Saturday 26 of March, 2005 [01:21:03 UTC]
It would be nice to allow the caller to press * or # to exit.
222

333Voicemail number Extension number ?

by , Wednesday 26 of January, 2005 [22:33:16 UTC]
Since the voicemail.conf file actually only stores, and can therefore only deliver, the voicemail box number, what happens when the associated extension number is not the same as the voicemail number? Presumeably the wrong number gets delivered.
222

333Re: Confused

by , Friday 07 of January, 2005 [18:29:29 UTC]
never mind....figured it out....guess I should read things more extensively before trying to implement... (:eek:)