VoiceGuide IVR Software Main Page
Jump to content

Get Called Number, $rv_dnis Won't Work

Recommended Posts

Here's my script:

 

on error resume next

Dim sNumber,sName,sScriptName,sDivisionNumber

set vg = CreateObject("VoiceGuide.CommandLink")

 

sNumber=trim("$RV_DNIS")

sname=trim(ucase("$RV_CIDNAME"))

sScriptName=""

sDivisionNumber=""

 

Set cn = CreateObject("ADODB.Connection")

cn.Open "Data Source=XXXXXXX;User Id=XXXX;Password=XXXXXXXX"

 

squery="INSERT INTO callLog (MainPhone) VALUES (" & sNumber & ")"

 

cn.execute sQuery

cn.close

 

But for some reason it's dying.

 

Any ideas?

Share this post


Link to post

Could you please post a copy of VoiceGuide's Debug Trace which captures the call, this will allow us to see what happened.

Share this post


Link to post

It's been a while since I've had to deal with this, and I can't remember how to check the debug trace. How do I do that?

Share this post


Link to post

Which version of VoiceGuide are you using?

 

In v7 the traces are just created in VoiceGuide's \log\ subdirectory.

 

In this case we would need to see the vgEngine trace.

 

Please .ZIP up the traces before posting them.

Share this post


Link to post

Looks like the version that you are using is about 3 years old. Hard to see in traces from this old version what the ran script actually contains.

 

Are you sure its the $RV_DNIS that is the problem? Or is it perhaps something else?

 

What do you mean by "it's dying"? no data is inserted into the database? or you see some other errors?

 

The script that you quote has this line:

 

set vg = CreateObject("VoiceGuide.CommandLink")

 

but no further calls to the created VoiceGuide.CommandLink object. Perhaps you are meaning to call the Run_ResultReturn function but this was not included in the script?

 

 

Also to do a simple insert into the database you can just use a 'Database Query' type module, instead of a VBScript module.

Share this post


Link to post

Here's the script where I'm having trouble.

 

on error resume next
Dim sNumber, sNumber2,sName,sScriptName,sDivisionNumber
set vg = CreateObject("VoiceGuide.CommandLink")

sNumber=trim("$RV_CIDNUMBER")
sNumber2=""
sname=trim(ucase("$RV_CIDNAME"))
sScriptName=""
sDivisionNumber=""

on error resume next
Set cn = CreateObject("ADODB.Connection")
cn.Open "Data Source=$$$$$$;User Id=root;Password=*******"
set rs = CreateObject("ADODB.Recordset")
rs.open "Select * from Divisions where MainPhone='" & sNumber & "' AND ScriptName<>''", cn, adOpenStatic
if rs.eof then
  rs.close
else
  'get ScriptName
  sScriptName=trim(rs.Fields("ScriptName").Value)
  sDivisionNumber=trim(rs.Fields("Division").Value)
  rs.close
End if

vg.Admin_TraceLogAdd 0, 10, "XScript: " & sScriptname
vg.Admin_TraceLogAdd 0, 10, "XDivision: " & sDivisionNumber

set cn=nothing

if sScriptName<>"" and sDivisionNumber<>"" then
     vg.Script_Goto $RV_LINEID, "G:\Program Files\VoiceGuide\Scripts\" & sScriptName,"","[Division]{" & sDivisionNumber & "}[Tripid]{0}"
else
'      vg.Run_ResultReturn $RV_LINEID, "success"
end if

set vg = Nothing
err.clear

 

It's supposed to check the number being called against our database to see which script to forward to. As I was testing it I added a part that just wrote the variable sNumber to a database so I could check what it was, and it was storing the number I was calling from instead of the number I called.

Share this post


Link to post

Suggest that you add more Run_ResultReturn calls to the script, and you will then be able to trace the scripts progress using the entries in the vgEngine log file. You will then see on what line of the VBScript there is a problem.

 

Modify the script something like this:

 

