VoiceGuide IVR Software Main Page
Jump to content

Connect Database

Recommended Posts

Hi VoiceGuide Team,

 

Can i connect VoiceGuide to SQL Server Management Studio ?

Thank you for your support.

 

Thao Huynh

Share this post


Link to post

I have created a simple script to connect database. I also created a PhoneBookDB database in SQL 2012.

And when i use SJPhone call VoiceGuide system, it display "Decline to talk". But if i run Credit Card Payment.vgs (not using Query DB), it still worked.

I attached my config.xml, srcipt and WireShark capture. Please check attached files.

Config.zip

Share this post


Link to post

Please .ZIP up and post the ktTel and vgEnigne traces from VoiceGuide's \log\ subdirectory. ,we cna then see what is happening on the call and advise.

 

Are you running an Evaluation version of VoiceGuide ? Was the VoiceGuide service restarted immediately before placing the inbound calls?

 

You should exit all VoiceGuide apps, then stop the VoiceGuide service, wait about 10 seconds after the VoiceGuide service has stopped and then start the VoiceGuide service.

 

Once the VoiceGuide service is started you can then place the call.

Share this post


Link to post

Please check your config.xml

 

vgEngine trace shows "not answering as no script attached to line" :

095036.007  22   3   1 ev    CallState GCEV_OFFERED, crn=8000001, iEvent=0 ,2,0,8, s1:192.168.76.37|, s2:192.168.76.21, s3:]. build_date: 27-Feb-17 12:59:25.18
095036.008   9   3   1 state <offered> : cid=192.168.76.37 , dnis=192.168.76.21
095036.008   9   3   1 note  not answering as no script attached to line
095036.012  22   3   1 ev    CallState GCEV_DROPCALL, crn=8000001, iEvent=0 ,1,0,32, s1:, s2:, s3:]. build_date: 27-Feb-17 12:59:25.18

in last trace: 0405_0949_vgEngine.txt

 

the script entry was set to:

 

C:\Users\Admin\AppData\Local\VirtualStore\Program Files (x86)\VoiceGuide\Scripts\Credit Card Payment\Credit Card Payment.vgs

094932.094   6               ReadXmlInto_zConfigXml_Channels read in: dxxxB1C1| iptB1T1 C:\Users\Admin\AppData\Local\VirtualStore\Program Files (x86)\VoiceGuide\Scripts\Credit Card Payment\Credit Card Payment.vgs allowDialout=1

which resulted in:

094934.940   9   1   0       OpenChanels could not load script [C:\Users\Admin\AppData\Local\VirtualStore\Program Files (x86)\VoiceGuide\Scripts\Credit Card Payment\Credit Card Payment.vgs]

after correcting your Config.xml and setting it to an existing .vgs file please restart the VoiceGuide service.

 

Config.xml settings are read in during VoiceGuide service startup.

 

 

 

vgEngine trace also shows:

094938.082  14               Db_Open GetFactory call [System.Data.SqlClient]
094938.082  14               Db_Open sDbName=[PhoneBookDB]
094938.082  14               Db_Open CreateConnection call
094938.082  14               Db_Open CreateConnection returned. conn=System.Data.SqlClient.SqlConnection, this=ktlib.vgDb.vgDb_ProviderInvariant
094938.083  14               Db_Open sConnString in.len=87, rvreplaced.len=87
094938.083  14               Db_Open conn.Open call
094938.083  14         ERROR Db_Open conn.Open, ex: Login failed for user 'sa'.
094938.083  14         WARN  Db_Open failed. Cannot read outbound dialer database.

Share this post


Link to post

I have modified Config.xml. So SJPhone can call to VoiceGuide system, but i can't hear correct .wav file. And after that, voiceguide hang up automatically.

Why i failed login for user 'sa' while i can connect SQL server for user 'sa'?

 

post-22785-0-42340800-1491364929_thumb.png

log.zip

Share this post


Link to post

The scripts start module is set to be "Get HomeNum", which is a database query module.

 

That module runs a query:

 

