Walkthrough: Send Caller to a Mailbox Based on the Value of a System Variable

A System Variable returns information about the status of a call or the environment relating to the call.  A system variable can be the DNIS(Number Dialed by the caller), the line number answering the call or some other information.  See System Variables.

In this walkthrough we will send the caller to the mailbox based on the DNIS called. The caller will hear the mailbox greeting and be able to leave a message. The mailbox owner will be notified by email and phone when a caller has left a message.

DNIS is available only for T1 systems and returned by your T1 provider.  The number of DNIS digits returned is based on your T1 provider and set-up in your T1 configuration file.  See T1 Setup Guide.

Walkthrough Overview

In this walkthrough, you will:

  1. Set-up Voice Mail Parameters;
  2. Create Mailbox Records;
  3. Verify System Parameters;
  4. Create Notification Records;
  5. Create Audiotex Records/Modules and Associated Scripts;
  6. Define entry in the IVR Application List for the new custom IVR;
  7. Set Ports.

During this walkthrough, you will learn to do the following:

Prerequisites and Assumptions

Set-up the Voice Mail Parameters.

As the Mailbox number is the same as the DNIS returned, we need to make sure that the Mailbox Length is set to the same number of digits received as the DNIS (assumed to be 10 digits for this walkthrough).

Open the CALLMaster Manager. Click on Parameters, then select Voice Mail.  Double click on each of the parameters below to change their values.

Save and close the Voice Mail Parameters window.

Create Mailbox Records

We need to create a mailbox record for each DNIS enabled.  For each record, the Mailbox # will be equal to a DNIS, the Type set to User, Allow Login During Greeting enabled.  Add any other optional information as desired. 

Note: Keep Mailbox record 0000 with the default settings as CALLMaster requires it.  You should change the password for this record to maintain security.

If the mailbox owner wishes to receive email notification of messages or faxes received in their mailbox, enter their email address in the Email field.

Open the CALLMaster Manager. Click on Manage, then select Mailboxes.  Let's add 3 records in this walkthrough as follows:

Mailbox Records
Mailbox # Password Last Name Email Box Status Allow Log in During Greeting Notification Enabled Notify per Msg
8005551111 1111 DNIS1111 800555111@txt.att.net User Yes Yes Yes
8005552222 2222 DNIS2222 DNIS2222@support.com User Yes Yes  
8005553333 3333 DNIS3333 DNIS3333@service.com;
8005553333@vtext.com
User Yes    

By setting all records to Allow Login During Greeting, the mailbox owner will be able to log in while the greeting is played to Set Personal Options for the mailbox.  The changes made will take effect as soon as the owner logs out.

Verify System Parameters

As we are using Notification, we need to make sure that the System Parameters - Local Dialing Prefix, Long Distance Dialing Prefix, System's Area Code and System's Phone Number have the correct values for your environment.

Open the CALLMaster Manager. Click on Parameters, then select System.  Double click on each of the parameters mentioned above  to change their values as needed.  Remember, CALLMaster will use this information with the Notification data input below to make notification calls. See System Parameters for details.

For this walkthrough we will assume the following values:

Create Notification Records

As we have enabled the Notification On indicator for Mailboxes 8005551111 and 8005552222, we need to create Notification records for them.

Open the CALLMaster Manager. Click on Manage, then select Notification to add the records specified below.  For each record, set the Earliest Hour to Call, Latest Hour to Call, Days to Call and the Call Attempt Schedule as desired.  See Notification for details.

Notification Records
Mailbox # Record # Call Type Area Code Phone Number
8005551111 1 Human 914 1111111
8005552222 1 Human 914 2222222

Create Audiotex Records/Modules and Associated Scripts

As all calls will be starting in Audiotex mode in this walkthrough, the Audiotex Modules will determine the call flow.

In this Audiotex set-up, the caller is forwarded to a mailbox based on the DNIS called.

We will need to create several Audiotex records as shown below.  The Label field provides a brief description of each module.  

Audiotex Records
Module ID Label Write Label to Log File Module Action Next Module ID Fail Module ID Mailbox Script File to Run
(Must include full path name)
1000 Start call and Initialize values Yes Next Module 1100 9900 0000 InitializeVal.bas
1100 Check DNIS
Send caller to associated Mailbox
Yes Mailbox 9999 9900 0000 ReturnMailbox.bas
9900 Call Failure Detected Yes Next Module 9999 9999 0000 SetCallFailure.bas
9910 Caller Hang-up Detected Yes Next Module 9999 9999 0000 SetCallerHangup.bas
9999 Last Module - End call Yes Last Module        