on error resume next
Dim sNumber, sNumber2,sName,sScriptName,sDivisionNumber
set vg = CreateObject("VoiceGuide.CommandLink")


vg.Admin_TraceLogAdd $RV_LINEID, 0, "MyTrace_1"


sNumber=trim("$RV_CIDNUMBER")
sNumber2=""
sname=trim(ucase("$RV_CIDNAME"))
sScriptName=""
sDivisionNumber=""


vg.Admin_TraceLogAdd $RV_LINEID, 0, "MyTrace_2"

on error resume next
Set cn = CreateObject("ADODB.Connection")

vg.Admin_TraceLogAdd $RV_LINEID, 0, "MyTrace_3"

cn.Open "Data Source=$$$$$$;User Id=root;Password=*******"

vg.Admin_TraceLogAdd $RV_LINEID, 0, "MyTrace_4"

set rs = CreateObject("ADODB.Recordset")


vg.Admin_TraceLogAdd $RV_LINEID, 0, "MyTrace_5"

rs.open "Select * from Divisions where MainPhone='" & sNumber & "' AND ScriptName<>''", cn, adOpenStatic


vg.Admin_TraceLogAdd $RV_LINEID, 0, "MyTrace_6"

if rs.eof then
  vg.Admin_TraceLogAdd $RV_LINEID, 0, "MyTrace_7"
  rs.close
else
  'get ScriptName

  vg.Admin_TraceLogAdd $RV_LINEID, 0, "MyTrace_8"

  sScriptName=trim(rs.Fields("ScriptName").Value)

  vg.Admin_TraceLogAdd $RV_LINEID, 0, "MyTrace_9"

  sDivisionNumber=trim(rs.Fields("Division").Value)

  vg.Admin_TraceLogAdd $RV_LINEID, 0, "MyTrace_10"

  rs.close
End if

vg.Admin_TraceLogAdd 0, 10, "XScript: " & sScriptname
vg.Admin_TraceLogAdd 0, 10, "XDivision: " & sDivisionNumber

set cn=nothing

if sScriptName<>"" and sDivisionNumber<>"" then
     vg.Admin_TraceLogAdd $RV_LINEID, 0, "MyTrace_11"

     vg.Script_Goto $RV_LINEID, "G:\Program Files\VoiceGuide\Scripts\" & sScriptName,"","[Division]{" & sDivisionNumber & "}[Tripid]{0}"
else
      vg.Admin_TraceLogAdd $RV_LINEID, 0, "MyTrace_12"

'      vg.Run_ResultReturn $RV_LINEID, "success"
end if

  vg.Admin_TraceLogAdd $RV_LINEID, 0, "MyTrace_13"

set vg = Nothing
err.clear

Share this post


Link to post

I tried making your changes. Still doesn't work.

 

And now it won't let me attach the script logs. At first the file was bigger than 2MB, so I was breaking it up into smaller chunks, but it still won't let me. I'll try again later.

Share this post


Link to post
And now it won't let me attach the script logs. At first the file was bigger than 2MB,

Please .ZIP up the vgEngine trace before posting.

 

Ifthere are no MyTrace_* entries in the vgEngine trace then please also post the script that you are using.

Share this post


Link to post

I see the MyTrace's in there, so I see that it's going to those parts of the script, but I still don't understand why my sNumber variable is getting the number called from instead of the number that was called.

 

on error resume next
Dim sNumber, sNumber2,sName,sScriptName,sDivisionNumber
set vg = CreateObject("VoiceGuide.CommandLink")


vg.Admin_TraceLogAdd $RV_LINEID, 0, "MyTrace_1"


