kbamonte Report post Posted 06/07/2013 03:11 PM Hello, I am running a COM Object from a VBS Module in voiceguide - if I try to pass any variables to the next module it locks the current module up. VBS Module code : 'Getting the dataDIM strAmout,strFName,strLNameDIM strAcctType,strTRN, strAccount, strCheckNo pnumb = "1085668"strID = "xxxxxxx"strPassword = "xxxxxxx"strAcctType = "C"strTRN = "xxxxxxx"strAccount = "xxxxxxxxx"strCNumber = " "strAmount = 1.00strZip = 27777strCHName = "John Smith"strFName = ucase("IVR")strLName = ucase("TRANS")strEMail = " "strPhone = "999-999-9999" TDATE = DATE()TTIME = TIME()TRIPA = "999-999-9999"pname = strFName + " " + strLName 'Formatting the dataDIM strData 'You need to change the merchant ID and password to the ones you are assignedstrData="pg_merchant_id=" & strID & chr(10)strData=strData & "pg_password=" & strPassword & chr(10)strData=strData & "pg_total_amount=" & strAmount & chr(10)strData=strData & "pg_transaction_type=20" & chr(10)strData=strData & "pg_entered_by=" & cstr(pnumb) & chr(10) strData=strData & "ecom_billto_postal_name_first=" & strFName & chr(10)strData=strData & "ecom_billto_postal_name_last=" & strLName & chr(10)strData=strData & "ecom_payment_check_trn=" & strTRN & chr(10)strData=strData & "ecom_payment_check_account=" & strAccount & chr(10)strData=strData & "ecom_payment_check_account_type=" & strAcctType & chr(10)IF strCNumber>"" THEN strData=strData & "ecom_payment_check_checkno=" & strCheckNo & chr(10)END IFstrData=strData & "endofdata" & chr(10) 'Sending the dataDIM objSendPmtDIM strReturn 'Create the objectSet objSendPmt=CreateObject("SendPmt.clsSendPmt") 'Send the data over to our test server and get the response backstrReturn=objSendPmt.SendPayment(strData, "test") 'Parse out the returnCall WriteReturnData(strReturn) 'free memorySET objSendPmt = NOTHING '----------------------------------------------------'Utility functions for parsing out the return data'----------------------------------------------------'This function takes the string name such as "pg_merchant_id=" and parses out'the value of "pg_merchant_id" from the return dataFunction ParseString(strReturn,strName) i=InStr(strReturn,Trim(strName)) IF i > 0 THEN j=InStr(i,strReturn,chr(10)) ParseString=Mid(strReturn,i+Len(strName),j-i-Len(strName)+1) ELSE ParseString="" END IFEnd Function dim ee1, ee2, ee3 'This function writes out the parsed return data in a table formatSub WriteReturnData(strMsg)DIM arrNames(9), arrValues(9) arrNames(0)="Merchant Id" arrNames(1)="Transaction Type" arrNames(2)="Total Amount" arrNames(3)="First Name" arrNames(4)="Last Name" arrNames(5)="Response Type" arrNames(6)="Response Code" arrNames(7)="Response Description" arrNames(8)="Authorization Code" arrNames(9)="Trace Number" arrValues(0)=ParseString(strMsg,"pg_merchant_id=") arrValues(1)=ParseString(strMsg,"pg_transaction_type=") arrValues(2)=ParseString(strMsg,"pg_total_amount=") arrValues(3)=ParseString(strMsg,"ecom_billto_postal_name_first=") arrValues(4)=ParseString(strMsg,"ecom_billto_postal_name_last=") arrValues(5)=ParseString(strMsg,"pg_response_type=") arrValues(6)=ParseString(strMsg,"pg_response_code=") arrValues(7)=ParseString(strMsg,"pg_response_description=") arrValues(8)=ParseString(strMsg,"pg_authorization_code=") arrValues(9)=ParseString(strMsg,"pg_trace_number=") ee1=arrValues(6) ee2=arrValues(7) ee3=arrValues(8) End Sub rcode = 1set vg = CreateObject("vbServices.CommandLink")vg.RvSet $RV_LINEID, "RCODE", rcodeset vg = Nothing 'always deallocate after use... If I take out the last three lines and just have it go to another module it continues on fine .... Any help is apprecaited - it was working fine in version 6 but when we migrated to version 7 the script now has this problem. Kevin Share this post Link to post
SupportTeam Report post Posted 06/07/2013 10:07 PM Is the problem because of a typo? set vg = CreateObject("vbServices.CommandLink") should be: set vg = CreateObject("vgServices.CommandLink") Also, the module should not 'lock up' just because the ran script does not work (due to error/crash/etc). The module itself would time out and the VoiceGuide script would move onto another module along the timeout path (if timeout path is defined) Share this post Link to post
kbamonte Report post Posted 06/10/2013 12:24 PM thansk for your response, the typo was my fault when I copied the code into the forum message, it is correct in the script i guess I used a poor choice of wording as it doesn't "lock up" it will eventually timeout but it clearly does not pass the variables to the next module i did get around the issue by saving the variables to a database and then retrieving them in the next module - so not sure why voice guide is behaving like this Share this post Link to post
SupportTeam Report post Posted 06/10/2013 12:48 PM have you tried changing: vg.RvSet $RV_LINEID, "RCODE", rcode to: vg.RvSet $RV_LINEID, "RCODE", "1" and see if that results in RvSet being ran? have you tried running the created .vbs file directly and see if any error messages get displayed? Share this post Link to post
kbamonte Report post Posted 06/10/2013 06:03 PM yes - I did try putting a value in for the code and it still did not pass the variable I also tried taking the vbscript out and then it worked fine I think it is a problem with the comm object I am creating conflicting with voiceguide - have you ever run into anything like this before? Share this post Link to post
SupportTeam Report post Posted 06/10/2013 08:52 PM I think it is a problem with the comm object I am creating conflicting with voiceguide - have you ever run into anything like this before? can you modify the VBScript to call set vg = CreateObject("vgServices.CommandLink") at the beginning of the script and then use Admin_TraceLogAdd calls throughout the script to determine which parts of the script are executed OK and on which line the VBScript hangs. Admin_TraceLogAdd adds entries to the vgEngine trace log. Please see: http://www.voiceguide.com/vghelp/source/html/com_admin_tracelogadd.htm Share this post Link to post