To demonstrate the Programming Language Integration using MS-DOS, Xtend IVR introduces a sample script for Automated Bank Balance Enquiry system.
Any person who has an account in a bank would like to know his/her account balance status at any time. The customers have got only three options - walk down to the bank to get these details or contact the bank staff through telephone or go for the Internet banking. The first option is not feasible in the present scenario. The second option is not possible all the time as it may increase the workload of the staff and for the third option using Internet Banking facility will require a system with Internet facility which may not be possessed by many of the customers. To simplify, Xtend IVR brings out a faster approach in dealing with the existing accounts in banks.
The automated attendant will work as given below:
MAIN: display "Waiting for call." answer 1 play "WelcomeLotus.wav" play "silence.wav" play "PunchAccount.wav" $Acno = Input(4,4) if $Acno = "" play "invalidacno.wav" goto GOODBYE endif play "GetPin.wav" $Pin = Input(4,4) if $Pin = "" play "InvalidPin.wav" goto GOODBYE endif $cmdline = format("%s\system32\cmd.exe /c listdb.exe",fs.GetEnv("windir")) $stat = pipe($cmdline,"$rs") if $stat == 0 or $rs.Count == 0 log "error in running " $cmdline play "down.wav" hangup goto MAIN endif $index = 1 while $index <= $rs.Count $var = format("$rs.line.%d",$index) $str = $$var $pos = find($str,",") if $pos <> -1 $xacno = mid($str,0,$pos) $str = mid($str,$pos+1) endif $pos = find($str,",") if $pos <> -1 $xpin = mid($str,0,$pos) $str = mid($str,$pos+1) endif $pos = find($str,",") if $pos <> -1 $xname = mid($str,0,$pos) $str = mid($str,$pos+1) endif $xbal = alltrim($str) $xacno = alltrim($xacno) $xpin = alltrim($xpin) if compare($xacno,$Acno) == 0 and compare($xpin,$pin) == 0 play "accbal.wav" play money2wav($xbal) break endif $index += 1 endwhile if $index > $rs.Count play "down.wav" endif GOODBYE: play "goodbye.wav" hangup goto MAIN ONHANGUP: hangup goto MAIN ONSYSTEMERROR: log $error display $error hangup goto MAIN