sNumber=trim("$RV_CIDNUMBER")
sNumber2=""
sname=trim(ucase("$RV_CIDNAME"))
sScriptName=""
sDivisionNumber=""


 Set cn = CreateObject("ADODB.Connection")
 cn.Open "Data Source=$$$$$$$;User Id=root;Password=**********"

 squery="INSERT INTO cr_CallLog (cId, LogInName, MainPhone, SpeakText, CallTime, CalledTime, CalledDate, Response, Duration) VALUES (1123, 'MattSwain', " & sNumber & " " & sNumber2 & ", '', 1048,1048,20110418,'',30)"

  cn.execute sQuery
  cn.close


vg.Admin_TraceLogAdd $RV_LINEID, 0, "MyTrace_2"

on error resume next
Set cn = CreateObject("ADODB.Connection")

vg.Admin_TraceLogAdd $RV_LINEID, 0, "MyTrace_3"

cn.Open "Data Source=$$$$$$;User Id=root;Password=********"

vg.Admin_TraceLogAdd $RV_LINEID, 0, "MyTrace_4"

set rs = CreateObject("ADODB.Recordset")


vg.Admin_TraceLogAdd $RV_LINEID, 0, "MyTrace_5"

rs.open "Select * from Divisions where MainPhone='" & sNumber & "' AND ScriptName<>''", cn, adOpenStatic


vg.Admin_TraceLogAdd $RV_LINEID, 0, "MyTrace_6"

if rs.eof then
  vg.Admin_TraceLogAdd $RV_LINEID, 0, "MyTrace_7"
  rs.close
else
  'get ScriptName

  vg.Admin_TraceLogAdd $RV_LINEID, 0, "MyTrace_8"

  sScriptName=trim(rs.Fields("ScriptName").Value)

  vg.Admin_TraceLogAdd $RV_LINEID, 0, "MyTrace_9"

  sDivisionNumber=trim(rs.Fields("Division").Value)

  vg.Admin_TraceLogAdd $RV_LINEID, 0, "MyTrace_10"

  rs.close
End if

vg.Admin_TraceLogAdd 0, 10, "XScript: " & sScriptname
vg.Admin_TraceLogAdd 0, 10, "XDivision: " & sDivisionNumber

set cn=nothing

if sScriptName<>"" and sDivisionNumber<>"" then
     vg.Admin_TraceLogAdd $RV_LINEID, 0, "MyTrace_11"

     vg.Script_Goto $RV_LINEID, "G:\Program Files\VoiceGuide\Scripts\" & sScriptName,"","[Division]{" & sDivisionNumber & "}[Tripid]{0}"
else
      vg.Admin_TraceLogAdd $RV_LINEID, 0, "MyTrace_12"

'      vg.Run_ResultReturn $RV_LINEID, "success"
end if

  vg.Admin_TraceLogAdd $RV_LINEID, 0, "MyTrace_13"

set vg = Nothing
err.clear

0421_1421_vgEngine.zip

Share this post


Link to post

OK, so the actual problem that you have is:

my sNumber variable is getting the number called from instead of the number that was called.

 

In the VBSCript you have:

 

sNumber=trim("$RV_CIDNUMBER")

 

$RV_CIDNUMBER stores the CallerID number. CallerID number is the caller's number.

If you want to use the called number instead then use $RV[DNIS]

 

 

Looking in the vgEngine trace you can see what values are stored in the Result Variables

 

[$RV_CIDNUMBER]{4082078326}

[$RV_DNIS]{5531300}

[DNIS]{5531300}

 

 

