Voice mail systems are designed to convey a caller's recorded audio message automatically to the recipient. The IVR script demonstrated below introduces a simple approach to develop a voice mail application by setting up the variables like SMTP server, From address, To address, Subject, Body of the e-mail and the audio file name before sending the email.
Download the evaluation version of Xtend IVR and install the telephony application in your system. Run the sample script from the Script Editor. Click here to refer the code.
The automated attendant will work as given below:
$smtp = "smtp.domain.com"
$from = "emailfrom@domain.com"
$target = "emailto@domain.com"
$subject = "VoiceMail"
$body = "Dear Friend, This is an auto-generated email with a voice
file attached to it."
$pop = "pop3.domain.com"
$user = "popuser"
$password = "poppassword"
MAIN:
display "Waiting for call . . ."
answer 1
display "Call from " $cli
$pos = find($RecordFile,".rec")
if $pos <> -1
$RecordFile = concat( mid($RecordFile,0,$pos), ".wav" )
endif
speak "Welcome to voice mail server."
speak "Please drop your ten second voice message after the beep."
beep 400 500
wait 0
record 10
wait 0
$email.smtp = $smtp
$email.from = $from
$email.to = $target
$email.subject = $subject
$email.body = $body
$email.file = $RecordFile
$email.pop = $pop
$email.user = $user
$email.password = $password
speak "Please wait"
play "music.wav"
play "music.wav"
play "music.wav"
$stat = SendMail("$email")
clear
if $stat == 0
log "Error sending mail: " $email.error
speak "Sorry. We are facing some technical difficulties."
speak "Please call after some time."
else
speak "Your voice mail has been sent."
speak "Thank you."
endif
hangup
goto MAIN
ONHANGUP:
hangup
goto MAIN
ONSYSTEMERROR:
log $error
display $error
hangup
goto MAIN