Directory()


#1

I’m using Asterisk 1.0.7 on Debian/stable.
In my dial-plan at some point callers can reach Directory():

[external]
exten => s,1,Answer
exten => s,2,Background(some-opts)
exten => 1,1,…
exten => 9,1,Directory(default,extensions)

If the caller press 9, it go into the directory. But there is no way for them to QUIT it and go back somewhere else. * don’t quit Directory()

Is there a way to give an option to quit the directory and go back to the menu without hanging and call back. Something like:

[external]
exten => s,1,Answer
exten => s,2,Background(some-opts)
exten => 1,1,…
exten => 9,1,Directory(default,extensions)
exten => 9,2,Goto(s,2)

I’ve looked the code of app_directory.c but I can’t find a reference to that.


#2

You are still within the same context when using the directory app (IE: external), you can dial other extensions. You will need to do the following to achieve the functionality you are looking for:

Add an option that takes the caller back to s,1 (IE: exten = 5,1,Goto(s,1))

Record a message telling the caller that they can press 5 at any time to return to the main menu and playback this message before sending the caller into the directory.


#3

[external]
exten => s,1,Answer
exten => s,2,Background(some-opts)
exten => 1,1,…
exten => 5,1,Goto(s,1)
exten => 9,1,Directory(default,extensions)
exten => 9,2,Goto(s,2)

Now If i dial 9, and press 5 or 5# 5*
it wait and say "No directory entries match your search"
It don’t look for entries in the context, it insist to search into the directories.

Is there something else than just pressing 5 I need to do?


#4

After looking at this again it appears the only exit option within the directory is the operator extension. Add the following to your extensions.conf and press 0 while in the directory.

exten => o,1,Goto(s,1)