142129.359 13 4 rvns: [PathSysVoice]{G:\Program Files\VoiceGuide\system\voice\}[PathApp]{G:\Program Files\VoiceGuide\}[PathDataVm]{G:\Program Files\VoiceGuide\data\}[PathVgSys]{G:\Program Files\VoiceGuide\system\}[scriptPath]{G:\Program Files\VoiceGuide\Scripts\MVDriverLine\}[scriptsPath]{G:\Program Files\VoiceGuide\Scripts\MVDriverLine\}[$RV_STARTTIME]{2011-04-21 14:21:09}[$RV_DEVICEID]{4}[DlgcVoice]{dxxxB1C1}[DlgcNetwork]{dtiB1T1}[$RV_CIDNAME]{}[$RV_DNIS]{5531300}[DNIS]{5531300}[PathApp]{G:\Program Files\VoiceGuide\}[scriptsPath]{G:\Program Files\VoiceGuide\Scripts\MVDriverLine\}[$RV_CIDNUMBER]{4082078326}[GetDivision]{130}[GetDivision_PathTaken]{success}[server]{1}[sendEmail]{0}[EmailAddress]{}[FirstTime]{YES}[WorkingHour]{21}[WorkingDate]{04212011}[WorkingDateN]{20110421}[WorkingDateV]{04212011}[EmailAddress]{miriam.pereira@mvtransit.com,jose.toledo@mvtransit.com,elizet.castillo@mvtransit.com,bashir.baluch@mvtransit.com,scheduleryounger@mvtransit.com}[sendEmail]{1}[searchSchedules_ResultReturn]{success}[MainGreeting]{616357}[MainGreeting_PathTaken]{success}[savedData]{N}[startTime]{1345}[RunNumber]{M,Y,V,T,T,4,}[FirstName]{EMILIO}[LastName]{BABARAN}[searchTime_ResultReturn]{success}

 

 

 

 

NB. vgEngine trace confirms that script itself is running fine:

 

143307.526 27 4 comlg MyTrace_1

143307.542 27 4 comlg MyTrace_2

143307.542 27 4 comlg MyTrace_3

143307.542 27 4 comlg MyTrace_4

143307.542 27 4 comlg MyTrace_5

143307.542 27 4 comlg MyTrace_6

143307.542 27 4 comlg MyTrace_7

143307.542 27 0 comlg XScript:

143307.542 27 0 comlg XDivision:

143307.542 27 4 comlg MyTrace_12

143307.542 27 4 comlg MyTrace_13

143308.354 22 4 timer fired EV_TIMEOUT_CHECKONSTATE

143308.354 22 4 tqScr enq cmd_ScriptEventCode

143308.354 6 4 tqScr run cmd_ScriptEventCode EV_TIMEOUT_CHECKONSTATE, iActionID=0, crn=0[0|0|0|0|0][|||||]

143308.354 6 4 ScriptEvent EV_TIMEOUT_CHECKONSTATE ||

143308.354 6 4 LsRunWaitTillFinished EV_TIMEOUT_CHECKONSTATE lCode2Str=EV_TIMEOUT_CHECKONSTATE

143308.354 6 4 Process.HasExited is true (System.Diagnostics.Process (wscript))

143308.354 6 4 task completed. vgm=116, iRunWait=2, iRunWait_ExeResult_NextVgm=0=[]

143308.354 6 4 ExeResult_NextVgm has not been set. check for Result file.

143308.354 6 4 no result file returned from program (VGRUNRESULT_4.TXT).

143308.354 6 4 FindNextVgmTitleInPathList: next module title is=[GetDivision]

143308.354 6 4 task completed LsRunWaitChooseNext iNextVgm=145

143308.354 6 4 t clear (force=False)

143308.354 6 4 RunModule start [Get Numbers,[GetDivision],145]

143308.354 6 4 state [GetDivision] Number Input

Share this post


Link to post

Okay. It must have got changed to CIDNUMBER at some point, but DNIS isn't working right either. It always returns the same number, 5531300, no matter what number is dialed. I tried it myself with two different numbers that go into this script, neither of which is 5531300, and they both gave that as the result.

0425_ktTts.zip

Share this post


Link to post
It always returns the same number, 5531300, no matter what number is dialed. I tried it myself with two different numbers that go into this script, neither of which is 5531300, and they both gave that as the result.

The Telco that provides the T1 ISDN trunk sets the DNIS on the calls that arrive into your system.

You should speak to them about how they set the DNIS that is being set on the incoming calls.

Sounds like they are now sending to you the main telephone number associated with the trunk (to which all other calls are being routed to) instead of the number originally dialed by caller.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×