This sample shows a simple voicemail application which will answer the telephone and forward a recorded message to an e-mail recipient.

Preparation - using analog phone lines

It is necessary to establish a method of initiating the script. In a simple analog system, this is done by allocating a specific user profile to an incoming voice line using $default_profile in FAXFACTS.CFG:

$default_profile 3 ANSWER.USR  ; use ANSWER for line 3

The ANSWER.USR should contain an $image_locn command to specify the folder for the IIF and VOX/WAV files used in this application, and an $auto_call command to start the infobox sequence. You also need to specify the folder into which the recorded messages are to be placed, and the e-mail address to send the file to:

$image_locn  ANSWER ANSWER999 "@FFBASE\ANSWER"

$auto_call   ANSWER010

$user_op     request

$fax_phone_last

$rcrd_dir    @FFBASE\ANSWER\MESSAGES

$var_def     DestinationEmail myname@mydomain.com ; modify as needed!

$var_def     voiceboxnumber 1234567

In addition, you may require commands to locate any override system messages and multi-segment files needed for the application, for example:

$vmsg_dir    @FFBASE\ANSWER

$user_pb_dig @FFBASE\wav_8k_mulaw\faxfactw.dig

Ensure that the folders mentioned are all created before you start.  Create the NEXTMSG file as a text file containing the number 1 on a single line (message numbering will start from this value).

Preparation - using digital phone lines

Normally on a digital system there will be a special number allocated for the application, which selects a USR file based on the number of digits specified for DNIS in the CopiaFacts configurator CFHWL. The USR file is then automatically picked up when an incoming call to the number is received.

For example, if 4 digits of DNIS are used, and the application is assigned the DID 1234, then the incoming call will pick up 00001234.USR.  This file should contain an $image_locn command to specify the folder for the IIF and VOX/WAV files used in this application, and an $auto_call command to start the infobox sequence. You also need to specify the folder into which the recorded messages are to be placed, and the e-mail address to send the file to. If you have only a single voicemail application, this file can contain:

; 00001234.USR

$image_locn  ANSWER ANSWER999 "@FFBASE\ANSWER"

$auto_call   ANSWER010

$user_op     request

$fax_phone_last

$rcrd_dir    @FFBASE\ANSWER\MESSAGES

$var_def     DestinationEmail myname@mydomain.com ; modify as needed!

$var_def     voiceboxnumber 1234

$vmsg_dir    @FFBASE\ANSWER

$user_pb_dig @FFBASE\wav_8k_mulaw\faxfactw.dig

For systems with more than one number allocated for different IVR scripts, they can be defined separately by adding one folder level to distinguish them, and then creating multiple USR files, one for each allocated DNIS:

; 00001234.USR

$image_locn  ANSWER ANSWER999 "@FFBASE\1234\ANSWER"

$auto_call   ANSWER010

$user_op     request

$fax_phone_last

$rcrd_dir    @FFBASE\1234\ANSWER\MESSAGES

$var_def     DestinationEmail myname@mydomain.com ; modify as needed!

$var_def     voiceboxnumber 1234

$vmsg_dir    @FFBASE\1234\ANSWER

$user_pb_dig @FFBASE\wav_8k_mulaw\faxfactw.dig

In this case you can customize the greeting and other messages and place them in separate ANSWER folders. In the infobox descriptions below, we refer just to 'the ANSWER folder', but this will actually be the ANSWER folder selected by the $image_locn command in the DNIS-selected USR file.

Ensure that the folders mentioned are all created before you start.  Create the NEXTMSG file as a text file containing the number 1 on a single line (message numbering will start from this value).

System Voice Prompt Overrides

It is simplest if you suppress the system greeting SVP1.WAV by copying EMPTY.WAV over this file. You will replace this with a voice message played from infobox ANSWER010. You may also wish to override the "thank you for calling" system prompt: t suppress this message, copy EMPTY.WAV to SVP58.WAV in the ANSWER folder referenced from $vmsg_dir in the USR file.

Prompts

You should normally record a greeting message confirming that the correct number has been reached.  This should be recorded into ANSWER\ANSWER010.WAV.

 "This is (person/company name)"

When there are multiple users, you can identify the specific user in the message.

You will also need a message asking the caller to leave a message. You can record this into the file ANSWER\ANSWER020.WAV.

 "Please leave a message after the tone"

Initial Infobox

Control will pass to the infobox specified by the $auto_call command in the USR file:

; ANSWER010.IIF

$type voice

$image_desc  standard ; uses ANSWER010.WAV

$next_box    ANSWER020

Recording Infobox

The next step is to record the caller's message:

; ANSWER020.IIF

$type record

 

$record_nextmsg @FFBASE\NEXTMSG  ; maintain message number here

$record_limit   180      ; three minute limit

$image_desc     standard ; uses ANSWER010.WAV

$error_exit     ANSWER030

$next_box       ANSWER030

Send E-Mail Infobox

To send the e-mail, you will need an infobox which creates an e-mail FS file:

; ANSWER030.iif

$type fsfile

 

$next_box       s:HANG_UP

$fax_user       @@FFUSER\email.usr

$email_esender  voicemail@mydomain.com ; modify as needed!

$email_from     voicemail@mydomain.com ; modify as needed!

$email_address  `DestinationEmail      ; as set up in USR

 

$email_text     "The call was received on `DATE6 at `TIME2"

$if @LAST_RECORDFILE = @EMPTY

  $email_text     "No recording was made"

  $email_subject  "Voice Message for `VOICEBOXNUMBER"

$else

  $ife @LAST_RECORDFILE 200 

    $set_var        FN @LAST_RECORDING 0 8

    $set_var        FI $fileinfo @LAST_RECORDFILE

    $set_var        SZ @fi 14 6

    $email_subject  "Voice Message for `VOICEBOXNUMBER (`SZ bytes)"

    $email_attach   "`LAST_RECORDFILE" "audio/x-wav; name=""`FN.WAV"""

    $email_text     "File `FN.WAV is attached"

  $else

    $email_text     "No recording was made"

    $email_subject  "Voice Message for `VOICEBOXNUMBER"

  $endif

$endif