Select HomeNum from PhoneNum where MobileNum = '$RV[say MobileNum]'

 

which does not return any rows, and the script then moves to module "Hang up" :

105111.237  25   3   1       dbcompleted. iRowsAffected=0
105111.240  25   3   1       FindNextVgmTitleInPathList: next module title is=[Hang up]

Most likely what you probably want to do is to set the script's starting module to be a different module.

 

The starting module can be set in the VoiceGuide Script Editor, using the Edit -> Script Properties menu.

Share this post


Link to post

The database connection made from module "Get HomeNum" was successful, while the Dialer database connection specified in the Config.xml file was not.

 

If both connections are to the same database then would recommend comparing the Connection Strings used.

 

The current script seems to be more for incoming calls, so perhaps it may be OK to leave the Dialer database config that is specified in Config.xml at the default setting for now (?)

Share this post


Link to post

My config.xml

 

<OutDialQue_ADODB_Provider>System.Data.SqlClient</OutDialQue_ADODB_Provider>
<OutDialQue_Database>PhoneBookDB</OutDialQue_Database>
<OutDialQue_ConnectString>Data Source=CLTMACHINE1\SQLEXPRESS2012;Database=PhoneBookDB;User ID=sa;Password=******;</OutDialQue_ConnectString>
<OutDialQue_PortToUse_LinkField></OutDialQue_PortToUse_LinkField>
<OutDialQue_SqlPrefix></OutDialQue_SqlPrefix>
<OutDialQue_SqlSuffix></OutDialQue_SqlSuffix>
In Query DB:
Data Source=CLTMACHINE1\SQLEXPRESS2012;Initial Catalog=PhoneBookDB;User ID=sa;Password=******;

Share this post


Link to post

Have you tried using "Initial Catalog=" instead of "Database=" in the Config.xml connection string?

Share this post


Link to post
I also can't hear .wav in my script, and can't enter the number.

 

Please post vgEngine trace capturing the latest call.

Share this post


Link to post

Trace shows that module "Get HomeNum" is still the starting module for the script C:\Program Files (x86)\VoiceGuide\Scripts\Credit Card Payment\demo.vgs :

115537.431  22   3   1 ev    CallState GCEV_ANSWERED, crn=8000001, iEvent=0 ,256,1,4, s1:, s2:, s3:]. build_date: 27-Feb-17 12:59:25.18
115537.433   9   3   1 state <offered> : cid=192.168.76.37 , dnis=192.168.76.21 connected
115537.483   9   3   1       RunModule start Database Query, [Get HomeNum], iModuleIdx=1, previous: vgm=0, vgs=1:0
115537.483   9   3   1 state [Get HomeNum] DB Query
                             Select HomeNum from PhoneNum where MobileNum = '$RV[Say MobileNum]'

Please open the script C:\Program Files (x86)\VoiceGuide\Scripts\Credit Card Payment\demo.vgs in the VoiceGuide Script Editor, and then use the Edit -> Script Properties menu to set the starting module for the script and save the script after making the selection.

 

Then place a call into the system again.

 

No need to restart the VoiceGuide service. The saved script will be used for all new calls handled by the system.

Share this post


Link to post

I have edited script properties and saved the script. I set the starting module is "Enter your MobileNum", but trace shows that module "Get HomeNum" is still the starting module for the script.

Share this post


Link to post

Recommend re-confirming that the right script was edited...

 

Try this a test: change the name of module "Get HomeNum" to something else. Does the new module name appear in vgEngine trace at next call?

Share this post


Link to post

I change the name of module, and also restart DCM, and VoiceGuide system. But it still appear old module name.

Share this post


Link to post

Sounds like you are editing the wrong script. But you can try restarting the VoiceGuide service after making the change if you'd like to be sure. (No need to restart DCM)

 

Have you used the filename from the Config.xml file when opening the script for editing?

 

The vgEngine trace will also show you the filename of the script that was loaded.

Share this post


Link to post

It's my fault. I not exit Script Designer before start VoiceGuide system.

Share this post


Link to post

