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

noreply at bugs.digium.com noreply at bugs.digium.com
Mon Jan 14 14:52:03 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-14-2008 14:52 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-14-08 14:52  
---------------------------------------------------------------------- 
Ah, you're right about the sorting. I didn't notice the part where you
added the first name onto the end if searching by last name. Sorry about
that.

I retested using dir3.patch and everything appears to be working as
expected right now. I also ran with valgrind in case there might have been
any uncaught memory errors, and there don't appear to be any.

I plan on committing this pretty much as is. There are two places where
you use // style comments instead of /*...*/,  so I'm going to change that.
This is an excellent patch, and I thank you very much for taking the time
to make it and correct the problems encountered. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
01-14-08 14:52  putnopvut      Note Added: 0076923                          
======================================================================




More information about the asterisk-bugs mailing list