Jump to content


< Back to Forum


 

Cscript Vs Wscript


  • Please log in to reply

#1 iTime 22 March 2016 - 09:50 AM

 
Hello VG Support,
 
 
We have been using "WScript" for our scripts and are now trying to use Clear Script by changing the following lines in VG.INI:

 

 

 
[moduleRunScript]
UseSafeSubset=False
Engine=WScript
SaveToFile=True
 
----> 
 
[moduleRunScript]
UseSafeSubset=False
Engine=ClearScriptV8
SaveToFile=True
 
 
 
 
 
But once the setting is changed (and the service is restarted), our script would not run, playing "The call cannot completed...." error prompt.
Please see attached log: same configurations of same call in, except for the "RunScript Engine" setting.
It looks like VG cannot find that "success" is returned after "CheckTaskType" VBScript runs if "Cscript" is used.
 
Please advise. Thank you. 
 


#2 SupportTeam 22 March 2016 - 02:08 PM

Suggest adding some Admin_TraceLogAdd calls in the VBScript to allow you to trace what is happening in the script.

 

http://www.voiceguid...tracelogadd.htm

 

The WScript version is setting the $RV[TTSSpeed] to a value of 0 :

162606.097  24   3   1 rem   RvSet TTSSpeed, 0
162606.097  24   3   1       rv    add   TTSSpeed|0

but the ClearScript ran trace shows the $RV[TTSSpeed] is not set to any value:

162404.488  24   3   1 rem   RvSet TTSSpeed, 
162404.488  24   3   1       rv    add   TTSSpeed|

So looks like something went wrong in the script earlier, and maybe the same reason is causing the final Run_ResultReturn to not be called.

 

 

 

BTW. ClearScript and CScript are different ways of running VBScripts. CScript is not ClearScript.

 

 

WScript trace:

162604.723   9   3   1 task  runscr Run_VBS vgm=47, file=, engine=[WScript]
162604.723   9   3   1       runscr strIni_moduleRunScript_Engine=WScript
162604.723   9   3   1 state [CheckTaskType] RunScript vbs, onhold=
162604.731   9   3   1       rv    replace start (strlen>500)
162604.735   9               rv    dbg   rv_retrieve did not find [UserID]
162604.736   9               rv    dbg   rv_retrieve did not find [AutoNotifyCallID]
162604.736   9               rv    dbg   rv_retrieve did not find [AutoNotifyMoveNotificationCallID]
162604.736   9               rv    dbg   rv_retrieve did not find [IsHiring]
162604.736   9               rv    dbg   rv_retrieve did not find [IsBroadcasting]
162604.736   9   3   1       saving script strIni_moduleRunScript_SaveToFile=True
162604.737   9   3   1       delete existing: C:\Program Files (x86)\VoiceGuide\temp\vbs_3_1.vbs
162604.740  21   3   1 ev    CallState GCEV_ACCEPT, crn=8000001, iEvent=0 ,4,1,1, s1:, s2:, s3:]. build_date: 09-Mar-16 14:04:48.37
162604.740  21   3   1       q_scr +     evCallState 0 GCEV_ACCEPT
162604.740   6   3   1       q_scr run   evCallState sCode=[GCEV_ACCEPT] iActionID=0, crn=8000001 [4|1|1|0|0][|||||] 00:00:00 max:1|00:00:00
162604.740   6   3   1       callstate crn_event=8000001 0|GCEV_ACCEPT state=4|Accepted calldirection=1 gcCallState=1 [||], ScriptState=LS_RUN_WAITTILLFINISHED
162604.740   6   3   1       GCEV_ACCEPT and iIni_SIP_OnInviteSendTryingAndRinging=0
162604.740   6   3   1       LineEvCallState L1_current=Offered crn_event=8000001,ev=0,GCEV_ACCEPT,1, sParam1=
162604.741   6   3   1       LineEvCallState LINECALLSTATE_ACCEPTED begin
162604.760   9   3   1       script written to (overwriting previous): C:\Program Files (x86)\VoiceGuide\temp\vbs_3_1.vbs
162604.760   9   3   1       runscr waiting. wait=1
162604.761   9   3   1       moh file not specified
162604.762   9   3   1       runscr call Run_VBS_UsingExternalInterpreter
162604.764   9   3   1       runscr start - Run_VBS_UsingExternalInterpreter C:\Program Files (x86)\VoiceGuide\temp\vbs_3_1.vbs
162604.764   9   3   1       runscr on_hold_file=, iModuleIdx=47
162604.765   9   3   1       RunVbsFromFile_UseShellExecute [C:\Program Files (x86)\VoiceGuide\temp\vbs_3_1.vbs][] timeout=30 (vbsPath=C:\Program Files (x86)\VoiceGuide\temp), start (new Process)
162604.766   9   3   1       objProcess.Start call
162604.840   9   3   1       objProcess.Start returned. handle=5628, id=5044, hash=41291151, starttime=3/21/2016 4:26:04 PM, HasExited=False
162604.840   9   3   1       runscr objVbsOrExeProcess started [C:\Program Files (x86)\VoiceGuide\temp\vbs_3_1.vbs], handle=5628, id=5044
162604.862   9   3   1       runscr objVbsOrExeProcess.WorkingSet=2535424
162604.862   9   3   1       Run Script waiting. iRunWait=1 (process_handle=5628, id=5044)
162604.862   9   3   1 t     timer set   1 sec : EV_TIMEOUT_CHECKONSTATE
162604.862   9   3   1       runscr Run_VBS_UsingExternalInterpreter returned
162605.650  23   3   1 timer EV_TIMEOUT_CHECKONSTATE
162605.650  23   3   1       q_scr +     evScriptEvent 9007 EV_TIMEOUT_CHECKONSTATE
162605.650   6   3   1       q_scr run   evScriptEvent sCode=[EV_TIMEOUT_CHECKONSTATE] iActionID=0, crn=0 [0|0|0|0|0][|||||] 00:00:00 max:1|00:00:00
162605.650   6   3   1       se    EV_TIMEOUT_CHECKONSTATE 9007  0|0|0  || LineState=LS_RUN_WAITTILLFINISHED
162605.658   6   3   1       LsRunWaitTillFinished EV_TIMEOUT_CHECKONSTATE lCode2Str=EV_TIMEOUT_CHECKONSTATE
162605.678   6   3   1       IsProcessRunning current objVbsOrExeProcess (vbsrun) : id=5044, handle=5628, hash=41291151, hasExited=False, startTime=3/21/2016 4:26:04 PM, exitTime=notretrieved
162605.678   6   3   1       IsProcessRunning Process.HasExited is false (awaiting process end or COM function call) handle=5628, id=5044, StartTime=3/21/2016 4:26:04 PM
162605.678   6   3   1       .ExitTime returned error.
162605.678   6   3   1       LsRunWaitTillFinished: process still running
162605.678   6   3   1 t     timer set   1 sec : EV_TIMEOUT_CHECKONSTATE
162606.084  24         rem   remoting link constructor activated: vgServices_CommandLink
162606.088  24   3   1 rem   RvSet IsMoveAutoNotify, false
162606.089  24   3   1       rv    add   IsMoveAutoNotify|false
162606.097  24   3   1 rem   RvSet TTSSpeed, 0
162606.097  24   3   1       rv    add   TTSSpeed|0
162606.099  24   3   1 rem   Run_ResultReturn [Success] 7
162606.099  24   3   1       q_scr +     cmdRun_ResultReturn 0 
162606.099   6   3   1       q_scr run   cmdRun_ResultReturn sCode=[] iActionID=0, crn=0 [0|0|0|0|0][Success|||||] 00:00:00 max:1|00:00:00
162606.102   6   3   1       rv    add   CheckTaskType_ResultReturn|Success
162606.103   6   3   1       path {Success} found (at offset 3)
162606.107   6   3   1       FindNextVgmTitleInPathList: next module title is=[IsHiringRequested]