Saving the script file should be sufficient. Once script file is saved all new calls handled by the system will use the the new script version.

Share this post


Link to post

Select HomeNum from PhoneNum where MobileNum = '1234'

 

creates these Result Variables ($RVs) when it returns:

 

151834.477 25 3 1 rv add Get HomeNum_HomeNum|455
151834.477 25 3 1 rv add Get HomeNum_1|455
151834.478 25 3 1 rv add Get HomeNum_HomeNum_1|455
151834.478 25 3 1 rv add Get HomeNum_1_1|455
151834.478 25 3 1 rv add Get HomeNum_RowCount|1

 

Please try using these $RVs in the 'Say Number' module:

 

$RV[Get HomeNum_HomeNum]

 

or

 

$RV[Get HomeNum_1]

 

or

 

$RV[Get HomeNum_HomeNum_1]

 

or

 

$RV[Get HomeNum_1_1]

 

 

Please see http://www.voiceguide.com/vghelp/source/html/moddbquery.htm for more information on $RVs created by Database Query module

Share this post


Link to post

It worked for me when i use $RV[Get HomeNum_1].

After 'Say Number' module, i want to write result to file use VBS. But i can't.

I nerver used VBScript before. I base "Credit Card Payment" script on.

 

Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 5
set fso = CreateObject("Scripting.FileSystemObject")
set tsFile = fso.OpenTextFile("c:\output1.txt", ForAppending, True)
tsFile.WriteLine FormatNumber(Timer, 2) & ": $RV_STARTTIME, $RV_CIDNUMBER, $RV_CIDNAME, $RV_DNIS, $RV[Get HomeNum_1]"
tsFile.Close
set tsFile = Nothing
set fso = Nothing

Share this post


Link to post

Your "ForAppending" constant is set wrong.

 

And best not to write file to root "C:\", you will get a 'Permission Denied' error on many systems.

 

 

So change:

 

Const ForAppending = 5

 

to:

 

Const ForAppending = 8

 

and change

 

set tsFile = fso.OpenTextFile("c:\output1.txt", ForAppending, True)

 

to use another directory, eg:

 

set tsFile = fso.OpenTextFile("c:\MyNewDir\output1.txt", ForAppending, True)

 

and you probabaly want to change the

 

tsFile.WriteLine FormatNumber(Timer, 2) & ....

 

to be:

 

tsFile.WriteLine Now & ....

 

 

 

You can save the VBScript into a file (.vbs suffix) and just run it by double clicking it. That's a good way to debug your VBScripts.

Share this post


Link to post

In module "Say HomeNum" change the number or "replays" from 2 to 0. This will ensure that module "Say HomeNum" will only play the message once.

 

Then add this path to module "Say HomeNum" :

 

 

on {timeout 0} goto [Write to file]

 

 

you can just copy and paste the above path into the Paths text box in module's "Say HomeNum" Paths tab.

 

The "Timeout 0" path will be taken as soon as the sound files in module "Say HomeNum" complete playing.

 

Oh, and as you are playing a sound file to caller while running that module, change the Wait type option in module "Write to file" to be: "Wait until VBScript and Sound File completes".

 

 

You might want to add this to the end of the VBScript:

 

set vg = CreateObject("vgServices.CommandLink")
vg.Run_ResultReturn $RV_LINEID, "Success"
set vg = Nothing

 

 

This way the Success path will be taken from the "Write to file" module.

 

So the complete script in that VBScript module would be:

Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 8
set fso = CreateObject("Scripting.FileSystemObject")
set tsFile = fso.OpenTextFile("c:\MyNewDir\output1.txt", ForAppending, True)
tsFile.WriteLine Now & ": $RV_STARTTIME, $RV_CIDNUMBER, $RV_CIDNAME, $RV_DNIS, $RV[Get HomeNum_1]"
tsFile.Close
set tsFile = Nothing
set fso = Nothing
set vg = CreateObject("vgServices.CommandLink")
vg.Run_ResultReturn $RV_LINEID, "Success"
set vg = Nothing

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
×