been done a couple of different ways - here is our production setup:
exten => 101,1,Macro(stdexten-announce,sip/101,101,15)
here are the two macros you would need (minus the custom sound files):
[macro-stdexten-announce]
exten => s,1,Playback(sayyourname)
exten => s,2,SetVar(CALLER_NAME=/tmp/${CALLERIDNUM}-${EPOCH})
exten => s,3,Record(${CALLER_NAME}.gsm|2|4)
exten => s,4,Dial(${ARG1}|${ARG3}|rtM(announce^${CALLER_NAME}))
exten => s,5,Voicemail(u${ARG2})
exten => s,6,Hangup
exten => s,105,Goto(5)
exten => h,1,System(/bin/rm -f ${ARG1}.gsm)
;
;
;
[macro-announce]
exten => s,1,Background(callfrom)
exten => s,2,Background(${ARG1})
exten => s,3,Read(ACCEPT|call-accept|1)
exten => s,4,Gotoif($[${ACCEPT} = 1] ?50) ;connect
exten => s,5,Gotoif($[${ACCEPT} = 2] ?30) ;reject to vm
exten => s,6,Gotoif($[${ACCEPT} = 3] ?30:30) ;any thing else vm
exten => s,30,SetVar(MACRO_RESULT=CONTINUE)
exten => s,31,Goto(50)
exten => s,50,System(/bin/rm -f ${ARG1}.gsm)
exten => h,1,System(/bin/rm -f ${ARG1}.gsm)
have fun.