Customizing voicemail retrieval

Hi,

I’m trying to figure out how to modify the default voicemail retrieval function so that I can change the sequence of options for voicemail. The standard sequence is something like "You have X New messages and Y old messages, press 1 for the first message …press 6 to read the next message, press 5 to replay the message " etc. What I want to do for example is to go directly to the new messages once a user dials the voicemail number (*097).

So far I’ve only managed to replicate the voice mail retrieval code in extensions_custom.conf. How can I go further to alter the options above? I’ve pasted the code I’m using below:

[custom-voicemail-retrieve]
exten => s,1,Answer
exten => s,n,Wait(1)
exten => s,n,Macro(user-callerid,)
exten => s,n,Macro(get-vmcontext,${AMPUSER})
exten => s,n(check),Set(VMBOXEXISTSSTATUS=${IF(${MAILBOX_EXISTS(${AMPUSER}@${VMCONTEXT})}?SUCCESS:FAILED)})
exten => s,n,GotoIf($["${VMBOXEXISTSSTATUS}" = “SUCCESS”]?mbexist)
exten => s,n,VoiceMailMain()
exten => s,n,GotoIf($["${IVR_RETVM}" = “RETURN” & “${IVR_CONTEXT}” != “”]?playret)
exten => s,n,Macro(hangupcall,)
exten => s,check+101(mbexist),VoiceMailMain(${AMPUSER}@${VMCONTEXT},s)
exten => s,n,GotoIf($["${IVR_RETVM}" = “RETURN” & “${IVR_CONTEXT}” != “”]?playret)
exten => s,n,Macro(hangupcall,)
exten => s,n(playret),Playback(beep&you-will-be-transfered-menu&silence/1)
exten => s,n,Goto(${IVR_CONTEXT},return,1)
exten => h,1,Macro(hangupcall,)

You would have to modify asterisk C code in App Voicemail.