VoiceChange news Content of documentation User documentation Administrator documentation Index of terms Technical Support Search on-line

Introduction into VoiceChange programming

If the basic functionality of VoiceChange as a phone answering machine is not sufficient, it is necessary to proceed to adjustment of scripts or writing the new ones. This document is designed to provide you guidance through the VoiceChange script programming.

Table of contents


Specifics of VoiceChange VBS Scripting

Most VoiceChange libraries have been written in Visual Basic Script (referred as VBS in next text) in form of scriplets (.WSC files). They are registered like standard COM objects which are used in user script. User script is very simple Thanks to COM.

Libraries are attached to the user code by the following line
 
Dim VXScript : Set VXScript = CreateObject("VXScripting.VXScript") : Execute VXScript.InitCode
 

This line must be ALWAYS included in your script - it can be located anywhere OUTSIDE of user functions. By default it is located at the end of script.

back to top


Basic structure of VoiceChange script

User script has to implement four basic functions:


OnInit user function

OnInit function is called when the system is initialized. It is intended e.g. for initializing the database connection or similar action.

OnInit function need not implement any activity. The entire VoiceChange initialization took place prior to the function call.


OnRing user function

OnRing function is called upon incoming call. When calling, the phone is still hanged up; it is the task of this function either to answer the phone and attend the call, or perform any other activity – e.g. divert the call by using TAPI services.

If the OnRing function returns without attending the call, it will be called out again upon next ring.


OnIddle user function

OnIddle function is called when there is no activity (i.e. there is no incoming call or any other task). It need not perform any activity, but it can perform an outgoing call.

OnShutdown user function

OnShutdown function is called upon completion of the script activity. It is intended e.g. for closing the database connections. It need not perform any activity.

back to top


Available tools

User script has many functions and classes of VoiceChange VBS libraries available. For complete documentation click here.

There is the possibility to call directly the functions of VoiceChange core from the user script by means of VoiceChange COM objects. But this is not recommended and the functionality in next versions of VoiceChange is not guaranteed. For the documentation for COM objects click here.

back to top


Directory structure

Directory structure of VoiceChange from the scripting point of view is as follows:

back to top


Multilingual support

VoiceChange has been designed for easy use in multilingual environment. All WAV files should be in language specific directories:

common/wav/cze/ - Czech
common/wav/eng/ - English

etc. When playing WAVs in script, VoiceChange selects the right WAV according to the setting of VXScript.Locale property. If the WAV is not available in the language required, the default language directory will be used (created during installation, saved in common.ini file).

Language-depending activities (playing the date, number of messages) have been separated into language modules in VoiceChange/_vbs_language/ directory. When implementing a new language, it is necessary to add these functions for it.

back to top