exten => c-CHANUNAVAIL,1,MYSQL(Connect connid localhost monty asterisk asterisk)
exten => c-CHANUNAVAIL,2,MYSQL(Query resultid ${connid} SELECT\ email\ FROM\ voicemail_users\ WHERE\ mailbox=${ARG2}\)
exten => c-CHANUNAVAIL,3,MYSQL(Fetch fetchid ${resultid} email)
exten => c-CHANUNAVAIL,4,NoOp(Gespeicherte email: ${email})
exten => c-CHANUNAVAIL,5,MYSQL(Clear ${resultid})
exten => c-CHANUNAVAIL,6,MYSQL(Query resultid ${connid} SELECT\ fullname\ FROM\ voicemail_users\ WHERE\ mailbox=${CALLERIDNUM}\)
exten => c-CHANUNAVAIL,7,MYSQL(Fetch fetchid ${resultid} fullname)
exten => c-CHANUNAVAIL,8,NoOp(Gespeicherte Name: ${fullname})
exten => c-CHANUNAVAIL,9,MYSQL(Clear ${resultid})
exten => c-CHANUNAVAIL,10,MYSQL(Disconnect ${connid})
exten => c-CHANUNAVAIL,11,System(echo -e "Verpasster Anruf am ${DATETIME:0:2}.${DATETIME:2:2}.${DATETIME:4:4} um ${DATETIME:9:5}\\n${fullname} <${CALLERID}> hat versucht dich zu erreichen!\\n\\nmfG Asterisk" | mail -s Anrufbenachrichtigung -r admin ${email})
exten => c-CHANUNAVAIL,12,VoiceMail(u${ARG2})
exten => c-CHANUNAVAIL,13,Hangup