Guest Ben Harper Report post Posted 02/25/2005 08:28 AM I am setting up a 1900 system, I need to test the script as I go but I dont want to dial in repetatively via the 1900 number ($$$) and the standard 10 digit block of numbers that tesltra routes the 1900's here on are protected so they cannot be dialed. I am using this VBS script in a module to replace the $RV[DNIS] with what would appear on a call coming in thriugh the 1900 system. set resultreturn = createobject("VoiceGuide.CommandLink") resultreturn.Run_ResultReturn $RV_LINEID, "[DNIS]{89761936}" resultreturn.Run_ResultReturn $RV_LINEID, "success" set ResultReturn = nothing And it works great, for the rest of the call, when i reference $RV[DNIS] I get 89761936. And I can process a call as if I was on a real 1900 call No probs. But when I later, use the following code to run a paramaterised stored procedure (query) in an access database and try at the end to return the variables into voice guide, I get empty variables. The only difference is that this time I am attempting to use a Variable name and not a string value. You will notice PrID and Status are variables not strings. ************************* Dim cnn 'As ADODB.Connection Dim cmd 'As New ADODB.Command Dim rst 'As New ADODB.Recordset Dim InDNo 'InDialNo Dim PrID 'promo no Returned From DB Dim Status 'Promo Status Returned From DB Dim InDNoString 'String to hold entire number pre right function InDNoString = $RV[DNIS] const myDb = "\\Dat.mdb" InDNo = right(InDNoString,3) msgbox InDNo Set cnn = CreateObject("ADODB.Connection") Set cmd = CreateObject("ADODB.Command") Set rst = CreateObject("ADODB.Recordset") cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="& myDb 'MsgBox "dbState: " & cnn.State With cmd .ActiveConnection = cnn .CommandText = "qryPromoIDandStatus" 'name of parameter qry Set rst = .Execute(, InDNo, 4) '4 == adCmdStoredProc If rst.BOF And rst.EOF Then 'no records found PrID = 0 Status = 0 Else PrID = rst(0) 'PromoID Status =rst(1) 'status end if rst.Close End With cnn.Close Set cmd = Nothing Set rst = Nothing Set cnn = Nothing 'assign to Voice Guide global variables for subsequent use set resultreturn = createobject("VoiceGuide.CommandLink") resultreturn.Run_ResultReturn $RV_LINEID, "[PRID]{PrID}[PRStatus]{Status}" resultreturn.Run_ResultReturn $RV_LINEID, "success" set ResultReturn = nothing ************************* It returns empty values to voice guide, I would expect to at least have the strings "PrID" and "Status" returned even though i wanted their values (not their declared names as strings). But when I make reference to these new variables I get empty string values. For example msgbox "PromoID : " & $RV[PRID] & " .. status: " & $RV[PRStatus] returns me "promoid: ..status:" No values? So Is there error in my return code? or something else I cannot see? Thanks In Advance Thanks Share this post Link to post
SupportTeam Report post Posted 02/25/2005 06:29 PM Could you please post a copy of VoiceGuide's Debug Printout which captures the call and the running of the VBScript, this will allow us to see what is going on. When running the script click on VoiceGuide's View menu and select 'Event Trace Log' option - any log information will then appear in this window. You must open the trace window before making the call. You can enable the automatic saving of the logs to files in \log\ directory as well. Share this post Link to post
Guest Ben Harper (ben@tacticsmarketin Report post Posted 02/25/2005 10:33 PM Thanks, VoiceGuide's Debug Printout. 092024.60 81 event callstate OFFERING 81 0 0 092024.60 81 script interpretor: VgMulti v6.0.1043 092024.60 81 init LineState ResetAtStartOfNewCall. 092024.60 81 dont answer yet, wait for CallerID information. 092024.60 81 tw ring 1 092024.60 81 ring time since last ring (ms): 0 092024.62 81 rv clear all 092024.62 81 init LineState ResetAtStartOfNewCall. 092024.62 81 answer the call 092024.62 81 timer clear 092024.62 81 tw DialogicEvent 134,TDX_CST,0,0,0,DE_RINGS,ET_RON, 092024.62 81 event code=134 scode=TDX_CST state=6001 092025.16 81 event callstate CONNECTED 81 0 0 092025.16 81 WorkingModes tapi= script= 092025.16 81 Inband detection not enabled 092025.16 81 StartLoadedVgs at 26/02/2005 9:20:25 AM 092025.16 81 WARN rv ScriptsPath could not be set as LineState(iLineId).iVgsIdx = 0 in StartLoadedVgs_InitLineState 092025.16 81 set sScriptToRunOnHangup=[] in StartLoadedVgs 092025.16 81 rv add [$RV_STARTTIME]{26/02/2005 9:20:25 AM} 092025.18 81 rv add [$RV_DEVICEID]{81} 092025.18 81 rv add [$RV_CIDNAME]{} 092025.18 81 rvns add [PathApp]{C:\Program Files\VoiceGuide\} 092025.18 81 rvns add [scriptsPath]{C:\Program Files\VoiceGuide\Scripts\1900 Scripts\} 092025.20 81 rv add [$RV_CIDNUMBER]{} 092025.20 81 tw DialogicEvent 135,TDX_SETHOOK,0,0,0,DX_OFFHOOK,CALL_INBOUND, 092025.20 81 event code=135 scode=TDX_SETHOOK state=6001 092025.20 81 tw DialogicEvent 134,TDX_CST,65535,0,0,DE_LCON,, 092025.21 81 event code=134 scode=TDX_CST state=6001 092025.21 81 timer clear 092025.21 81 state [EvalNumberCalled] Evaluate [$RV[DNIS]] 092025.21 81 rv replace start: [$RV[DNIS]] 092025.23 81 rvns [PathSysVoice]{C:\Program Files\VoiceGuide\system\voice\}[PathApp]{C:\Program Files\VoiceGuide\}[PathDataVm]{C:\Program Files\VoiceGuide\data\}[PathVgSys]{C:\Program Files\VoiceGuide\system\}[$RV_STARTTIME]{26/02/2005 9:20:25 AM}[$RV_DEVICEID]{81}[$RV_CIDNAME]{}[PathApp]{C:\Program Files\VoiceGuide\}[scriptsPath]{C:\Program Files\VoiceGuide\Scripts\1900 Scripts\}[$RV_CIDNUMBER]{} 092025.23 81 rv replace end: [] 092025.23 81 eval[] 092025.23 81 rvns add [EvalNumberCalled_Input]{} 092025.24 81 rvns add [EvalNumberCalled]{} 092025.24 81 rvns add [Number Called]{} 092025.24 81 Eval Expr result:[] stored in $RV[Number Called] 092025.24 81 path {} not found 092025.26 81 timer clear 092025.26 81 state [Replace NDIS For Internal Testing] Running VB Script... 092025.26 81 rv replace start: [set resultreturn = createobject("VoiceGuide.CommandLink") resultreturn.Run_ResultReturn $RV_LINEID, "[DNIS]{897619366}" resultreturn.Run_ResultReturn $RV_LINEID, "success" set ResultReturn = nothing ] 092025.26 81 rvns [PathSysVoice]{C:\Program Files\VoiceGuide\system\voice\}[PathApp]{C:\Program Files\VoiceGuide\}[PathDataVm]{C:\Program Files\VoiceGuide\data\}[PathVgSys]{C:\Program Files\VoiceGuide\system\}[$RV_STARTTIME]{26/02/2005 9:20:25 AM}[$RV_DEVICEID]{81}[$RV_CIDNAME]{}[PathApp]{C:\Program Files\VoiceGuide\}[scriptsPath]{C:\Program Files\VoiceGuide\Scripts\1900 Scripts\}[$RV_CIDNUMBER]{}[EvalNumberCalled_Input]{}[EvalNumberCalled]{}[Number Called]{} 092025.27 81 copy of script ran: vbs_81_1.vbs 092025.29 81 Run Script waiting. iRunWait=1 (shellid=2228, process=5676) 092025.29 81 timer set 1 EV_TIMEOUT_CHECKONSTATE 092025.30 81 cl Run_ResultReturn >>[DNIS]{897619366}<< 092025.30 81 rvns add [DNIS]{897619366} 092025.30 81 cl module's runwait=1, WavPlayHasNowFinished=0 092025.32 81 timer clear 092025.32 81 state [VerifyInternalDnis] Running VB Script... 092025.32 81 rv replace start: ['msgbox $RV[DNIS] ] 092025.32 81 rvns [PathSysVoice]{C:\Program Files\VoiceGuide\system\voice\}[PathApp]{C:\Program Files\VoiceGuide\}[PathDataVm]{C:\Program Files\VoiceGuide\data\}[PathVgSys]{C:\Program Files\VoiceGuide\system\}[$RV_STARTTIME]{26/02/2005 9:20:25 AM}[$RV_DEVICEID]{81}[$RV_CIDNAME]{}[PathApp]{C:\Program Files\VoiceGuide\}[scriptsPath]{C:\Program Files\VoiceGuide\Scripts\1900 Scripts\}[$RV_CIDNUMBER]{}[EvalNumberCalled_Input]{}[EvalNumberCalled]{}[Number Called]{}[DNIS]{897619366} 092025.34 81 rv replace end: ['msgbox 897619366 ] 092025.34 81 copy of script ran: vbs_81_2.vbs 092025.35 81 Run Script waiting. iRunWait=1 (shellid=2296, process=4880) 092025.35 81 timer set 1 EV_TIMEOUT_CHECKONSTATE 092025.35 81 cl Run_ResultReturn >>success<< 092025.37 81 rv add [VerifyInternalDnis_ResultReturn]{success} 092025.37 81 cl module's runwait=1, WavPlayHasNowFinished=0 092025.37 81 timer clear 092025.37 81 state [QRYID&Status] Running VB Script... 092025.38 81 rv replace start (strlen>500) 092025.38 81 rvns [PathSysVoice]{C:\Program Files\VoiceGuide\system\voice\}[PathApp]{C:\Program Files\VoiceGuide\}[PathDataVm]{C:\Program Files\VoiceGuide\data\}[PathVgSys]{C:\Program Files\VoiceGuide\system\}[$RV_STARTTIME]{26/02/2005 9:20:25 AM}[$RV_DEVICEID]{81}[$RV_CIDNAME]{}[PathApp]{C:\Program Files\VoiceGuide\}[scriptsPath]{C:\Program Files\VoiceGuide\Scripts\1900 Scripts\}[$RV_CIDNUMBER]{}[EvalNumberCalled_Input]{}[EvalNumberCalled]{}[Number Called]{}[DNIS]{897619366}[VerifyInternalDnis_ResultReturn]{success} 092025.38 81 copy of script ran: vbs_81_3.vbs 092025.40 81 Run Script waiting. iRunWait=1 (shellid=2284, process=5052) 092025.40 81 timer set 1 EV_TIMEOUT_CHECKONSTATE 092025.60 81 cl Run_ResultReturn >>[PRStatus]{Status}<< 092025.60 81 rvns add [PRStatus]{Status} 092025.60 81 cl module's runwait=1, WavPlayHasNowFinished=0 092025.60 81 timer clear 092025.60 81 state [MsbBoxResult] Running VB Script... 092025.62 81 rv replace start: [Msgbox "PromoID : .. status: " & $RV[PRStatus] ] 092025.62 81 rvns [PathSysVoice]{C:\Program Files\VoiceGuide\system\voice\}[PathApp]{C:\Program Files\VoiceGuide\}[PathDataVm]{C:\Program Files\VoiceGuide\data\}[PathVgSys]{C:\Program Files\VoiceGuide\system\}[$RV_STARTTIME]{26/02/2005 9:20:25 AM}[$RV_DEVICEID]{81}[$RV_CIDNAME]{}[PathApp]{C:\Program Files\VoiceGuide\}[scriptsPath]{C:\Program Files\VoiceGuide\Scripts\1900 Scripts\}[$RV_CIDNUMBER]{}[EvalNumberCalled_Input]{}[EvalNumberCalled]{}[Number Called]{}[DNIS]{897619366}[VerifyInternalDnis_ResultReturn]{success}[PRStatus]{S atus} 092025.62 81 rv replace end: [Msgbox "PromoID : .. status: " & Status ] 092025.63 81 copy of script ran: vbs_81_4.vbs 092025.65 81 Run Script waiting. iRunWait=1 (shellid=2256, process=5540) 092025.65 81 timer set 1 EV_TIMEOUT_CHECKONSTATE 092026.68 81 timer fired EV_TIMEOUT_CHECKONSTATE 092026.68 81 event code=9007 scode=EV_TIMEOUT_CHECKONSTATE state=1501 092026.68 81 LsRunWaitTillFinished EV_TIMEOUT_CHECKONSTATE 092026.68 81 task completed (shellid=2256, process=5540) vgm=2, iRunWait=1, iRunWait_ExeResult_NextVgm=0 092026.70 81 no result file returned from program (VGRUNRESULT_81.TXT or SHLRESLT.TXT) 092026.70 81 rv add [Hangup Time]{26/02/2005 9:20:26 AM} 092026.70 81 state Hanging up call... [WaitTillFinished - next module not specified] 092026.70 81 HangupCall_Common hCall=81 092026.71 81 rec RecSoundStop ok 092026.71 81 play PlaySoundStop ok 092026.71 81 timer set 2 EV_TIMEOUT_WAITFORIDLEAFTERLINEDROP 092026.71 81 fnHangupCall end 092027.20 81 event callstate IDLE 81 0 0 092027.20 81 WorkingMode@Idle= 092027.21 81 timer clear 092027.21 81 rec RecSoundStop ok 092027.21 81 play PlaySoundStop ok 092027.21 81 rv add [CallEndTime]{26/02/2005 9:20:27 AM} 092027.23 81 timer set 1 EV_TIMEOUT_TIMETOREINITLINE 092027.23 81 tw DialogicEvent 135,TDX_SETHOOK,0,0,0,DX_ONHOOK,, 092027.23 81 event code=135 scode=TDX_SETHOOK state=900 092027.23 81 LsAwaitingCalls EV_UNKNOWN_135 092028.24 81 timer fired EV_TIMEOUT_TIMETOREINITLINE 092028.24 81 event code=9008 scode=EV_TIMEOUT_TIMETOREINITLINE state=900 092028.24 81 init atidle reinit : start 092028.24 81 init atidle reinit : reset all LineState variables 092028.24 81 timer set 0.3 EV_TIMEOUT_ATERIDLE_ALLOWOUT 092028.26 81 state Waiting for a call... 092028.59 81 timer fired EV_TIMEOUT_ATERIDLE_ALLOWOUT 092028.59 81 event code=9013 scode=EV_TIMEOUT_ATERIDLE_ALLOWOUT state=900 Share this post Link to post
SupportTeam Report post Posted 02/25/2005 11:22 PM Looks like the $RV[PRStatus] is properly replaced, You can see that Msgbox "PromoID : .. status: " & $RV[PRStatus] had the RV properly replaced to become: Msgbox "PromoID : .. status: " & Status The problem is that after replacing the RV the resultant expression is invalid VBScript syntax. If you want the RV to be treated as a string in VBScript then you should put quotes around it. Change your current expression: Msgbox "PromoID : .. status: " & $RV[PRStatus] to Msgbox "PromoID : .. status: " & "$RV[PRStatus]" or to: Msgbox "PromoID : .. status: $RV[PRStatus]" Similarly, change msgbox "PromoID : " & $RV[PRID] & " .. status: " & $RV[PRStatus] to msgbox "PromoID : " & "$RV[PRID]" & " .. status: " & "$RV[PRStatus]" or to msgbox "PromoID : $RV[PRID] .. status: $RV[PRStatus]" Share this post Link to post
Guest Ben Harper Report post Posted 02/25/2005 11:48 PM I worked out my problem, resultreturn.Run_ResultReturn $RV_LINEID, "[PRID]{PrID}[PRStatus]{Status}" should have been resultreturn.Run_ResultReturn $RV_LINEID, "[PRID]{" & PrID & "}[PRStatus]{" & Status & "}" Which is quite obvious to me know, and while the only reason I didnt come to the conclusion last night is because it was a friday, I think it would be a good note to mention in the result return com help section on your next release. Thanks for your followups, Regards Ben Share this post Link to post