'*********************************************************************** '* FileName: '* '* Version: '* '* Description: '* '*********************************************************************** '*********************************************************************** ' The areas between "HAMMER BEGIN..." and "HAMMER END..." are used by ' the enhanced editor. Do NOT edit in these areas. '*********************************************************************** '* HAMMER BEGIN INCLUDE AREA '$Include "C:\Hammer\LoadBlaster\Include\TestDeclarations.sbh" '$Include "C:\Hammer\LoadBlaster\Include\HT_LOAD_LIBRARY.SBH" '$Include "C:\Hammer\LoadBlaster\Include\Modem_Utilities.SBH" '* HAMMER END INCLUDE AREA Global PhoneNumber as strInput Global TFN as strInput Global SSN as strInput Global RepExt as strInput '* HAMMER BEGIN DIM AREA '* (Do not edit in this area) dim event as telEvent dim eventType as double dim HT_lastErr as double dim recDigits as string dim HT_eventStr as string dim HT_valueStr as string dim HT_typeStr as string dim curLoopCount as long dim maxLoops as long dim timeNow as double '* HAMMER END DIM AREA '* HAMMER BEGIN FAX BASIC DECLARATIONS dim num, max, retVal as double dim FaxImageName as String dim FaxSessionName as String dim i as integer dim SessionCounter as integer '* Metrics Declaration dim FaxSessionStatus as parmFaxSessionStatus dim FaxCheckStatus as parmFaxCheckStatus dim FaxDocStatus as StatusDoc '* ITU Primary and Secondary Metrics dim BadLines as integer dim ExpectedRate as integer dim NegotiatedRate as integer '* HAMMER END FAX BASIC DECLARATIONS Option Explicit '*********************************************************************** ' Sub Main '*********************************************************************** sub main '* (Do not remove or edit this following include line) '$Include "C:\Hammer\LoadBlaster\Include\TestInitialization.sbh" '* Parameters from .Bat file set PhoneNumber = HT_NewInputStr("PhoneNumber") set TFN = HT_NewInputStr("TFN") set SSN = HT_NewInputStr("SSN") set RepExt = HT_NewInputStr("RepExt") TFN = 0 SSN = 0 RepExt = 0 logMsg " Begin script - (script name here)", HT_LOG_NORMAL '*********************************************** '* On a trapable error goto to PrintError and exit. '*********************************************** On Error Goto PrintError '* HAMMER BEGIN PARAM DEFINITIONS '* HAMMER END PARAM DEFINITIONS call startProtocol (hld_protocol,NULL,NULL) logMsg "=> Placing call to " + phoneNumber, HT_LOG_NORMAL set event = placeCall (PhoneNumber, NULL) eventType = event.type() if eventType <> HTEVT_CALL_CONNECTED then goto TelError set event = waitForEnergy(30000) set event = waitForSilence(30000) logMsg "=> Sending DTMF digits 8661111111", HT_LOG_NORMAL ' Dial the phone number set event = sendDtmf("8661111111", NULL) eventType = event.type() if eventType <> HTEVT_TONES_DONE then goto TelError 'logMsg "=> Starting recording...", HT_LOG_NORMAL ' set event = recordPrompt("TFN", HT_ENCODE_MULAW, 30000, ) ' eventType = event.type() ' if eventType <> HTEVT_RECORD_DONE then goto TelError ' logMsg " => Done recording, recorded into PIN", HT_LOG_NORMAL ' stopProtocol ' Wait for a sound set event = waitForEnergy(30000) set event = waitForSilence(30000) logMsg "=> Sending DTMF digits 2", HT_LOG_NORMAL ' Press the 2 button set event = sendDtmf("2", NULL) eventType = event.type() if eventType <> HTEVT_TONES_DONE then goto TelError set event = waitForEnergy(30000) set event = waitForSilence(30000) ' Recording code to make sure we are in the right place for the ' phone interaction that we need to make 'logMsg "=> Starting recording...", HT_LOG_NORMAL ' set event = recordPrompt("TFN", HT_ENCODE_MULAW, 30000, ) ' eventType = event.type() ' if eventType <> HTEVT_RECORD_DONE then goto TelError ' logMsg " => Done recording, recorded into PIN", HT_LOG_NORMAL ' stopProtocol logMsg "=> Sending DTMF digits 1111111111#", HT_LOG_NORMAL ' Dial the 1111111111 number set event = sendDtmf("1111111111#", NULL) eventType = event.type() if eventType <> HTEVT_TONES_DONE then goto TelError set event = waitForEnergy(30000) set event = waitForSilence(30000) logMsg "=> Sending DTMF digits 121212#", HT_LOG_NORMAL ' Send the Pin set event = sendDtmf("111111#", NULL) eventType = event.type() if eventType <> HTEVT_TONES_DONE then goto TelError set event = waitForEnergy(30000) ' logMsg "=> Starting recording...", HT_LOG_NORMAL ' set event = recordPrompt("PIN", HT_ENCODE_MULAW, 30000, ) ' eventType = event.type() ' if eventType <> HTEVT_RECORD_DONE then goto TelError ' logMsg " => Done recording, recorded into PIN", HT_LOG_NORMAL ' stopProtocol set event = waitForEnergy(30000) set event = waitForSilence(30000) logMsg "=> Sending DTMF digits 0", HT_LOG_NORMAL set event = sendDtmf("0", NULL) eventType = event.type() if eventType <> HTEVT_TONES_DONE then goto TelError set event = waitForEnergy(30000) set event = waitForSilence(30000) ' logMsg "=> Starting recording...", HT_LOG_NORMAL ' set event = recordPrompt("PIN", HT_ENCODE_MULAW, 30000, ) ' eventType = event.type() ' if eventType <> HTEVT_RECORD_DONE then goto TelError ' logMsg " => Done recording, recorded into PIN", HT_LOG_NORMAL ' stopProtocol logMsg "=> Sending DTMF digits 0", HT_LOG_NORMAL set event = sendDtmf("0", NULL) eventType = event.type() if eventType <> HTEVT_TONES_DONE then goto TelError set event = waitForEnergy(30000) set event = waitForSilence(30000) ' logMsg "=> Starting recording...", HT_LOG_NORMAL ' set event = recordPrompt("PIN", HT_ENCODE_MULAW, 30000, ) ' eventType = event.type() ' if eventType <> HTEVT_RECORD_DONE then goto TelError ' logMsg " => Done recording, recorded into PIN", HT_LOG_NORMAL ' stopProtocol pause 200, ht_milliseconds set event = waitForEnergy(40000) set event = waitForSilence(30000) ' logMsg "=> Starting recording...", HT_LOG_NORMAL ' set event = recordPrompt("PIN", HT_ENCODE_MULAW, 30000, ) ' eventType = event.type() ' if eventType <> HTEVT_RECORD_DONE then goto TelError ' logMsg " => Done recording, recorded into PIN", HT_LOG_NORMAL ' stopProtocol ' set event = waitForEnergy(40000) set event = waitForSilence(30000) pause 2000, ht_milliseconds set event = waitForEnergy(40000) ' pause 3000, ht_milliseconds set event = waitForSilence(30000) ' logMsg "=> Starting recording...", HT_LOG_NORMAL ' set event = recordPrompt("PIN", HT_ENCODE_MULAW, 30000, ) ' eventType = event.type() ' if eventType <> HTEVT_RECORD_DONE then goto TelError ' logMsg " => Done recording, recorded into PIN", HT_LOG_NORMAL logMsg "=> Sending DTMF digits 396", HT_LOG_NORMAL set event = sendDtmf("396", NULL) eventType = event.type() if eventType <> HTEVT_TONES_DONE then goto TelError pause 30000, ht_milliseconds set event = releaseCall() eventType = event.type() Select Case eventType Case HTEVT_CALL_RELEASED LogMsg "HTEVT_CALL_RELEASED - Normal near end disconnect.", HT_LOG_DEBUG Case HTEVT_CALL_DISCONNECTED LogMsg "HTEVT_CALL_DISCONNECTED - The far end hung up first.", HT_LOG_DEBUG CASE Else LogMsg "Unexpected releaseCall ERROR! - Proceeding to TelError", HT_LOG_DEBUG goto TelError end Select logMsg "=> Call released.", HT_LOG_NORMAL stopProtocol setScriptResult HT_SUCCESS '* Do not remove the following Loop. '* This loop is used in TestInitialization.sbh. Loop logMsg "Running Time = " & str$(readStopWatch(1)) goto done TelError: setScriptResult HT_FAILURE if (eventType <> HTEVT_UNINITIALIZED) AND (eventType <> HTEVT_TIMED_OUT) then event.eventText HT_eventStr event.typeText HT_typeStr event.valueText HT_valueStr logMsg "=> Event: " & HT_eventStr & " detected now in TelError", HT_LOG_FAIL logMsg "=> type = " & str$(eventType) & " - " & HT_typeStr, HT_LOG_FAIL logMsg "=> reason = " & str$(event.value()) & " - " & HT_valueStr, HT_LOG_FAIL end if Reset '* RESET - closes any open files and writes any data to '* the operating system disk. Exit sub PrintError: logMsg "=> Script Failure at line: " + str$(Erl) logMsg "=> with error: " + Error$ '* 10000 - user stop '* 10001 - scheduler stop '* 10002 - script encountered an error. if (Err = 10000) OR (Err = 10001) then logMsg " => This script has been stopped..." goto done end if '* Handle script error here. '*========================== setScriptResult HT_FAILURE Reset Exit sub done: '* Script is finishing cleanup. logMsg "Script (script name here) is now finished running." Reset End sub