[asterisk-bugs] [Asterisk 0011744]: [patch] multiple bugs in Directory application

noreply at bugs.digium.com noreply at bugs.digium.com
Fri Jan 11 16:45:30 CST 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=11744 
====================================================================== 
Reported By:                dimas
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   11744
Category:                   Applications/app_directory
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
Asterisk Version:           SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 94802 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             01-11-2008 14:06 CST
Last Modified:              01-11-2008 16:45 CST
====================================================================== 
Summary:                    [patch] multiple bugs in Directory application
Description: 
app_directory contained some duplicate code even before addition of 'm'
option. Addition of that option doubled amount of that code. Worst of all,
there are minor differences between these code block and bugs caused by
these differences.

1. There is a memory leak. In the 'menu' mode, result of the convert(pos)
function is not freed while it should be.
2. In the 'menu' mode check for OPT_LISTBYFIRSTNAME flag ('f' option) is
not negated as result, application works in the mode opposite to what user
expect (checking last name when user wants the first nd vice versa).
3. select_item function plays message for user using res = func1() ||
func2() || func3()... construct. This construct loses the actual value
returned by ast_waitstream() for example so at the end, res does not
contain digit user dialed while listening to the message.
4. (also in 1.4) application announces entries from
voicemail.conf/realtime separately from entries from users.conf. I see no
reason why doing so instead of building combined list.
5. Alot of duplicated code as already mentioned.

Attached patch does major refactoring of app_directory and I hope it fixes
all the issues above.
====================================================================== 

---------------------------------------------------------------------- 
 putnopvut - 01-11-08 16:45  
---------------------------------------------------------------------- 
This patch is awesome! do_directory was a big ugly function and definitely
needed an overhaul. Great work!
...
...
Unfortunately, this doesn't work. I tried calling the directory and
pressing '1' to dial someone, but instead, the directory restarted (i.e.
'dir-intro' played and I had to enter the last three letters of the last
name again). It was not possible to actually call anyone.

I'll retest after you sort out this error.

As a secondary, minor issue I think the sort could be improved for the
situation where you search by last name. Instead of just using the last
name as the key, I would suggest using the last name and appending the
first name on as well so that people with the same last name will be listed
in proper alphabetical order. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
01-11-08 16:45  putnopvut      Note Added: 0076762                          
======================================================================




More information about the asterisk-bugs mailing list