[asterisk-users] notification mail to an user if his vmbox is full (was: Re: dialplan tips)

Steve Edwards asterisk.org at sedwards.com
Fri Jul 24 13:21:52 CDT 2009


> harry R schrieb:
>
>> 2) about asterisk voicemail maximum message limit, is it possible to 
>> send a notification mail to an user if his vmbox is full ? How can i do 
>> that if it's possible.

On Fri, 24 Jul 2009, Danny Nicholas wrote:

> for question 2, this depends on how voicemail.conf is setup.  By 
> default, an asterisk mailbox is considered "Full" when 100 messages are 
> stored (see voicemail.conf.samples), but this can be changed up to 9999. 
> Therefore you would just need a job to look for the creation of the max 
> file and send a mail accordingly.  I'm not enough of a scripter to do 
> this in bash, but here's a find and grep that would tell you when a 
> user's box was full (based on default params):
>
> find /|grep msg0099.txt|grep INBOX

I think Philipp's suggestion of "externnotify" is the right path if it 
fit's the OP's needs. "Polling" the filesystem periodically always seems a 
waste of system resources.

In case externnotify doesn't fit the bill, this "find" command while 
thorough, is going to search the entire filesystem looking for 
"msg0099.txt."

It would be more efficient using a command like:

 	find /var/spool/asterisk/voicemail/*/*/INBOX/msg0099.txt

(Assuming Asterisk's boxes are in the usual place.)

On my little under-powered and over-priced FitPC which has 186,000 files, 
the first find command takes about 3 minutes while the second is 
"sub-second."

-- 
Thanks in advance,
-------------------------------------------------------------------------
Steve Edwards       sedwards at sedwards.com      Voice: +1-760-468-3867 PST
Newline                                              Fax: +1-760-731-3000



More information about the asterisk-users mailing list