[vm_msg]
exten => _91!,1,Macro,entfernegitter
exten => _91!,n,answer
exten => _91!,n,wait,1
exten => _91!,n,record,VM_BT_RHEIM.gsm|3|60
exten => _91!,n,playback,VM_BT_RHEIM
exten => _91!,n,playback,beep
exten => _91!,n,hangup
[vm_box]
exten => _90!,1,Macro,entfernegitter
exten => _90!,n,answer,2000
exten => _90!,n,wait,1
; Ansagetext vorspielen
exten => _90!,n,playback,VM_BT_RHEIM
exten => _90!,n,set,MSGFILENAME=${CALLERIDNUM}-${TIMESTAMP}
exten => _90!,n,set,MAILER_SUBJECT=Anrufer:${CALLERIDNUM} ${DATETIME}
exten => _90!,n,record,../../../../oldroot/var/tmp/${MSGFILENAME}.WAV|5|60
exten => _90!,n,hangup
; Nachricht nach Hangup per e-mail versenden
exten => h,1,gotoif,${MSGFILENAME}?20:48
exten => h,20,system,chroot /oldroot mv /var/tmp/${MSGFILENAME}.WAV /var/tmp/${MSGFILENAME}.wav
exten => h,n,gotoif,${MAILER_USER}?40
exten => h,n,system(chroot /oldroot mailer -s "${MAILER_SUBJECT}" -m "${MAILER_SMTP}" -f "${MAILER_FROM}" -t "${MAILER_TO}" -d /var/tmp/${MSGFILENAME}.wav)
exten => h,n,goto,45
exten => h,40,system(chroot /oldroot mailer -a "${MAILER_USER}" -w "${MAILER_PASSWORD}" -s "${MAILER_SUBJECT}" -m "${MAILER_SMTP}" -f "${MAILER_FROM}" -t "${MAILER_TO}" -d /var/tmp/${MSGFILENAME}.wav)
exten => h,n,goto,45
; Nachricht bei erfolgreichem Versand loeschen
exten => h,45,gotoif,$[${SYSTEMSTATUS} = SUCCESS]?46:47
exten => h,46,system,chroot /oldroot rm /var/tmp/${MSGFILENAME}.wav
exten => h,47,playback,beep
exten => h,48,noop()
[lokal]
include => echotest
include => authtest
include => vm_box
include => vm_msg