ClearScript trace:

162404.386  23   3   1 task  runscr Run_VBS vgm=47, file=, engine=[ClearScriptV8]
162404.386  23   3   1       runscr strIni_moduleRunScript_Engine=ClearScriptV8
162404.386  23   3   1 state [CheckTaskType] RunScript vbs, onhold=
162404.394  23   3   1       rv    replace start (strlen>500)
162404.399  23               rv    dbg   rv_retrieve did not find [UserID]
162404.399  23               rv    dbg   rv_retrieve did not find [AutoNotifyCallID]
162404.399  23               rv    dbg   rv_retrieve did not find [AutoNotifyMoveNotificationCallID]
162404.399  23               rv    dbg   rv_retrieve did not find [IsHiring]
162404.399  23               rv    dbg   rv_retrieve did not find [IsBroadcasting]
162404.412  23   3   1       saving script strIni_moduleRunScript_SaveToFile=True
162404.441  23   3   1       script written to (new file): C:\Program Files (x86)\VoiceGuide\temp\vbs_3_1.vbs
162404.441  23   3   1       runscr waiting. wait=1
162404.442  23   3   1       moh file not specified
162404.442  23   3   1       runscr call ClearScript Execute
162404.442  23   3   1       runscr new VBScriptEngine call
162404.466  23   3   1       runscr .Execute call
162404.483  24         rem   remoting link constructor activated: vgServices_CommandLink
162404.485  24   3   1 rem   RvSet IsMoveAutoNotify, false
162404.486  24   3   1       rv    add   IsMoveAutoNotify|false
162404.488  24   3   1 rem   RvSet TTSSpeed, 
162404.488  24   3   1       rv    add   TTSSpeed|
162404.488  23   3   1       engineVbs dispose call
162404.490  23   3   1       runscr sModuleType=Run VB Script
162404.490  23   3   1       runscr .Execute returned. iRunWait=1
162404.490  23   3   1       runscr RunWait_1 script completed
162404.490  23   3   1       runscr sModuleClearScriptProcessWasCalledFrom is current module CheckTaskType, clearing setting (.iRunWait=1)
162404.490  23   3   1       runscr RunWait_1 taking fail path as script completed and no next module set
162404.496  23   3   1       HangupCall (RunModule_Script_AfterScriptStarted_2) crn_in=0, L1=Offered, L2=Running_BeforeAnswerCall, lPlayId=0, lRecId=0