Hi together. Am 02.08.2011 21:07, schrieb Michael Collins:
This is actually better than limiting the number of messages since you can control actual disk space. (One REALLY long message will take more disk space than five really short ones.)
I need to do both, because I have to guarantee that a User can not use more X mb for voicemail. If I only limit the length, a bad boy could leave thousands of messages ...
However, in the interests of actually answering the question, and demonstrating that with FreeSWITCH anything is possible, here is a simple dialplan trick that will allow you to limit the number messages:
<extension name="check vm box limit" continue="true"> <condition field="destination_number" expression="^(10[01][0-9])$" break="never"> <action application="set" data="dialed_extension=$1"/> <action application="set" data="dest_user=$1@${domain}" inline="true"/> <action application="set" data="box_count=${vm_boxcount ${dest_user}}" inline="true"> <action application="log" data="INFO User ${dest_user} has ${box_count} message(s)"/> </condition>
<condition field="${expr below(${boxcount},{$max_count})" expression="^1$"> <action application="voicemail" data="${domain} ${dialed_extension}"/> <anti-action application="playback" data="voicemail/vm-mailbox_full.wav"/> </condition> </extension>
That's what I was looking for! Thanks a lot. I will give feedback, as soon as possible. Greets Sascha -- AMOOMA GmbH - Bachstr. 124 - 56566 Neuwied --> http://www.amooma.de Geschäftsführer: Stefan Wintermeyer, Handelsregister Montabaur B14998 Bücher: http://das-asterisk-buch.de - http://ruby-auf-schienen.de