VoiceGuide IVR Software Main Page
Jump to content

Vg7 - Unable To Retrieve Campaignname

Recommended Posts

Hi team,

Currently my objective is to run a query to retrieve the CampaignName, then play a .wav file, once done playing the .wav file then, my VG script is to update the MS SQL db.

 

The problem I am facing this time is that the very first query seems to be failing, and the call is hanged up without playing the .wav file. For the query module I am using the same connection string I use in the config.xml (I am confident that the connection string is good), I am running a simple select statement to get the CampaignName based on the called phone number match, as follows:

 

SELECT top (1) CampaignName FROM CallQue WHERE PhoneNumber = '$RV_CALLEDNUMBER' order by ID Desc

 

During the dial process I can see the number called is listed on the CallQue table before the call is answered, I enable the script property to "start the script without ansewring the call...", in order to retrieve the CampaingName value, but it seems that the query fails. I tested the my query directly against the MS SQL table and it works as well, I ran the following query while the outbound call is ringing and it does provides me with the CampaingName:

 

SELECT top (1) CampaignName FROM CallQue WHERE PhoneNumber = '7874782634' order by ID Desc

 

The only difference between the above queries is that on the top query I rely on the value found in '$RV_CALLEDNUMBER' and on the later I am providing the phone number, so I suspect that the query failure is caused by '$RV_CALLEDNUMBER' being null (?).

 

Questions:

Is the result variable $RV_CALLEDNUMBER filled after the call is completed/hanged up?

Which result variable would you recommend to use in order to extract the number being called, while the phone number is dialed and before the call is answered?

 

logs attached for your review, I also attach the vgs script used for this test.

 

Regards,

-r

Log.zip

Share this post


Link to post
so I suspect that the query failure is caused by '$RV_CALLEDNUMBER' being null (?).

vgEngine trace shows that VoiceGuide is correctly replacing $RV_CALLEDNUMBER with 7874782634 before issuing the SQL.

 

Note that VoiceGuide deletes call from CallQue table when call is answered at 140739.796, and script is started over 2 seconds later at 140742.062 after the answering machine welcome message finishes. This is why the SQL query you are trying does not succeed.

 

Best approach here may be to just save Campaign name as RV at the time when the call is loaded into the DB. The Campaign name will then be immediately available to script as $RV without the script needing to do any SQL queries to retrieve it.

 

As a general guide the CallQue table is owned by VoiceGuide and should be used by external systems a means on inputting data only. VoiceGuide makes it's own decision on how long it chooses to keep data in this table, so other scripts should not longer use this table after call is inserted. If you need to store some call related information in DB then store it in another table and save some sort of call identifier in the RV section and then use that identifier to retrieve information from other tables.

 

The "start the script without answering the call..." setting applies to incoming calls only.

 

 

Trace shows:

 

140725.468 10 dial FindCallQueryCompleted some calls found (any lineid search), ID/GUID=78/00000000-0000-0000-0000-000000000000, sTaskTimestamp=140725.468, diff=00:00:00

140725.484 10 1 state Dialing 7874782634

140726.031 18 1 ev Dialogic 135,TDX_SETHOOK, crn=20000001, 0,0,0,DX_OFFHOOK,CALL_OUTBOUND,

140726.046 18 1 ev Dialogic 134,TDX_CST, crn=20000001, 65535,0,0,DE_LCON,,

140739.796 18 1 ev Dialogic 133,TDX_CALLP, crn=20000001, 10,4,0,TDX_CALLP,CR_CNCT,CON_PAMD

 

140739.796 6 1 dial OnOutboundCallAnswered begin [Answered_Machine]

140739.796 6 1 dial OnOutboundCallAnswered queue task to delete ID=78

 

140739.796 6 1 state Machine Answer. Wait for end of welcome message...

140742.062 6 1 state Run Answer Machine script [C:\Program Files\VoiceGuide\Scripts\VocalicoUserJobs\12524AnsMach.vgs]

 

140742.093 6 1 state [GetJobId] DB Query

140742.093 6 1 rv replace start: [sELECT top (1) CampaignName FROM CallQue WHERE PhoneNumber = '$RV_CALLEDNUMBER' order by ID Desc]

140742.093 6 1 rv replace end: [sELECT top (1) CampaignName FROM CallQue WHERE PhoneNumber = '7874782634' order by ID Desc]

 

140742.109 3 1 oVgmDbQuery_AdoNetCommon_Completed SqlQueryType=READER, RowsCount=0

140742.125 3 1 FindNextVgmTitleInPathList: next module title is=[Hangup the Call]

Share this post


Link to post
As a general guide the CallQue table is owned by VoiceGuide and should be used by external systems a means on inputting data only. VoiceGuide makes it's own decision on how long it chooses to keep data in this table, so other scripts should not longer use this table after call is inserted. If you need to store some call related information in DB then store it in another table and save some sort of call identifier in the RV section and then use that identifier to retrieve information from other tables.

 

During my earlier test I noticed that the CallQue table is flushed with frequency, knowing that before hand my plan was never to store my data in the CallQue table, my solution has its own set of tables, but I need to retrieve the value CampaignName field for further look ups - which I understand know it can not be done with my current implementation.

 

I noticed that the CdrOut table also replicates the data I need for my look ups, under the fields Acccount and Src, but I also noticed that the CdrOut table is updated later in the call cycle (after the call is hanged up), I would like your input on whether the option found in the script properties called, "Script to run when the call is finished", is this applicable for outbound calls as well? if yes, then I could also separate my script so that all of the SQL look up and updates are on its own vgs file - what do you think about this alternative? is it viable?

 

Best approach here may be to just save Campaign name as RV at the time when the call is loaded into the DB. The Campaign name will then be immediately available to script as $RV without the script needing to do any SQL queries to retrieve it.

 

Sound like a good approach. In the online help, I see an option called RvSet, but I am not sure if this is what you referred too. Could you please point me to a sample (document or script) where I can see the implementation you recommended? more specifically referencing and saving the CampaignName value into an $RV while the call is loaded so that the value can referenced later in my script.

 

Thanks in advanced.

-r

 

 

 

 

 

 

 

 

Share this post


Link to post
option found in the script properties called, "Script to run when the call is finished", is this applicable for outbound calls as well?

No. It applies on inbound calls only.

 

I see an option called RvSet, but I am not sure if this is what you referred too

No. RvSet function is something else.

 

 

This is what you should do:

 

In the CallQue table there is a column named RV. In that field write a string like this:

 

[MyData]{valueStored}[anotherMyData]{something else}

 

then in your script you will be able to use

 

$RV[MyData]

 

which will be replaced with:

 

valueStored

 

(the RV field is of course also accessible when loading calls using the Telephone Number Loader or when using the XML data file etc., not just when loading data rows direct into DB)

Share this post


Link to post

I implemented the changes, following your clear instructions you provided to the letter...to summit, everything works like a champ! its awesome to see it come together...

 

I keep pushing the envelop with my project, I must admit that Voiceguide is FANTASTIC product! with an EXCELLENT Support team.

 

I am very close to release this project to production thanks to your help, once again Thank You for efforts!

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
×