VoiceGuide IVR Software Main Page
Jump to content

Create Dynamically Sound File Name

Recommended Posts

I want to create audio files dynamically based on the query results. Database Query module as follows:

SELECT time_ref FROM restourant WHERE restourant_code=$RV[GET RESTOURANT CODE] and reservation_status=0 and min_pax<=$RV[GET RESERVATION COUNT] and max_pax>=$RV[GET RESERVATION COUNT]

Query results (time_ref variable) can be between 1 and 7. Query may return multiple data. Play Module will change according the query results. Of course, I do not know the number of records returned.

For example;

Only one record return, time_ref variable = "3", sound file to play = "\time_3.wav"

Two record return, time_ref variable = "4" and "5", sound file to play = "\time_4.wav,\time_5.wav"

four record return, time_ref variable = "1","3","6" and "7", sound file to play = "\time_1.wav,\time_3.wav,\time_6.wav,\time_7.wav"

 

Please help me. Is it possible to make in Evaluate Expression module?

 

I've got another question. Can I use "group by" function in Database Query Module?

Thank you.

Share this post


Link to post

The following Result Variable can be used to access the number of database entries which were returned:

 

$RV[ModuleTitle_RowCount]

 

The results of the database query are accessible using Result Variables. The following Result Variables can be used to access data retrieved by a Db Query module:

$RV[ModuleTitle_ColumnIndex_RowIndex]

If more then one item was requested in the query, the Column Index can be used to access the individual items in each retrieved row.

eg: module LookupTelFax uses a query: SELECT Tel, Fax FROM Customer WHERE CustId='$RV[Get CustId]'
We can use $RV[LookupTelFax_1_1] to access the contents of the Tel column, and use $RV[LookupTelFax_2_1] to access he contents of the Fax column for customer 1.
$RV[LookupTelFax_1_2] can be used to access the contents of the Tel column for customer 2, etc.

 

More information can be found here: http://www.voiceguide.com/vghelp/source/html/moddbquery.htm

 

 

Approach would be to either set up a loop that adds new .WAV files to the string to be played, or just have separate Play modules with a different number of WAV entries depending on what is the value of the _RowCout variable

 

 

 

You should be able to use "group by" function in Database Query Module. The SQL expression is passed to the database, so if database supports it then it should be fine.

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
×