[asterisk-dev] Voicemail redisign

Matt O'Gorman mogorman at digium.com
Wed Nov 1 09:17:22 MST 2006


oh and obviously it would make writing an agi voicemail app far easier as well. oh and i also forgot the count, so the storage commands would be move, copy, delete, count, retrieve, store.
----- Original Message -----
From: Matt O'Gorman <mogorman at digium.com>
To: asterisk-dev <asterisk-dev at lists.digium.com>
Sent: Wednesday, November 1, 2006 9:54:36 AM GMT-0600 US/Central
Subject: [asterisk-dev] Voicemail redisign

I realize this has come up several times and thought of in different ways.  Recently in getting all of the fun fun imap code working I have been thinking all this ifdef and statically defined options etc is the wrong way to do things.  I think with one fairly well done chunk of code the rest of imap could be rewritten very simply.
First we need a generic storage api so main/storage  This would not take to much work as the majority of work is already there inside of app_voicemail.  Then we abstract each storage type into store/store_local, store/store_odbc, store/store_imap.  also shouldnt be too difficult to move this code out of app_voicemail.
Then app_voicemail is just a handler for voicemail users and a loader of the default config file. voicemailmain and voicemail dialplan applications would just point to macros like this in your dial plan

[voicemail-default]
;;${ARG1} == User
;;${ARG2} == Context
;;${ARG3} == Password
;;${ARG4} == options
exten => s,1,playback(comedian-mail)
exten => s,2,VMAuthenticate(${ARG1}@${ARG2}|${ARG3}|${ARG4}) ;; vmauthenicate doesnt accept pass currently but it could.
exten => s,3,goto(voicemail-menu,s,1)

[voicemail-menu]
exten => s,1,background(press-1-for-new-messages)
exten => s,2,background(press-2-to-change-folders)
exten => s,3,background(press-0-for-mailbox-options)
exten => s,4,background(press-*-for-help)
exten => s,5,background(or-pound-to-exit)

exten => 1,1,goto(voicemail-playback-menu)

exten => 2,1,goto(voicemail-folder-choice-menu)

exten => 0,1,goto(voicemail-options-menu)

exten => *,1,playback(voicemail-help)
exten => *,2,goto(s,1)

exten => #,1,hangup

exten => t,1,goto(s,1)
exten => i,1,playback(invalid)
exten => i,2,goto(s,1)

[voicemail-playback-menu]
exten => s,1,set(MSGNUM=0)
exten => s,2,while($[$[${MSGNUM}] != -1])
exten => s,3,retrieve(IMAP| ${MSGNUM}| oldtonew | readunread)
exten => s,4,background(${CURRENTMESSAGE})
exten => s,5,endwhile()

exten => 4,1,set(MSGNUM = $[$[${MSGNUM}] - 1])
exten => 4,1,goto(s,3)

exten => 5,1,goto(s,3)

exten => 6,1,set(MSGNUM = $[$[${MSGNUM}] + 1])
exten => 6,2,goto(s,3)

exten => 7,1,markdelete(IMAP|${MSGNUM} |oldtonew| readunread)
exten => 8,1,goto(voicemail-foward-menu,s,1)
exten => 9,1,goto(voicemail-save-menu,s,1)

exten => t,1,goto(s,3)
exten => i,1,playback(invalid)
exten => i,2,goto(s,3)


etc etc
obviously not everyone will want to change to this new way of doing voicemail menus as it will tend to be pages of dialplan, probably a good bit shorter in ael.  But I think we could give out a good set of defaults and people could do tweaks here and there.  As well as making it easier for people to develop more storage methods for asterisk voicemail and making the world a generally better place.

what do you guys think?

Mog









_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev



More information about the asterisk-dev mailing list