[Home]

Summary:ASTERISK-20652: AppVoicemail creates multiple duplicates of the contents of #included users.conf files.
Reporter:Craig Hoffman (choffman)Labels:
Date Opened:2012-11-05 21:25:00.000-0600Date Closed:2012-11-08 10:53:57.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Applications/app_voicemail
Versions:10.9.0 Frequency of
Occurrence
Occasional
Related
Issues:
Environment:Linux voipsrv 3.2.0-3-amd64 #1 SMP Mon Jul 23 02:45:17 UTC 2012 x86_64 GNU/LinuxAttachments:
Description:In my users.conf file, I've added a "#include users_conf/*.conf" option.  I do this to split off each user into their own file (1000.conf, etc).  It works well given the web app that was written to manage them.  We have ~100 users.

When a user changes their voicemail PIN via the web app, the file is adjusted, and Asterisk is reloaded.  This works fine.

However, when a user changes their voicemail PIN via the Comedian Mail prompts (0 and then 5), *each file* in the "users_conf" directory is updated(including a new file called *.conf).  But the update is just an appended version of the new data.  So you end up with a 1000.conf file looking like:

[1000]
fullname = Joe Test
email = none@none.com
secret = mysecret
...
[1000]
fullname = Joe Test
email = none@none.com
secret = mysecret
...
[1000]
fullname = Joe Test
email = none@none.com
secret = mysecret
...

Each user file hovers around 400 bytes by default.  In just two weeks of operation, some of our files have grown to over 44k.

AppVoicemail should instead just replace the vmsecret PIN, rather than copying and appending the new data.  

As a workaround, I have written a python script that just replaces the PIN in the user file for that particular user.  It is called via "externpass".  This works well, and it will be what I use going forward - but I wanted to assist in documenting the bug(?) in case someone else is searching on a similar issue.
Comments:By: Matt Jordan (mjordan) 2012-11-06 17:11:47.964-0600

This is not technically a bug, as the behavior is undefined when you use #includes in any configuration file.  its actually a documented limitation of the password modification abilities of {{app_voicemail}}.  From the {{voicemail.conf.sample}} file:

{quote}
; NOTE: Asterisk has to edit this file to change a user's password.  This does
; not currently work with the "#include <file>" directive for Asterisk
; configuration files, nor when using realtime static configuration.
; Do not use them with this configuration file.
{quote}


By: Matt Jordan (mjordan) 2012-11-06 17:13:09.852-0600

It probably could be a bit clearer that this also applies to voicemail data pulled from {{users.conf}}, but from the perspective of {{app_voicemail}}, the two are the same.  While I agree that this is hardly ideal, this is really more of a feature request (or an improvement to the existing behavior).