[Asterisk-Users] DID Hashing Patch (ie, changing voicemail directories)

Java Rockx javarockx at yahoo.com
Mon Nov 29 15:23:00 MST 2004


Hi All.

This patch is kinda ugly, but it more than meets my needs. This patch changes how Asterisk 1.0.2
stores voicemail files, greetings, etc, etc.

My situation is that I need to store massive numbers of mailboxes. Linux **WILL** puke eventually
if you try and place all user folders in the same {context} directory. It doesn't matter if you
use ext3, reiserfs, etc, etc, -- they will all eventually be unable to handle the job that I plan
to throw at it.

The solution is to use a DID (aka - 10-digit telephone number) as the user's Asterisk extension. A
DID is comprised of the following parts:

    407  555  1212
     ^    ^    ^
    NPA  NXX  LINE

This patch will store voicemail files as follows:

AST_SPOOL_DIR/voicemail/{context}/{npa}/{nxx}/{line}

Thereby having a maximum of 10000 users per directory (ie, 0000 to 9999)

NOTE: AST_SPOOL_DIR is defined in /etc/asterisk/asterisk.conf

Beware, I have only tested this patch with the voicemail part of Asterisk. I'm using Asterisk with
SIP eXpress Router to provide voicemail only. Therefore I cannot guarantee that I didn't break
something else in the system.

Part of this patch is a modification to the contribs/scripts/addmailbox script. This script now
creates the proper directory hash noted above. It also only accepts 10-digit numeric mailboxes.

If you see a problem or find a bug, then let me know.

Finally -- it would be awesome if someone could verify this patch and commit it to CVS for others
to use.

Regards,
Paul Hazlett



		
__________________________________ 
Do you Yahoo!? 
Meet the all-new My Yahoo! - Try it today! 
http://my.yahoo.com 
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: did-hashing.patch.gz
Type: application/x-tar
Size: 5114 bytes
Desc: did-hashing.patch.gz
Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20041129/a6b211c4/did-hashing.patch.tar


More information about the asterisk-users mailing list