Process Description: ** Recording Subflow
Process Name: FUNP_RecordVoice ()
Version: Release V1.0
Write Date: 2004-05-29
Modification Date: 2004-05-29
Process Author: Oseee
*********************************************************** * /
/ ************************************************** *
Subflow input and output parameter description:
enter:
_Field1: acceptor mobile phone number
Output:
_Field1: Recording generated voice file (including path)
0: Successful
1: Expressing failed
*********************************************************** * /
/ ************************************************** **
Register instructions:
SR10: Calling user mobile phone number
SR11: Voice file path
SR12: Speech file name with path
SR13: Acceptance mobile phone number
SR14: Variables temporarily stored in recording files
SR20: Voice file path temporary transition variable
SR50: Terminal String
SR60: Recording file path
*********************************************************** * /
#include funp_datetimetostring // Current date transformation into a continuous string series
#define success 0 // Subflow successfully completed
#define Exception 1 // Submerged exception
Trace ON
Function Funp_RecordVoice
{
Begin:
Evtstart [0]
Sassign (SR13, _field1)
Sassign (SR10, _CALLINGNUMBER)
Readstrfromini (_iniFileName, "Path.LeaveWord", SR60)
Readstrfromini (_iniFileName, "Path.System", SR11)
-> StPlaytipVoice
StPlaytipVoice:
Sassign (SR12, SR11)
SADD (SR12, "15.vox")
Playfile (SR12, "?")
Evtreturn [0] -> StGenerateFileName
Evtreturn [3] -> StgenerateFileName
Evtreturn [-1] -> StRecordfailure
STGENERATEFILENAME: / / Generate recording file name
FUNP_DATETIMETOSTRING ()
Evtreturn [-1]
Sassign (SR50, _field1)
-> StStartRecord
StStartRecord: // Start recording
Sassign (SR20, SR60)
SADD (SR20, SR50)
SADD (SR20, "_")
SADD (SR20, SR10)
SADD (SR20, "To")
SADD (SR20, SR13)
SADD (SR20, ". VOX")
Sassign (SR14, SR20)
Recordvoice (SR14, -1, "?")
Evtreturn [0] -> StPlaySureRecordvoice
Evtreturn [6] -> StRecordfailureevtreTurn [7] -> StrecordFailure
Evtreturn [-1] -> StRecordfailure
StPlaySureRecordVoice:
ClearmiXtone ()
Sassign (SR12, SR11)
SADD (SR12, "16_1.vox")
AddFileMixtone (SR12)
AddFileMixtone (SR14)
PlayMixtone ("?", 1)
Evtreturn [0] -> StPLAYOKORAGAIN
Evtreturn [3] -> StPlayOkoragain
Evtreturn [-1] -> StRecordfailure
STPLAYOKORAGAIN: // Play Determine Recording or Recording
Sassign (SR12, SR11)
SADD (SR12, "16_2.vox")
Playfile (SR12, "?")
Evtreturn [0] -> stgetsuredigit
Evtreturn [3] -> stgetsuredigit
Evtreturn [-1] -> StRecordfailure
StgetsuredIgit: // Get button
GetDigits (1, 10, "")
Evtreturn [0] -> StChecksuredIgitButton
Evtreturn [4] -> StPLAYOKORAGAIN
Evtreturn [-1] -> StRecordfailure
StchecksuredIgitButton:
Checkpushedbutton ()
Evtreturn [1]
Sassign (_field1, sr14)
IASSIGN (_Result, SUCCESS)
-> END
Evtreturn [2] -> stdeleterecordvox
Evtreturn [-1] -> StPlayOkoragain
StdeleteRecordvox: // Detecting the file exists
Accessfile (SR14)
Evtreturn [0] -> stdeleterecordvoxreal
Evtreturn [-1]
Sassign (_field1, "")
IASSIGN (_Result, Exception)
-> END
StdeleteRecordvoxReal: // Delete file
REMOVEFILE (SR14)
Evtreturn [0] -> StPlaytipVoice
Evtreturn [-1] -> StRecordfailure
STRECORDFAILURE: // User recording error
Sassign (SR12, SR11)
SADD (SR12, "Syb.vox")
Playfile (SR12, "?")
Evtreturn [0] -> strecordfileisexist
Evtreturn [-1]
Sassign (_field1, "")
IASSIGN (_Result, Exception)
-> END
STRECORDFILEISEXIST: // After the recording fails, the recording file exists.
Accessfile (SR14)
Evtreturn [0] -> StremoveRecordfile
Evtreturn [-1]
Sassign (_field1, "")
IASSIGN (_Result, Exception)
-> END
STREMOVERECORDFILE: / / Delete recording files
REMOVEFILE (SR14)
Evtreturn [-1] Sassign (_field1, "")
IASSIGN (_Result, Exception)
-> END