Audiotex Module Description

Based on the Audiotex modules shown above, we will need 4 scripts. 

Let's create the scripts first.  Open Notepad and create scripts following code examples below.  Remember to save them as .bas type files in the Program Files\CALLMaster\Scripts folder.

CALLBasic Script - InitializeVal.bas Copy to Clipboard
Program
'**************************************************************************************************************
'     Script:  InitializeVal.bas
'     Function:  This script is used to initialize values
'**************************************************************************************************************
     ' This script is used to initialize values
     strYes = "Yes"
     strNo = "No"
     intYes = 1
     intNo = 0
     strCallFailure = strNo
     strCallerHangup = strNo

     ' Create variable strMB
     strMB = ""

     ' Assign the DNIS value from system variable $ddn to strMB
     strMB = $ddn

     ' If you want to determine mailbox based on the Port #,
     ' then comment line above (strMB = $ddn)
     ' and uncomment If..Else..EndIf statement below
     'If $channel <= 2 Then
     '   strMB = "8005551111
     'Else
     '   strMB = "8005552222
     'EndIf

     ' Set the module to return to if caller hangs up
     lctrap = 9910

     'Print information to log file for reference and debugging
     pline = "Call received for DNIS " & strMB
     PrintNL pline

EndProgram

CALLBasic Script - ReturnMailbox.bas Copy to Clipboard
Program
'****************************************************************************************************************
'     Script:  ReturnMailbox.bas
'     Function:  This script uses the Return command with a variable. 
'                     When used with Audiotex Module Action 'Mailbox',
'                     the caller will be forwarded to the mailbox whose value is in variable strMB.
'*****************************************************************************************************************

     Return strMB

EndProgram

CALLBasic Script - SetCallFailure.bas Copy to Clipboard
Program
'******************************************************************************************************************
'     Script:  SetCallFailure.bas
'     Function:  This script sets the strCallFailure variable to yes and prints information in the call log file.
'******************************************************************************************************************

     strCallFailure = strYes

     'Print information to log file for reference and debugging
     pline = "***** Call Failure. *****"
     PrintNL pline

EndProgram
CALLBasic Script - SetCallerHangup.bas Copy to Clipboard
Program
'*********************************************************************************************************************
'     Script:  SetCallerHangup.bas
'     Function:  This script sets the strCallFailure variable to yes and prints information in the call log file. 
'*********************************************************************************************************************

     strCallerHangup = strYes

     'Print information to log file for reference and debugging
     pline = "***** Caller Hangup. *****"
     PrintNL pline

EndProgram

Now you can create the Audiotex modules and reference the scripts above.  Open the CALLMaster Manager, click on Manage, then select Audiotex to add the Audiotex records shown above.

Define IVR Application List Entry

We need to define the custom IVR in the IVR Application List and set it to Audiotex Start Module 1000.  Open CALLMaster Manager and select Manage | IVR Application List.  Let's add a new record as follows:

IVR Application List
Audiotex Start Module Application Name
1000 DNIS Based MB Walkthrough

Set Ports

As a last step, we need set the port(s) to the new IVR Application entry created above.  Make sure the Audiotex Start Module field (read only) correctly points to module 1000.

As this walkthrough uses Notification, make sure at least one port is enabled for Type Outbound; by default, all the ports are enabled for Inbound. Set the Port Greeting File IDs to the main greeting for all calls if you have recorded one.  If you do not want a main greeting then set the Greeting File IDs to zero. Leave all other fields to the default values.

If you are working with a demo license or have only one line connected, then make sure the connected port is set as specified below.  All other ports should be set to Application 'Disabled'.

Port Records
Port # Application Audiotex Start Module Port Type
Outbound
Port Greeting File IDs
(Morning, Afternoon, Evening, Closed, Holidays)
1 DNIS Based MB Walkthrough 1000 No 0, 0, 0, 0, 0
2 DNIS Based MB Walkthrough 1000 No 0, 0, 0, 0, 0
3 DNIS Based MB Walkthrough 1000 Yes 0, 0, 0, 0, 0
4 DNIS Based MB Walkthrough 1000 Yes 0, 0, 0, 0, 0

Test the custom application

Save all your work. 

Stop and Start CALLMaster service.

Make a phone call to test the application.

Make the custom Mailbox greetings.

-  Have the Mailbox owner call the system using their DNIS;

-  The mailbox owner will be forwarded to the corresponding mailbox.  As the mailbox records are enabled to Allow Login During Greeting, the mailbox owner will be able to log in while the greeting is played to Set Personal Options for the mailbox.