Directory() with one input


is there a way of reduicng 3 inputs into 1 in directory()?
for instance if the caller will just dial one key let us say “1” obviously it correspond to “a”,“b” and “c” the system will immediately read all entries in key “1” if voicemail.conf has “adam”, “aaron” “brad” and “cathy” then all of these will be read.

any idea how to access,read and annouce what extensions is in mailbox to make and modify directory function with one input?

Have you checked the directory application in the free O’Reilley book?

yes but i guess its the same with conventional option -> 3 input,
anyway i have this idea to put all mailbox=extensions,fname and other sip client info. customized voice prompt that ask only for one input. retrieve all fname that start a,b & c, cd&e and so on… check in INBOX folder if there is name recorded else say text the name and then ask the caller if this the person they are looking for else goto next entry until the person is find or there are no more entry.

Sorry I hadn’t read much about directory, obviously. I think you can implement the idea in Asterisk by using dial plan functions and/or AGI, but it’s not going to be straightforward. (I know such a system exists.)

First of all, you’ll need to build the number-alpha map yourself, as Asterisk does not seem to provide such a function in dial plan. (xTen’s soft phone has this built-in.)

Second, you’ll have to use an auxiliary data source in addition to voicemail.conf unless you use AGI. Whether you hard code all data in dial plan, use AstDB, or use an external database, you’ll have to synchronize between voicemail.conf and the auxiliary data source.

Third, obviously you’ll have to build the directory yourself.

So, if you have to skill, an easier route might be to look at Directory() application source code and see if you can modify it to work with one input. Logically it shouldn’t be too hard, assuming that a 3-input directory also has to deal with multiple entries. But I’m not a programmer.

Short of going AGI (and I can’t say for sure that AGI can do the job), I see this outline for programming dial plan for this:

exten => s,1,Background(enter-first-letter)
exten => _Z,1,Set(_users=${DB(box1/${EXTEN})})
exten => _Z,n,GoSub(directory,s,1)
exten => _Z,n,Hangup()

exten => s,1,Festival(${users})
exten => _Z,1,Set(user=${CUT(users,’ ',${[${EXTEN}*2]})})
exten => _Z,n,Dial(SIP/${user}); or whatever

The following assumptions and techniques are used in order to simplify the pseudo code:

  1. AstDB family box1 contains single-digit mapping to users, e.g.,

This eliminates the necessity of a separate number-alpha map.

  1. The format of the list assumes that the caller will press the number representing each user (instead of pressing one representing the next letter in name).

  2. Festival (text to speech) is used to simplify voice menu building. You may not want to use it in production.

  3. The pseudo code assumes that you can dial by user name directly.

  4. The pseudo code will not handle more than 9 users per digit.

  5. The pseudo code does not handle 2nd and 3rd letters in name.

Actual code can be many times more complicated, but it can be done, with the caveats cited above. Hope this helps.