[Home]

Summary:ASTERISK-09874: Users with the same last name are not all listed in the directory. Only one of them is.
Reporter:Francois Boucher (mrskippy)Labels:
Date Opened:2007-07-13 10:05:29Date Closed:2007-07-20 13:27:26
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Applications/app_directory
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) directory_v2.patch
( 1) directory.patch
Description:The directory application does not support users with the same last name.  Only one of these users gets listed.  I'm supprised that this has not been dealt with already.

I did make sure the option "hasdirectory" is set to yes for both users.  Both users are in the same context.  If I rename one of these users, he shows up in the directory listing.
Comments:By: Mark Michelson (mmichelson) 2007-07-13 15:21:38

This seems to work fine for me. Can you elaborate on the problem? Are you certain you can't press * to hear the other person with the same last name?

By: Francois Boucher (mrskippy) 2007-07-13 15:35:19

Pressing * tells me there are no more users that match.

My users are stored in users.conf.  Forgot to mention this.

If I look at the current svn code it seems to me that the "break" at line 547 exits the for loops.  Therefore after it lists the first user that matches, it exits.

By: Mark Michelson (mmichelson) 2007-07-13 16:30:58

I see. I was using voicemail.conf for the directory and that's why it was working for me. Thanks for the update.

I uploaded a patch. It worked in my toy setup here, but I want to get confirmation that it's working from you before I commit the changes.

By: Francois Boucher (mrskippy) 2007-07-13 18:07:41

Thanks for the time spent on this issue.

I can't test your patch because I don't have a test box environment to compile.  But I'm looking at it and it seems incorrect but I may be wrong.

The "for" on line 505 goes through each users.  (Each user is a category [XXX]).  Therefore there is no need to loop and get the values of "fullname" for each users.

Simply by looking at the SVN code I would remove lines 546 and 547.  This way the "for" loop could continue if the user presses the "*" key.

By: Mark Michelson (mmichelson) 2007-07-16 09:14:07

I agree that my first patch was not the best solution. I've made a new patch and have uploaded it as directory_v2.patch.

I didn't just delete the two lines you suggested since we do want to break out of the for loop if the user does not press *. Instead, I added a conditional variable, breakout, which is used to test if we want to break out of the for loop or not. Once again, I tested in my toy setup and it works.

I also added an else to match the if(!strcmp(conv,ext)) since not always breaking out of the for loop creates the possibility of freeing the same variable twice.

By: Digium Subversion (svnbot) 2007-07-20 13:25:25

Repository: asterisk
Revision: 76139

------------------------------------------------------------------------
r76139 | mmichelson | 2007-07-20 13:25:23 -0500 (Fri, 20 Jul 2007) | 6 lines

When using users.conf for the entries in the directory, if multiple users had the same last name, only the first user listed would be available
in the directory.

(closes issue ASTERISK-9874, reported by mrskippy, patched by me)


------------------------------------------------------------------------

By: Digium Subversion (svnbot) 2007-07-20 13:27:26

Repository: asterisk
Revision: 76140

------------------------------------------------------------------------
r76140 | mmichelson | 2007-07-20 13:27:26 -0500 (Fri, 20 Jul 2007) | 14 lines

Merged revisions 76139 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r76139 | mmichelson | 2007-07-20 13:42:27 -0500 (Fri, 20 Jul 2007) | 6 lines

When using users.conf for the entries in the directory, if multiple users had the same last name, only the first user listed would be available
in the directory.

(closes issue ASTERISK-9874, reported by mrskippy, patched by me)


........

------------------------------------------------------------------------