This walkthrough shows you how to retrieve information from a database based on a caller's input and provide related information back to the caller.
In this walkthrough
the
caller will be given the
option to “Press 1 for Account Information, 2 for general information or 3 to leave
a message".
This Sample Application is available for download. Use link at the end of this walkthrough to download and install sample application.
Walkthrough Overview
In this walkthrough, you will:
You will learn to do the following:
Prerequisites and Assumptions
RecID (int) |
AccountNumber (nchar(10)) |
AccountPIN (nchar(10)) |
BalanceAmt (money) |
NextPayAmt (money) |
NextPayDate (datetime) |
1 | 123456789 | 123456 | 1245.75 | 125.00 | 10/10/2009 |
2 | 222222222 | 222222 | 20222.47 | 2000.63 | 1/15/2010 |
3 | 333333333 | 333333 | 3573.48 | 0.00 | 10/1/2009 |
Set-up Mailbox Record
We need to create a mailbox record for the caller to leave a message. Set the Status to User, and enable Allow Login During Greeting . Add any other optional information as desired.
By setting the record to Allow Login During Greeting, the mailbox owner will be able to log in while the greeting is played for message management.
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.
Note: Keep Mailbox record 0000 with the default settings as CALLMaster requires it. You should change the password for this record to maintain security.
Open the CALLMaster Manager. Click on Manage, then select Mailboxes. Let's add the record below:
Mailbox Records | |||||
Mailbox # | Password | Last Name | Box Status | Allow Log in During Greeting | |
1111 | 1111 | MB 1111 | 1111@txt.att.net | User | Yes |
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 the Audiotex set-up, the caller will be given the option to hear their account information by entering a 9 digit account number and a 6 digit PIN. We will read the AccountInformation table for this information. The caller will also have the option to hear general information, or to leave a message.
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 | Response Length |
Mailbox | Script File to Run (Must include full path name) (c:\Program Files\CALLMaster\Scripts\SampleApp-GetAcctInfo\) |
Touch Tone Table | |||||||||
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | |||||||||
100 | Start call and Initialize values | Yes | Next Module | 1000 | 9900 | 0000 | InitializeVal.bas | |||||||||||
1000 | Give caller options (Press 1 for Account Information, 2 for general information or 3 to leave a message) | Yes | Touch Tone Table | 9999 | 9900 | 1 | 1100 | 1200 | 1300 | 1190 | 1190 | 1190 | 1190 | 1190 | 1190 | 1190 | ||
1090 | Invalid input. | Yes | Next Module | 1091 | 9900 | 0 | CheckTryCount.bas | |||||||||||
1091 | Try again. | Yes | Next Module | 1000 | 9900 | 0 | ||||||||||||
1100 | Get 9 digit account number | Yes | Next Module | 1110 | 9900 | 0 | GetDTMF-Acct.bas | |||||||||||
1110 | Get 6 digit pin | Yes | Next Module | 1120 | 9900 | 0 | GetDTMF-PIN.bas | |||||||||||
1120 | Read AccountInformation table for matching account and PIN. If found return 1130 else return 1194 | Yes | Next Module | 9900 | 9900 | 0 | ReadAcctInfo.bas | |||||||||||
1130 | Play message "Your balance as of ..." and say today's date | Yes | Next Module | 1135 | 9900 | 0 | SayDateToday.bas | |||||||||||
1135 | Play message "is.." and say balance amount as money | Yes | Next Module | 1140 | 9900 | 0 | SayAcctBal.bas | |||||||||||
1140 | Play message "Your next payment amount of .." and say NextPayAmt as money | Yes | Next Module | 1145 | 9900 | 0 | SayNextPayAmt.bas | |||||||||||
1145 | Play message "is due on..." and say NextPayDate | Yes | Next Module | 1150 | 9900 | 0 | SayNextPayDate.bas | |||||||||||
1150 | Give option to hear balance again "Press 1 to hear balance again, 2 to return to the main menu or any other key to end the call" | Yes | Touch Tone Table | 9999 | 9900 | 1 | 1130 | 1000 | 9999 | 9999 | 9999 | 9999 | 9999 | 9999 | 9999 | 9999 | ||
1190 | Play error message "Account number must be 9 digits." | Yes | Next Module | 1191 | 9900 | 0 | CheckTryCount.bas | |||||||||||
1191 | Please try again | Yes | Next Module | 1100 | 9900 | 0 | ||||||||||||
1192 | Play error message "PIN must be 6 digits." | Yes | Next Module | 1193 | 9900 | 0 | CheckTryCount.bas | |||||||||||
1193 | Please try again | Yes | Next Module | 1110 | 9900 | 0 | ||||||||||||
1194 | Record not found. Account or Pin mismatch. | Yes | Next Module | 1195 | 9900 | 0 | CheckTryCount.bas | |||||||||||
1195 | Record not found. Give option to try again "Press 1 to try again or hang-up to exit". | Yes | Touch Tone Table | 9999 | 9900 | 1 | 1100 | 9999 | 9999 | 9999 | 9999 | 9999 | 9999 | 9999 | 9999 | 9999 | ||
1200 | Play general information | Yes | Next Module | 1210 | 9900 | 0 | ||||||||||||
1210 | Give option to hear balance again. Press 1 to hear again, 2 to return to the main menu or any other key to end the call. | Yes | Touch Tone Table | 9999 | 9900 | 1 | 1200 | 1000 | 9999 | 9999 | 9999 | 9999 | 9999 | 9999 | 9999 | 9999 | ||
1300 | Send caller to Mailbox | Yes | Mailbox | 1310 | 9900 | 0 | 1111 | |||||||||||
1310 | Press 1 to return to the main menu or any other key to end the call. | Yes | Touch Tone Table | 9999 | 9900 | 1 | 1000 | 9999 | 9999 | 9999 | 9999 | 9999 | 9999 | 9999 | 9999 | 9999 | ||
9900 | Call Failure Detected | Yes | Next Module | 9999 | 9999 | 0 | SetCallFailure.bas | |||||||||||
9910 | Caller Hang-up Detected | Yes | Next Module | 9999 | 9999 | 0 | SetCallerHangup.bas | |||||||||||
9920 | Maximum tries attempted | Yes | Next Module | 9999 | 9999 | 0 | SetMaxAttempts.bas | |||||||||||
9999 | Last Module - End call | Yes | Last Module |
Audiotex Module Description
Based on the Audiotex modules shown above, we will need several scripts. Let's make a Scripts sub-folder (Program Files\CALLMaster\Scripts\SampleApp-GetAcctInfo folder) to save the custom scripts.
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\SampleApp-GetAcctInfo folder.
CALLBasic Script - InitializeVal.bas | Copy to Clipboard |
Program '************************************************************************************************ ' Script: InitializeVal.bas ' Function: This script is used to initialize values '************************************************************************************************ strYes = "Yes" strNo = "No" strZero = "0" intYes = 1 intNo = 0 intOne = 1 intZero = 0 strCallFailure = strNo strCallerHangup = strNo strMaxAttempts = strNo ' Set retry counter and maximum attempts allowed intTryCount = 1 intMaxAttemptsAllowed = 3 ' Set input lengths for use by the GetDTMF command intAcctNoInputLen = 9 intPINInputLen = 6 'SampleApps db SADBOpen = intNo ' AccountInformation table values AIMatchExists = intNo AI-strAccountNumber = "" AI-strAccountPIN = "" GetFloat AI-fltBalanceAmt strZero 0 GetFloat AI-fltNextPayAmt strZero 0 AI-dteNextPayDate = $today ' Set connection string to read SampleApps SQL database strSAConnection = "Provider=SQLOLEDB;Server=<servername>;DATABASE=SampleApps;UID=;PWD=;Integrated Security=SSPI;" ' Set the module to return to if caller hangs up lctrap = 9910 ' Convert system variable $channel from integer to string to be used in concatenated print statement. IntegerToString strchannel $channel pline = "***** For channel=" & strchannel pline = pline & " Started initialization process " PrintNL pline EndProgram |
CALLBasic Script - CheckTryCount.bas | Copy to Clipboard |
Program '********************************************************************************************** ' Script: CheckTryCount.bas ' Function: This script checks the number of invalid input attempts. '********************************************************************************************** ' If the caller has reached the maximum attempts allowed then the call is routed to module 9920. ' If not then they are returned back to module 1000 to retry input based on Next Module ID. If intTryCount > intMaxAttemptsAllowed Then Return 9920 Else intTryCount = intTryCount + 1 EndIf ' Convert system variable intTryCount from integer to string to be used in concatenated print statement. IntegerToString strTryCount intTryCount pline = "***** For channel=" & strchannel pline = pline & " TryCount = " pline = pline & strTryCount PrintNL pline EndProgram |
CALLBasic Script - GetDTMF-Acct.bas | Copy to Clipboard |
Program '********************************************************************************************** ' Script: GetDTMF-Acct.bas ' Function: This script gets the account number from the caller. '********************************************************************************************** ' Set up parameters for GetDTMF command strNoInput = "" strAcctNoInput = "" tmask = "" ndigits = intAcctNoInputLen timeout = 15 GetDTMF strNoInput tmask ndigits timeout ' Get length of input StringLength intlen strNoInput pline = "***** For channel=" & strchannel pline = pline & " Account No entered is " pline = pline & strNoInput PrintNL pline ' Check caller input. The caller must enter the number of digits defined by variable intMBInputLen. ' If valid input then save number entered If intlen <> intAcctNoInputLen Then pline = "***** For channel=" & strchannel pline = pline & " Invalid Account No entered. Return to 1190 for error and retry" PrintNL pline Return 1190 Else intTryCount = 0 strAcctNoInput = strNoInput EndIf EndProgram |
CALLBasic Script - GetDTMF-PIN.bas | Copy to Clipboard |
Program '*********************************************************************************************** ' Script: GetDTMF-PIN.bas ' Function: This script gets the account number from the caller. '*********************************************************************************************** ' Set up parameters for GetDTMF command strNoInput = "" strPINInput = "" tmask = "" ndigits = intPINInputLen timeout = 15 GetDTMF strNoInput tmask ndigits timeout ' Get length of input StringLength intlen strNoInput pline = "***** For channel=" & strchannel pline = pline & " PIN entered is " pline = pline & strNoInput PrintNL pline ' Check caller input. The caller must enter the number of digits defined by variable intMBInputLen. ' If valid input then save number entered If intlen <> intPINInputLen Then pline = "***** For channel=" & strchannel pline = pline & " Invalid PIN entered. Return to 1192 for error and retry" PrintNL pline Return 1192 Else intTryCount = 0 strPINInput = strNoInput EndIf EndProgram |
CALLBasic Script - ReadAcctInfo.bas | Copy to Clipboard |
Program '************************************************************************************************* ' Script: ReadAcctInfo.bas ' Function: This script reads the AccountInformation table. '************************************************************************************************* ' Set new command and open connection to SampleApps database. Set AIvarCommand = New Command AIvarCommand.ActiveConnection strSAConnection If $DBError <> intZero Then AIvarSet.Close Set AIvarSet = Nothing pline = "***** For channel=" & strchannel pline = pline & " Error Connecting db. " PrintNL pline Return 9900 Else EndIf ' Create a new recordset Set AIvarSet = New Recordset strSQL = "SELECT BalanceAmt, NextPayAmt, NextPayDate FROM AccountInformation WHERE AccountNumber = '" & strAcctNoInput strSQL = strSQL & "' and AccountPIN = '" & strPINInput strSQL = strSQL & "'" pline = "For channel " & strchannel pline = pline & strSQL PrintNL pline ' Open SADB database and find record Set AIvarSet = AIvarCommand.Execute strSQL If $DBError <> intZero Then AIvarSet.Close Set AIvarSet = Nothing pline = "***** For channel=" & strchannel pline = pline & " Error reading AI db. " PrintNL pline Return 9900 Else EndIf Set AIvarFields = AIvarSet.Fields SADBOpen = intYes If AIvarSet.EOF = 0 Then Set AIvarF1 = AIvarFields.Field 1 Set AIvarF2 = AIvarFields.Field 2 Set AIvarF3 = AIvarFields.Field 3 AI-strAccountNumber = strAcctNoInput AI-strAccountPIN = strPINInput AI-fltBalanceAmt = AIvarF1.Value AI-fltNextPayAmt = AIvarF2.Value AI-dteNextPayDate = AIvarF3.Value ' Free field variables Set AIvarF1 = Nothing Set AIvarF2 = Nothing Set AIvarF3 = Nothing ' Set Switches AIMatchExists = intYes Else AIMatchExists = intNo EndIf ' Free AIDB varSet, varFields, and close database ' Destroy Fields Object Set AIvarFields = Nothing ' Close recordset AIvarSet.Close ' Free memory Set AIvarSet = Nothing ' clear command AIvarCommand.CloseConnection Set AIvarCommand = Nothing ' AIDB database closed AIDBOpen = intNo ' If found return 1130 else return 1194 If AIMatchExists = intYes Then 'Print information to log file for reference and debugging pline = "***** For channel=" & strchannel pline = pline & " AccountInformation record found for AccountNumber = " & AI-strAccountNumber PrintNL pline Return 1130 Else pline = "***** For channel=" & strchannel pline = pline & " AccountInformation record NOT found for AccountNumber = " & strAcctNoInput PrintNL pline Return 1194 EndIf EndProgram |
CALLBasic Script - SayDateToday.bas | Copy to Clipboard |
Program '********************************************************************************************** ' Script: SayDateToday.bas ' Function: This script says today's date. '********************************************************************************************** SayDate $today 'Print information to log file for reference and debugging pline = "***** For channel=" & strchannel pline = pline & "***** Say date today *****" PrintNL pline EndProgram |
CALLBasic Script - SayAcctBal.bas | Copy to Clipboard |
Program '********************************************************************************************** ' Script: SayAcctBal.bas ' Function: This script says the account balance. '********************************************************************************************** ' Convert balance from float to string format FloatToString strBalanceAmt AI-fltBalanceAmt ' To say the balance as money, set the variable saymoney to 1, use SayNumber then reset saymoney to 0 saymoney = 1 SayNumber strBalanceAmt saymoney = 0 'Print information to log file for reference and debugging pline = "***** For channel=" & strchannel pline = pline & "***** Said balance amount as money *****" PrintNL pline EndProgram |
CALLBasic Script - SayNextPayAmt.bas | Copy to Clipboard |
Program '************************************************************************************************** ' Script: SayNextPayAmt.bas ' Function: This script says the next payment amount. '************************************************************************************************** ' Convert balance from float to string format FloatToString strNextPayAmt AI-fltNextPayAmt ' To say the next pay amount as money, set the variable saymoney to 1, use SayNumber then reset saymoney to 0 saymoney = 1 SayNumber strNextPayAmt saymoney = 0 'Print information to log file for reference and debugging pline = "***** For channel=" & strchannel pline = pline & "***** Said next payment amount as money *****" PrintNL pline EndProgram |
CALLBasic Script - SayNextPayDate.bas | Copy to Clipboard |
Program '**************************************************************************************************** ' Script: SayNextPayDate.bas ' Function: This script says the next payment date. '**************************************************************************************************** ' Use the SayDate command as variable AI-dteNextPayDate is a date/time data type SayDate AI-dteNextPayDate 'Print information to log file for reference and debugging pline = "***** For channel=" & strchannel pline = pline & "***** Said next payment date *****" PrintNL pline 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 = "***** For channel=" & strchannel pline = 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 = "***** For channel=" & strchannel pline = pline & "***** Caller Hangup. *****" PrintNL pline EndProgram |
CALLBasic Script - SetMaxAttempts.bas | Copy to Clipboard |
Program '******************************************************************************************************************** ' Script: SetMaxAttempts.bas ' Function: This script sets the strMaxAttempts variable to yes and prints information in the call log file. '******************************************************************************************************************** strMaxAttempts = strYes 'Print information to log file for reference and debugging pline = "***** For channel=" & strchannel pline = pline & "***** Maximum Attempts reached to enter valid input *****" 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. Let's 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 100. 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 |
100 | Account Information Retrieval Sample |
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 100.
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 Greeting File IDs (Morning, Afternoon, Evening, Closed, Holidays) |
1 | Account Information Retrieval Sample | 100 | 0, 0, 0, 0, 0 |
2 | Account Information Retrieval Sample | 100 | 0, 0, 0, 0, 0 |
3 | Account Information Retrieval Sample | 100 | 0, 0, 0, 0, 0 |
4 | Account Information Retrieval Sample | 100 | 0, 0, 0, 0, 0 |
Test the custom application
Make sure you have set the SampleApps database connection string variable strSAConnection in the InitializeVal.bas script for your environment.
Save all your work.
Stop CALLMaster service.
Make Audiotex Recordings:
- Set Port 1 to Application Voice Mail.
- Start CALLMaster service.
- Make a call using Port 1.
- Log in as the Administrator using the Voice Mail Main Menu and make recordings for the Audiotex modules below.
Audiotex Module ID | Proposed Recording |
1000 | Press 1 for Account Information, 2 for general information or 3 to leave a message. |
1090 | Invalid option. |
1091 | Please try again |
1100 | Please enter your 9 digit account number. |
1110 | Please enter your 6 digit PIN |
1130 | Your balance as of ... |
1135 | is... |
1140 | Your next payment amount of .. |
1145 | is due on... |
1150 | Press 1 to hear balance again, 2 to return to the main menu or any other key to end the call |
1190 | Account number must be 9 digits. |
1191 | Please try again |
1192 | PIN must be 6 digits. |
1193 | Please try again |
1194 | Account number or PIN not valid. |
1195 | Press 1 to try again or hang-up to exit |
1200 | General information message |
1210 | Press 1 to hear the information again, 2 to return to the main menu or any other key to end the call |
1310 | Press 1 to return to the main menu or any other key to end the call. |
9900 | We are unable to process your call. Please contact the system administrator for further assistance. |
9920 | You have reached the maximum attempts allowed for a valid input. Please contact the system administrator for further assistance. |
Reset Port 1 to Application Audiotex. Set the Port Greeting File IDs to zeros.
Stop and Start CALLMaster service.
Make a phone call to test the application.
Tip: See Walkthrough: Change Application Without Restarting CALLMaster Service to set port to Voice Mail to make recording without stopping and restarting the CALLMaster service.
The owner of Mailbox 1111 can use option 3 (leave message), then use the Allow Login During Greeting functionality to log in while the greeting is played for message management (check messages left by callers or to make mailbox recordings).
To download and install, see Sample Applications.