Hermes API Voice Applications Generator (Version 1.02) Hermes API Hermes API VOICE APPLICATIONS GENERATOR Click on the underlined word or words • PRINCIPLE of OPERATION • SCRIPT • MACRO-COMMANDS AND COMMANDS • COMMENTS • LABELS • LOCAL VARIABLES o Definition of a variable o Value of a variable • INDEXED VARIABLES • GLOBAL VARIABLES • SYSTEM VARIABLES • CONSTANTS • INCLUDES • PSEUDO-COMMANDS • COMPILATION OF A SCRIPT • COMMANDS o APP_STOP_POSSIBLE o APP_STOP_IMPOSSIBLE o CALL V_CALL o CHR o COMPUTER_NAME o CONFIG_PARAM o DATE o DATE_ADD o DATE_DIFF o DATE_PART Hermès API english version 1.02.doc page 2/113 Date of issue: 30/07/99 Hermes API o DATE_SQL o DATE_TIME o DISK_FREE o DISPLAY_EVT o DISPLAY_GEN o DISPLAY_USER o DISPLAY_PANEL o DISPLAY_BLUE o DISPLAY_GREEN o DISPLAY_RED o DOS o EXT_OPTION_I o FILE_ ...LINE_... o FILE_APPEND o FILE_AT_END_WRITE o FILE_AT_END_REPLACE o FILE_DATE_TIME o FILE_DELETE o FILE_ENTRY_BEGIN o FILE_ENTRY_CREATE o FILE_ENTRY_END o FILE_ENTRY_NUMBER o FILE_ENTRY_READ o FILE_ENTRY_REMOVE o FILE_ENTRY_SIZE o FILE_ENTRY_START o FILE_ENTRY_WRITE o FILE_INT_NAME o FILE_LAST_VERSION_NAME Hermès API english version 1.02.doc page 3/113 Date of issue: 30/07/99 Hermes API o FILE_LINE_DELETE o FILE_LINE_FIND o FILE_LINE_READ o FILE_LINE_REPLACE o FILE_LINES_APPEND o FILE_LINES_NUMBER o FILE_LINES_SORT o FILE_LIST_FILE o FILE_LIST_FILEW o FILE_MKDIR o FILE_NAME o FILE_NAME_CHANCE o FILE_NAME_TEMP o FILE_NB_LINE_CREATE o FILE_PART_NAME o FILE_TO_LINE_ADD o FILE_RENAME o FILE_RENAMEW o FILE_SIZE o FORMAT o GLOBAL_VAR_LOAD o GLOBAL_VAR_STORE o GLOBAL_VAR_ON_GOTO o GLOBAL_VAR_ON_CALL o GLOBAL_VAR_OFF o GOTO o V_GOTO o INT_TYPE o IS_NUMBER Hermès API english version 1.02.doc page 4/113 Date of issue: 30/07/99 Hermes API o LABEL_VALUE o MULTITASKING_LOCK o MULTITASKING_RELEASE o MAIL_ALLOC o MAIL_FETCH o MAIL_FILE_TO_MSGNOTE o MAIL_FREE o MAIL_MSGNOTE_TO_FILE o MAIL_READ o MAIL_SEND o MAIL_WRITE o NET_IN_ALLOC o NET_IN_LIB o NET_IN_FREE o NET_IN_RLIB_ON_GOTO o NET_IN_RLIB_OFF o NET_IN_WAIT_CALL o NET_IN_ANI o NET_IN_DNIS o NET_IN_DNIS_NB o NET_OUT_ALLOC o NET_OUT_DIAL_CALL o NET_OUT_LIB o NET_OUT_FREE o NET_OUT_RLIB_ON_GOTO o NET_OUT_RLIB_OFF o NET_OUT_TAX o NET_SWITCH_S2 o NETVOICE_IN_ACCEPT Hermès API english version 1.02.doc page 5/113 Date of issue: 30/07/99 Hermes API o NETVOICE_IN_FREE o NETVOICE_OUT_ACCEPT o NETVOICE_OUT_FREE o REG_LOCAL_MACHINE_READ_INT o RETURN o RND o SCK_INIT_CLIENT o SCK_OK_CLIENT o SCK_ON_CALL o SCK_ON_GOTO o SCK_OFF o SCK_READ_CMD o SCK_STOP_CLIENT o SCK_WRITE_CMD o SCRIPT_CALL o SCRIPT_NAME o SCRIPT_IS_INITIAL o SCRIPT_RESET o SCRIPT_RETURN o SHELL o STAT_ADD_CALL o STAT_END_CALL o STAT_ZONE o STR_CMP o STR_INS o STR_LEFT o STR_LEN o STR_L_TRIM o STR_MID Hermès API english version 1.02.doc page 6/113 Date of issue: 30/07/99 Hermes API o STR_R_CHR o STR_RIGHT o STR_R_TRIM o STR_STR o STR_TOK o STR_TRIM o SWITCH_CODEC_NET_IN o SWITCH_CODEC_NET_OUT o SWITCH_NET_IN_CODEC o SWITCH_NET_IN_NET_IN o SWITCH_NET_IN_NET_OUT o SWITCH_NET_IN_VOICE o SWITCH_NET_OUT_CODEC o SWITCH_NET_OUT_NET_IN o SWITCH_NET_OUT_NET_OUT o SWITCH_NET_OUT_VOICE o SWITCH_VOICE_NET_IN o SWITCH_VOICE_NET_OUT o SYSTEM_VAR_LOAD o SYSTEM_VAR_STORE o SYSTEM_VAR_ON_GOTO o SYSTEM_VAR_ON_CALL o SYSTEM_VAR_OFF o TIME o TIME_CENT_START o TIME_CENT_FROM o TIMER_DEF_INIT o TIMER_DEF_SYNC o TIMER_VAR_INIT Hermès API english version 1.02.doc page 7/113 Date of issue: 30/07/99 Hermes API o UDP_INIT o UDP_ON_CALL o UDP_READ_CMD o UDP_STOP o UDP_WRITE_CMD o USER_NUMBER o USER_VAR_ON_GOTO o USER_VAR_ON_CALL o USER_VAR_OFF o USER_VAR_LOAD o USER_VAR_STORE o VAL o VAR_LOAD o VAR_ON_GOTO o VAR_ON_CALL o VAR_OFF o VAR_STORE o VBASE_ALLOC o VBASE_ALLOC_NOT_EMPTY o VBASE_ADD_NEW o VBASE_ADD_WRITE o VBASE_DELETE o VBASE_EDIT o VBASE_EXECUTE o VBASE_FIND_FIRST o VBASE_FIND_LAST o VBASE_FIND_NEXT o VBASE_FIND_PREVIOUS o VBASE_FREE Hermès API english version 1.02.doc page 8/113 Date of issue: 30/07/99 Hermes API • o VBASE_MOVE_FIRST o VBASE_MOVE_NEXT o VBASE_MOVE_PREVIOUS o VBASE_MOVE_LAST o VBASE_READ o VBASE_SEEK o VBASE_SELECT_READ o VBASE_UPDATE o VBASE_WRITE o VOICE_ALLOC o VOICE_FREE o VOICE_GET_DTMF o VOICE_NOISE_DETECT o VOICE_PLAY o VOICE_PLAY_BACKGRD o VOICE_PLAY_ENTRY o VOICE_PLAY_ENTRY_LIST o VOICE_PLAY_STOPPED o VOICE_RECORD o VOICE_RECORD_ENTRY o VOICE_SILENCE_DETECT o VOICE_STOP_FUNCTION o VOICE_SYNC o WAIT o WAIT_VAR o WAIT_USER_VAR APPENDICE 1 o instruction set Hermès API english version 1.02.doc page 9/113 Date of issue: 30/07/99 Hermes API PRINCIPLE OF OPERATION THE SCRIPT A script is a small program which makes it possible to describe the sequence of actions to be performed by ONNET32. For example, in call receive mode, a script will make it possible to describe the tree structure which will welcome the caller, ask him to identify himself, etc. A script is composed of a set of commands recognized by ONNET32 and stored on disk in an ASCII text file. The name of this file is composed of a maximum of 8 characters and an ONS extension. Example: INDUST.ONS For the sake of performance, this file is not used as it is by the ONNET32 monitor, but first undergoes processing called compilation. This processing makes it possible to check the syntax, replace the macro-commands and optimize the instruction flow. The macro-commands delivered as standard are defined in the file \onnet\onh160\general.onh. All scripts must therefore start with the following line: #include "\ONNET\ONH160\GENERAL.ONH" MACRO-COMMANDS AND COMMANDS A command is a <<key word>> which triggers a very precise action in the software or in the operating system. A macro-command makes it possible to simplify the writing of the script. Each macro-command is composed of a set of basic commands. A macro-command is always written in upper case, the different words being separated by the character _. Example: NET_IN_WAIT_CALL; In the remainder of this document we shall use the same term "command" for macro-commands and basic commands. The creation of macro-commands is not part of this document and it is not important for the script designer to know the difference. A command may possibly be followed by parameters, which must be enclosed in brackets and separated by commas. Each command is terminated with the character ; Hermès API english version 1.02.doc page 10/113 Date of issue: 30/07/99 Hermes API Example: COMMAND (parameter1,parameter2...); It is possible to put several commands on the same line. Example: COMMAND 1; COMMAND 2; .... NET_IN_WAIT_CALL; NETVOICE_IN_ACCEPT; VOICE_PLAY("c:\appli\hello"); NETVOICE_IN_FREE; A set of commands can be formed using: { and } as follows: {COMMAND 1; COMMAND 2; ....COMMAND n; } COMMENTS A comment starts with // and ends at the end of the line. Example: // start of the script VOICE_PLAY("c:\appli\hello"); // broadcast of the introductory message Comments can also be written over several lines (maximum around 5) and be delimited by a set of /* */ Example: /* start of the script and broadcast of the introductory message */ VOICE_PLAY("hello"); LABELS It is possible to put labels in the script in order to perform jumps or subroutine calls. Label names start with an upper case letter and are composed of the characters: Hermès API english version 1.02.doc page 11/113 Date of issue: 30/07/99 Hermes API a to z and A to Z 0 to 9 A label is placed at the start of a line and is followed by the character : Example: GOTO (SummaryA); .... SummaryA: VOICE_PLAY("enter_1_info_2_weather"); LOCAL VARIABLES The names of variables start with a $ sign, followed by a word formed using the characters: a to z and A to Z (lower and upper case) 0 to 9 Example: $Menu For the sake of readability, the variables will be given names as follows: $, then a series of words whose first letter is in upper case. Example: $AccountNumber $SecretCode $MenuChoice Each telephone line has a context of variables, the number of which is defined at configuration of the software. A variable is either: of 32-bit integer type capable of storing values from +2 thousand million to -2 thousand million, of character type capable of storing from 0 to 255 characters. Definition of a variable They must be declared at the beginning of the script using the #variable instruction. Example: #variable $Choice It is possible to assign a variable to a specific address. In this case, it is necessary to use the #variable instruction followed by a number. Hermès API english version 1.02.doc page 12/113 Date of issue: 30/07/99 Hermes API Example: #variable $Telephone 15 Value of a variable The allocation of values to a variable is performed using the following operators: + for addition - for subtraction * for multiplication / for division % for remainder or modulo & for concatenation (& must be followed by a space character if the concatenation concerns a variable). Example: $State = ($Var1 + 2) / 100; The order of priority of operations must be defined using brackets. In this case, it is possible to exceed the stacking capacities for intermediate results. It will then be necessary to either rewrite the formula to avoid the intermediate results, or write it on several lines, storing the temporary results in variables. Example: $var = ((($var1 + $var2) / ($var3 + $var3)) * ($var4 - $var5)) % 100; It is very rare that complex calculations are performed in a script; it will therefore be sufficient to check that the formula clearly gives the correct result at the time of testing the application to be certain of the result during operation. For special functions: complex calculations, calculations with floating-point numbers, special character string processing, etc., the recommended procedure is through the writing of a WINDOWS DLL. These functions are easy to write, are easily interfaced with the multitasking kernel and provide a high execution speed. For concatenation with a variable, the syntax is as follows: $Result= "Hello " & $Name // note the space after the & In fact, where a function updates one or more parameters, it is necessary to pass, not the value of the variable, but its address. In this case, just precede the variable with the & character followed immediately by the name of the variable (otherwise there is ambiguity with the concatenation). Example: &$Choice Hermès API english version 1.02.doc page 13/113 Date of issue: 30/07/99 Hermes API The passing of parameters by address will not be dealt with in this document since all the macrocommands make it invisible. INDEXED VARIABLES It is sometimes practical to store values in a location depending on another variable. In this case it is necessary to create an indexed variable. An indexed variable is similar to a simple variable (format of the name, operations possible, etc.). The syntax is as follows: $IndexVar[$index] Example: #variable $vote[4] /* 4 represents the dimension of the variable */ $NbVote=1; while ($NbVote<=4) do { VOICE_PLAY("c:\appli\vote_now"); $vote[$NbVote]=0 ; VOICE_GET_DTMF(1,4, $vote[$NbVote]); $NbVote = $NbVote+1; } GLOBAL VARIABLES These variables are grouped together in areas whose number is fixed at system configuration. They are not directly usable in a script; it is necessary to go through instructions such as: GLOBAL_VAR_STORE, GLOBAL_VAR_LOAD... They make it possible to easily share dynamic information between a number of telephone lines (for example stock, the number of operators waiting for calls, etc.). In general, an application which has a requirement for sharing data between its "users" will use a global area (the number of this area will be parameterized with the #constant instruction in order to simplify modifications). SYSTEM VARIABLES These variables are grouped together in a single area. They contain information common to all the telephone lines (for example a request to shut down the system at the end of the communications in progress, etc.). They are not directly usable in a script; it is necessary to go through instructions such as: Hermès API english version 1.02.doc page 14/113 Date of issue: 30/07/99 Hermes API SYSTEM_VAR_STORE, SYSTEM_VAR_LOAD... CONSTANTS It is possible to define a constant using the #constant instruction. Example: #constant VOCALCOM_NUMBER "0155373050" #constant CURRENT_YEAR 1996 INCLUDES #include instructions can be placed at the beginning of the script in order to include files. Example: #include "\onnet\myappli\appli.onh" The standard macro-commands are defined in include files which are included automatically. These standard include files define variables whose name always starts with $Sys (do not use variables whose name starts in this way for script variables). #function instructions make it possible to define a function using basic monitor instructions grouped together between two braces {}. Example: #function DISPLAY_USER(var) {var;DSP;} PSEUDO-COMMANDS Pseudo-commands are control structures which make it possible to nest a command structure to be executed under certain conditions. Here is a list of the reserved words which can be used in the structures: switch case default continue break loop if else Hermès API english version 1.02.doc page 15/113 Date of issue: 30/07/99 Hermes API while () do Reserved words are always in lower case. Example: $Nb=0; while ($Nb<3) do // while $Nb is less than 3 loop { .....; if ($Nb>=3) break; ....} // while $Nb is less than 3 {VOICE_PLAY("Enter_1_INFO_2_WEATHER_3_SPORT_4_SPORTplusINFO _5_SPORTplusINFO ",dtmfnb=1); $Choice=0; VOICE_GET_DTMF(1,300,$Choice); switch($Choice) { default: break; // nothing is broadcast if there is no selection and the switch is exited case 5 : continue; // cases 4 and 5 are identical case 4 : VOICE_PLAY("SPORT"); // the sequence is continued case 1 ; VOICE_PLAY("INFO"); break; // on break, the switch is exited case 2 : VOICE_PLAY("WEATHER"); break; case 3 : VOICE_PLAY("SPORT"); break; } $Nb=$Nb+1; } // this point is reached when $Nb=3 ... The structure of a test is as follows: if (condition) {an instruction or series of instructions} else {an instruction or series of instructions} All the conditions must be grouped together with brackets and the instruction or instructions grouped together with brackets. Certain of these pseudo-commands can use the following relational operators: < for less than > for greater than Hermès API english version 1.02.doc page 16/113 Date of issue: 30/07/99 Hermes API <= for less than or equal to >= for greater than or equal to == for equal to != for different to &&,and for a logical AND ||,or for a logical OR Example: if ($Status!=0) {NETVOICE_IN_FREE;} if ( ($status!=0)and($Day==1) ) GOTO (End); For all inequality type tests: < <= > >= , the comparisons are made numerically; a non-numeric value has the value 0. For all equality type tests: ==, != and case, ONNET32 operates as follows: it is based on the numeric validity of the values to be compared (see IS_NUMBER) if both values are found to be of numeric type, the test is performed numerically, otherwise the string is compared character by character. (1==" +1 ") is true (1==" 1 * ") is false (VAL(1)==VAL(" 1 * ")) is true (STR_CMP(1," 1 * ")==0) is false (1>=" 1 * ") is true For greater readability, write: (1>=VAL(" 1 * ")), since the test is performed numerically. {VOICE_PLAY("Enter_1_INFO_2_WEATHER_3_SPORT_4_SPORTplusINFO _5_SPORTplusINFO ",dtmfnb=1); $Choice="-9"; VOICE_GET_DTMF(1,300,$Choice); switch($Choice) { default: break; // nothing is broadcast if there is no selection and the switch is exited case "*" : VOICE_PLAY("You_HAVE_ENTERED_STAR");break; case "#" : VOICE_PLAY("You_HAVE_ENTERED_SQUARE");break; Hermès API english version 1.02.doc page 17/113 Date of issue: 30/07/99 Hermes API case 5 : continue; // cases 4 and 5 are identical case 4 : VOICE_PLAY("SPORT"); // the sequence is continued case 1 ; VOICE_PLAY("INFO"); break; // on break, the switch is exited case 2 : VOICE_PLAY("WEATHER");break; case 3 : VOICE_PLAY("SPORT");break; } COMPILATION OF A SCRIPT Compilation can be initiated from the directory in which the script is situated, by entering the following command: ONCOMP appliname The NAME of the script being "INDUST.0NS", the following command is therefore obtained: ONCOMP INDUST Compilation is performed in five passes whose task is to check the syntax and instructions. The task of the first pass is to process the #includes and the #functions. The task of the second pass is to prepare the server commands. The task of the third pass is to define the variables and process the #constant instructions. The task of the fourth pass is all the pseudo-commands. The task of the fifth pass is calculation of all the conditional and unconditional jump labels. As soon as an error is detected, the compilation is halted. The result of this compilation is the creation or modification of the file: INDUST.ONC Within the context of the integrated environment, to create or modify a script it is necessary to click on the "Edit" icon in the ONNET32 toolbar. Compilation of the script is performed after having closed the file by clicking on the "Compile" icon. The ONNET32 monitor is configured to operate with a certain number of "users". To each "user" there is assigned an initial script and a context of variables (see the configuration files). A "user" can be a tele-operator, an outgoing line, etc. COMMANDS APP_STOP_POSSIBLE APP_STOP_IMPOSSIBLE Hermès API english version 1.02.doc page 18/113 Date of issue: 30/07/99 Hermes API Stops the program/prevents the program being stopped ____________________________________________________________________ Description: APP_STOP_POSSIBLE allows the ONNET program to be stopped. APP_STOP_IMPOSSIBLE prevents the ONNET program being stopped. Syntax: APP_STOP_POSSIBLE; APP_STOP_IMPOSSIBLE; CALL V_CALL Calls a procedure internal to the tree structure ____________________________________________________________________ Description: These commands make it possible to call a set of instructions to minimize the script and not write the same sequence a number of times. The total number of CALL and SCRIPT_CALL nestings is limited to 16. The V_CALL command makes it possible to perform branches dynamically using a label stored in a variable. Syntax: CALL(label); V_CALL($Variable); label: Name of the label $Variable: Variable in which the name of the label will be stored Example: ...CALL(Name_Recording); .... Name_Recording: VOICE_PLAY("name"); VOICE_RECORD(5,$details); RETURN(0); or Hermès API english version 1.02.doc page 19/113 Date of issue: 30/07/99 Hermes API $Lab= LABEL_VALUE(Name_Recording); V_CALL($Lab); CHR Supplies a character from its ASCII value ____________________________________________________________________ Description: This command makes it possible to put, into strings, non-printing characters or characters specific to the script compiler. Syntax: $Text =CHR(value); Value: Expression giving the value of the character $Text: Variable in which the character will be returned Example: CHR(27) ; // Escape character CHR(13) ; // Carriage Return COMPUTER_NAME Gives the network name of the PC ____________________________________________________________________ Description: This command makes it possible to ascertain the name of the machine on which the monitor is running. Syntax: $Name=COMPUTER_NAME; $Name: Variable in which the name will be returned CONFIG_PARAM Looks for the value of a configuration parameter ____________________________________________________________________ Description This command makes it possible to find the value of an ONNET32 configuration parameter (in the file \onnet\config.ini by default). Hermès API english version 1.02.doc page 20/113 Date of issue: 30/07/99 Hermes API Syntax: CONFIG_PARAM(section,field,$Value); section: Expression giving the name of the section field: Expression giving the name of the field sought $Value: Variable in which the value will be returned Example: CONFIG_PARAM("GENERAL","BASE",$Base); After this command, $Base contains the name of the database (Calls+Events) used by ONNET32, that is, generally, \ONNET\onnet.mdb. DATE supplies the system date ____________________________________________________________________ Description: Returns the current system date Syntax: $Date=DATE; Example: DISPLAY_USER (DATE); displays the date in the form dd/mm/yy in the user window DATE_ADD returns a date to which a time interval has been added ____________________________________________________________________ Description: Returns a value containing a date to which a specified time interval has been added. Syntax: $NewDate =DATE_ADD (interval,number,date); interval: String expression representing the time interval you want to add, in accordance with the table of arguments below. number: Numeric expression representing the number of intervals you wish to add. It can be a positive value (to obtain dates in the future) or a negative value (to obtain dates in the past). Hermès API english version 1.02.doc page 21/113 Date of issue: 30/07/99 Hermes API date: Date to which the time interval is added. $NewDate: Variable in which the value of the new date will be returned. The interval argument can take the following values: Value Description yyyy Year q Quarter m Month y Day of the year d Day w Day of the week ww Week h Hour n Minute s Second Notes You can use the DATE_ADD function to add/subtract a specified time interval to/from a date. For example, you can use the DATE_ADD function to calculate a date 30 days away or a time 45 minutes away from the present time. If you wish to add days to a date, you can use the values Day of the year ("y"), Day ("d") or Day of the week ("w"). The DATE_ADD function does not return an invalid date. The following example adds one month to the date of 31 January: DATE_ADD("m", 1, "31-jan-95") In this case, DATE_ADD returns 28/02/1995 and not 31/02/1995. If the date argument has the value 31-jan-96, the function returns 29/02/1996 since 1996 is a leap year. If the calculated date were to precede the year 100 (that is, if you subtract more years than the date argument contains), the result is undefined. DATE_DIFF returns the number of time intervals between two dates Hermès API english version 1.02.doc page 22/113 Date of issue: 30/07/99 Hermes API ____________________________________________________________________ Description: Returns the number of time intervals between two specified dates. Syntax: $Date=DATE_DIFF(interval,date1,date2); interval: String expression representing the time interval used for calculating the difference between date1 and date2. date1, date2: Two dates you wish to use for the calculation. The interval argument can take the following values: Value Time interval yyyy Year q Quarter m Month y Day of the year d Day w Day of the week ww Week h Hour n Minute s Second Notes You can use the DATE_DIFF function to determine the number of specified time intervals occurring between two dates. You can, for example, use the DATE_DIFF function to calculate the number of days between two dates or the number of weeks between today and the end of the year. If you wish to know the number of days between date1 and date2, you can use either the argument Day of the year ("y"), or the argument Day ("d"). When the interval value is Day of the week ("w"), the DATE_DIFF function returns the number of weeks between the two dates. Hermès API english version 1.02.doc page 23/113 Date of issue: 30/07/99 Hermes API If date1 falls on a Monday, the DATE_DIFF function counts the number of Mondays up to date2. The function counts date2 but not date1. If, however, the interval value is Week ("ww"), the DATE_DIFF function returns the number of calendar weeks between the two dates. In this case, the function counts the number of Sundays between date1 and date2. The DATE_DIFF function counts date2 if it falls on a Sunday, but does not count date1, even if this falls on a Sunday. If date1 refers to a date later than date2, the DATE_DIFF function returns a negative value. DATE_PART Returns the specified part of a given date ____________________________________________________________________ Description: This command makes it possible to extract a single part of a date. (See also DATE_TIME which returns one or more parts of the current system date) Syntax: $Part=DATE_PART(interval,date); interval: String expression representing the time interval to be returned date: Expression representing the date to be evaluated The interval argument can take the following values: Value Description yyyy Year q Quarter m Month y Day of the year d Day w Day of the week ww Week h Hour n Minute s Second Example: ... $Month=DATE_PART("m""31 :12 :96" ) ; // $Result = 12 Hermès API english version 1.02.doc page 24/113 Date of issue: 30/07/99 Hermes API DATE_SQL puts a date in the American format ____________________________________________________________________ Description: This function is necessary for SQL instructions which only accept dates of the form mm/dd/yy. Syntax: $Date=DATE_SQL (Date); Date: Expression giving the value of the date. $Date: Variable in which the date will be returned in the form mm/dd/yy. Example: $temp1=DATE_SQL(DATE_ADD("m",0-2,DATE)); $temp1= VBASE_EXECUTE(STAT_BASE,"","DELETE * FROM CALLS WHERE Date = " & $temp1) ; DATE_TIME Gives the current date and time ____________________________________________________________________ Description: This command makes it possible to obtain the value of the date in accordance with the format field and the shift field. (See also DATE_ADD, DATE_PART, DATE_DIFF, and FILE_DATE_TIME) Syntax: DATE_TIME(format,shift); format is used to indicate the desired values: s or 1 seconds m or 2 minutes h or 3 hours D or 4 day in the month M or 5 month Y or 6 year d or 7 day of the week (0=Monday,1=Tuesday... 6=Sunday) Hermès API english version 1.02.doc page 25/113 Date of issue: 30/07/99 Hermes API y or 8 day of the year (1 for 1st January) w or 9 week of the year The number of times the same digit is repeated in format gives the formatting width of the field (see example). shift facilitates time calculations and tests by performing a shift towards the past by the value indicated by the field. It is of the form XXYYZZ: XX for days YY for hours ZZ for minutes Example: $ Hour_Minute =DATE(3322,0); OR $ Hour _Minute =DATE(hhmm,0); $ Hour _Minute will be equal to 1602 if the time is 16:02. $ Hour _Minute =DATE(3322,0405); $ Hour _Minute will be equal to 1157 if the time is 16:02. $Year=DATE(66,0); /* gives 96 for the year 1996 */ OR $Year=DATE(YY,0); /* gives 96 for the year 1996 */ $Year=DATE(6666,0); /* gives 1996 for the year 1996 */ OR $Year=DATE(YYYY,0); /* gives 1996 for the year 1996 */ DISK_FREE Gives the available disk space ____________________________________________________________________ Description: This command makes it possible to obtain the available space in bytes on a specified disk. Syntax: $Space=DISK_FREE(disk); Hermès API english version 1.02.doc page 26/113 Date of issue: 30/07/99 Hermes API disk: Expression giving the disk to be evaluated $Space: Variable in which the space will be returned Note: for specifying the disk, its root must be given: Example: $Space=DISK_FREE("c:\"); DISPLAY_EVT Generates an event ____________________________________________________________________ Description: This command makes it possible to generate an event message which will be displayed in the event window and stored. Syntax: DISPLAY_EVT(Text); Text: Expression giving the message to be displayed Example: DISPLAY_EVT("Starting of Automatic Call Generator on alarm"); DISPLAY_GEN Displays a data item in the GEN window ____________________________________________________________________ Description: This instruction makes it possible to display a data item on a specific line in the ONNET32 GEN window. It may be used to display a GLOBAL or SYSTEM variable, like for example the time of the last call, the number of connections made, the number of operators waiting, etc. Syntax: DISPLAY_GEN (line,text); line: Expression giving the display line text: Expression giving the message to be displayed Example: DISPLAY_GEN( $NbConnections & " Connection(s) "); Hermès API english version 1.02.doc page 27/113 Date of issue: 30/07/99 Hermes API DISPLAY_USER Displays a data item ____________________________________________________________________ Description: This instruction makes it possible to display a data item in the ONNET32 window having a line of text per "user". It makes it possible to display detailed information such as the name of the file in the process of being broadcast, etc. The instructions DISPLAY_RED, DISPLAY_GREEN, etc. provide a summary view of the monitor’s activity. Syntax: DISPLAY_USER(text); text: Expression giving the message to be displayed Example: DISPLAY_USER("I am playing the introductory message"); DISPLAY_USER("broadcasting "&$MsgName); DISPLAY_PANEL Displays a data item in one of the panels ____________________________________________________________________ Description: This instruction makes it possible to display a data item in one of the panels at the bottom of the main ONNET32 window. These instructions are used by the standard macro-commands for displaying the number of calls, the total duration...the date, the time. Syntax: DISPLAY_PANEL (panel,text); panel: Expression giving the value of the panel number text: Expression giving the message to be displayed (short message) Example: DISPLAY_PANEL(1, $NbCalls & " Call(s) ") ; DISPLAY_BLUE Displays a blue square Hermès API english version 1.02.doc page 28/113 Date of issue: 30/07/99 Hermes API ____________________________________________________________________ Description: This command makes it possible to display a blue square in the main ONNET32 window. Syntax: DISPLAY_BLUE; DISPLAY_GREEN Displays a green square ____________________________________________________________________ Description: This command makes it possible to display a green square in the main ONNET32 window. Syntax: DISPLAY_GREEN; DISPLAY_RED Displays a red square ____________________________________________________________________ Description: This command makes it possible to display a red square in the main ONNET32 window. Syntax: DISPLAY_RED; DOS Initiates an MSDOS type command ____________________________________________________________________ Description: This command makes it possible to initiate an MSDOS command, a .BAT file, etc. Syntax: DOS(command); command: expression giving the name of the command EXT_OPTION_I Extracting fields from an ONNET32 command Hermès API english version 1.02.doc page 29/113 Date of issue: 30/07/99 Hermes API ____________________________________________________________________ Description: This command makes it possible to extract values from a command Syntax: $Result=EXT_OPTION_I(option,command,default); option: String expression of the type: / followed by an upper case character command: Command with formatted options default: Expression giving the default value Example: ... $Cmd= "PLAY /M c:\onnet\mci\intro.wav" ; $Option=EXT_OPTION_I("/M",$Cmd,""); // $Option="c:\onnet\mci\intro.wav" FILE_ ...LINE_... Creates, reads, writes ... a file ____________________________________________________________________ Description: All the FILE_...LINE_... commands work on small text files (size: less than 4,000 characters). They make it possible to perform processing directly on a given line of a file, which is loaded into random access memory for reasons of speed. These functions thus make it possible to create configuration files and data files in a simple manner. In the case of a larger volume of data, the VBASE_... database access functions are highly advisable. FILE_... type commands which do not contain the word LINE are not affected by the limit of 4,000 characters. For example, the FILE_AT_END_WRITE function can generate a file of indeterminate size. FILE_APPEND Appends the content of one file to the end of another ____________________________________________________________________ Description: This command makes it possible to put, at the end of one file, the content of another file. This function also makes it possible to make a copy of a file (if the destination file does not exist). Hermès API english version 1.02.doc page 30/113 Date of issue: 30/07/99 Hermes API Note: depending on the size of the file to be appended, this function may last some time (a VOICE_PLAY_BACKGRD could be necessary on a very large file). This function returns a status >0 in the event of success. Syntax: $Status =FILE_APPEND(source,start,length,file); source: Expression giving the path of the file where the information to be extracted is stored start: Expression giving the point where the extraction from the source file starts length: Expression giving the length to be copied from the source file file: Expression giving the name of the file to which the information is going to be appended $Status: Variable in which the status will be returned FILE_AT_END_WRITE Writes a line at the end of a text file ____________________________________________________________________ Description: This command makes it possible to write an additional line at the end of a file. This function returns a status >0 in the event of success. Syntax: $Status=FILE_AT_END_WRITE(file,text); file: Expression giving the path and name of the file text: Character string expression $Status: Variable in which the status will be returned Example: ... $Status=FILE_AT_END_WRITE(" c :\calls.dat ", " 64689000") ; FILE_AT_END_REPLACE Replaces the last line of a text file ____________________________________________________________________ Description: This command makes it possible to modify the last line of a file. Hermès API english version 1.02.doc page 31/113 Date of issue: 30/07/99 Hermes API It is useful for transmitting a few items of information, refreshed dynamically, to other software programs which do not use the ONNET32 inter-process communication means. It is to be used sparingly (concurrent access problems...). This function returns a status >0 in the event of success. Syntax: $Status=FILE_AT_END_REPLACE(file,text); file: Expression giving the path and name of the file text: Character string expression FILE_DATE_TIME Gives the date and time of a file ____________________________________________________________________ Description: This command makes it possible to obtain the value of the date of modification of a file in accordance with the format field. (See also DATE_ADD, DATE_PART, DATE_DIFF) Syntax: FILE_DATE_TIME(file,format); file: Expression giving the name or path of the file format is used to indicate the desired values s or 1 seconds m or 2 minutes h or 3 hours D or 4 day in the month M or 5 month Y or 6 year d or 7 day of the week (0=Monday,1=Tuesday... 6=Sunday) y or 8 day of the year (1 for 1st January) w or 9 week of the year The number of times the same digit is repeated in format gives the formatting width of the field. Hermès API english version 1.02.doc page 32/113 Date of issue: 30/07/99 Hermes API FILE_DELETE Destroys a file or a set of files ____________________________________________________________________ Description: This command makes it possible to destroy a file, or files using the characters * and ? Syntax: FILE_DELETE(filetype); filetype: Expression giving the path and name of the files sought (* and ? capability) Example: ... FILE_DELETE(" c :\temp\*.tmp"); FILE_ENTRY_BEGIN Begins an area in a file with indexed storage areas ____________________________________________________________________ Description: This command makes it possible to record the start pointers of the given area. All bytes written into the file from this instruction will form part of the area (see FILE_ENTRY_END). Syntax: $Status=FILE_ENTRY_BEGIN(file,number); file: Expression giving the path and name of the file number: Expression giving the number of the area which is starting FILE_ENTRY_CREATE Creates a file with indexed storage areas ____________________________________________________________________ Description: This command makes it possible to create a file with directly addressable areas. It is useful for storing structured information. For example, in the voice field of activity, the name of a person can be stored in area 1, his town in area 2, etc. Hermès API english version 1.02.doc page 33/113 Date of issue: 30/07/99 Hermes API This organization will make it possible to listen to the details again more easily (see VOICE_PLAY_ENTRY and VOICE_RECORD_ENTRY). Another possible use is creating voice generators by concatenation with all the data in the same file (more efficient than separate files). The FILE_ENTRY_CREATE instruction must be called first, before the other FILE_ENTRY... type commands. This command returns a negative value in the event of failure. Note: in the case of use in voice recording, this type of file cannot be shared simultaneously (no writing to several areas simultaneously in one file). Syntax: $Status=FILE_ENTRY_CREATE(file,nbareas); file: Expression giving the path and name of the file nbareas: Expression giving the number of areas to be reserved Example: ... $Status=FILE_ENTRY_CREATE(" c :\temp\user.tmp",64); FILE_ENTRY_END Ends an area in a file with indexed storage areas ____________________________________________________________________ Description: This command makes it possible to record the end pointers of the given area. The area must have started with FILE_ENTRY_BEGIN Syntax: $Status=FILE_ENTRY_END(file,number); file: Expression giving the path and name of the file number: Expression giving the number of the area which is ending FILE_ENTRY_NUMBER Returns the number of areas in a file with indexed storage areas ____________________________________________________________________ Description: Hermès API english version 1.02.doc page 34/113 Date of issue: 30/07/99 Hermes API This command makes it possible to find the number of areas in a file created with FILE_ENTRY_CREATE. Syntax: $NbAreas=FILE_ENTRY_NUMBER(file); file: Expression giving the path and name of the file FILE_ENTRY_READ Reads an area of an indexed file ____________________________________________________________________ Description: This command makes it possible to read an area of an indexed file (see FILE_ENTRY_WRITE). Syntax: FILE_ENTRY_READ(File,Entry,$Var); File: Expression giving the path and name of the file Entry: Expression giving the number of the area to be read $Var : Variable in which the data read will be returned FILE_ENTRY_REMOVE Destroys an area of a file with indexed storage areas ____________________________________________________________________ Description: This command makes it possible to delete the pointers of the given area. Note: the data are not physically deleted (the size of the file does not change). Syntax: $Status=FILE_ENTRY_REMOVE(file,number); file: Expression giving the path and name of the file number: Expression giving the number of the area to be deleted FILE_ENTRY_SIZE Returns the size of an area of a file with indexed storage areas ____________________________________________________________________ Description: Hermès API english version 1.02.doc page 35/113 Date of issue: 30/07/99 Hermes API This command makes it possible to ascertain the size of an area in bytes. Syntax: $Size=FILE_ENTRY_SIZE(file,number); file: Expression giving the path and name of the file number: Expression giving the number of the area whose size is required FILE_ENTRY_START Returns the start of an area in a file with indexed storage areas ____________________________________________________________________ Description: This command makes it possible to ascertain where an area starts (in bytes). Syntax: $Start=FILE_ENTRY_START(file,number); file: Expression giving the path and name of the file number: Expression giving the number of the area whose start is required FILE_ENTRY_WRITE Writes into an indexed file area ____________________________________________________________________ Description: This command makes it possible to write into an indexed file area. Syntax: FILE_ENTRY_WRITE(File,Entry,Text); File: Expression giving the path and name of the file Entry: Expression giving the number of the area Text: Expression giving the value to be written Example: ... FILE_ENTRY_WRITE("details",5,DATE); FILE_ENTRY_READ("details",5,$val); FILE_INT_NAME Hermès API english version 1.02.doc page 36/113 Date of issue: 30/07/99 Hermes API Generates a file name on the interface PC ____________________________________________________________________ Description: This command makes it possible to obtain a full name (with a path/directory) from a name (file + extension) and an interface type. This instruction makes it possible to access the local files on servers distributed over a network with a monitor on one PC and NET, VOICE, etc. servers on other PCs. The use of this command does not form part of this documentation. FILE_LAST_VERSION_NAME Generates a file name with versions ____________________________________________________________________ Description: This command makes it possible to obtain the concept of a version on the voice files. It can make it possible to automatically manage the picking up of new files transferred through a computer network. The use of this command does not form part of this documentation. FILE_LINE_DELETE Deletes a line from a text file ____________________________________________________________________ Description: This command makes it possible to delete a line from a file. This function returns a status >0 in the event of success. Syntax: $Status=FILE_LINE_DELETE(file,line); file: Expression giving the path and name of the file line: Expression giving the number of the line to be deleted Example: ... $Status=FILE_LINE_DELETE(" c :\names.dat ", 2); If the file names.dat contains: Hermès API english version 1.02.doc page 37/113 Date of issue: 30/07/99 Hermes API WEATHER VOCALCOM INFO ... after the function has been called, the file names.dat contains: WEATHER INFO ... FILE_LINE_FIND Looks for a line in a text file ____________________________________________________________________ Description: This command makes it possible to look for a complete line in a file. This function returns the number of the line in the event of success. Note: even in the case of numeric values, the test for equality is performed by comparisons of character strings; therefore 01 is not equal to 1. Syntax: $Line=FILE_LINE_FIND(file,text); file: Expression giving the path and name of the file text: Character string expression Example: ... $Line=FILE_LINE_FIND(" c :\names.dat", "VOCALCOM"); If the file names.dat contains: WEATHER VOCALCOM INFO $Line will be equal to 2 after the function has been called. FILE_LINE_READ Reads a line of a text file Hermès API english version 1.02.doc page 38/113 Date of issue: 30/07/99 Hermes API ____________________________________________________________________ Description: This command makes it possible to read a line of a file. This function returns a status >0 in the event of success. Syntax: $Status=FILE_LINE_READ(file,line,$Variable); file: Expression giving the path and name of the file line: Expression giving the number of the line to be read $Variable: Variable in which the line will be returned Example: ... $Status=FILE_LINE_READ(" c :\names.dat ", 2,$text) ; FILE_LINE_REPLACE Replaces a line in a text file ____________________________________________________________________ Description: This command makes it possible to modify a line in a file. This function returns a status >0 in the event of success. Syntax: $Status=FILE_LINE_REPLACE(file,line,text); file: Expression giving the path and name of the file line: Expression giving the number of the line to be replaced text: Character string expression FILE_LINES_APPEND Appends the content of one file to the end of another ____________________________________________________________________ Description: This command makes it possible to put, at the end of one file, the content of another file. This function also makes it possible to make a copy of a file (if the destination file does not exist). Hermès API english version 1.02.doc page 39/113 Date of issue: 30/07/99 Hermes API Note: the size of the file to be appended must be less than 4,000 characters. This function returns a status >0 in the event of success. Syntax: $Status =FILE_LINES_APPEND(addition,file); addition: Expression giving the path of the file to be appended file: Expression giving the name of the file $Status: Variable in which the status will be returned FILE_LINES_NUMBER Gives the number of lines in a text file ____________________________________________________________________ Description: This command makes it possible to ascertain the number of lines in a text file. If the file does not exist, the function returns a negative value. Syntax: $NbLines=FILE_LINES_NUMBER(file); file: Expression giving the path of the file FILE_LINES_SORT Sorts a text file ____________________________________________________________________ Description: This command makes it possible to sort a text file on the basis of a field number, the field separator(s) being defined. This function returns the number of lines sorted. Note: the length of a line is limited to 512 characters; also, for the sake of performance, do not sort files which are too large (use databases). This function is used a lot for mailbox type applications and for sorting a directory by date. Syntax: $Nb=FILE_LINES_SORT(file,num,token) ; file: Expression giving the path and name of the file num: Expression giving the number of the field to be extracted Hermès API english version 1.02.doc page 40/113 Date of issue: 30/07/99 Hermes API token: Character string expression giving all the separation characters. FILE_LIST_FILE Lists, in a file, all files of a certain type ____________________________________________________________________ Description: This command makes it possible to create, in a file, a list of all files with a certain type of name. This function returns the number of files found and therefore the number of lines in the file created. Syntax: $Number=FILE_LIST_FILE(filetype,listfile); filetype: Expression giving the path and name of the files sought (with * and ?) listfile: Expression giving the name of the file which will contain the list Example: ... $Nb=FILE_LIST_FILE(" c :\*.bat","c:\list.tmp") ; If the only *.bat file in the root is autoexec.bat $Nb=1 and LIST.TMP contains: C:\AUTOEXEC.BAT FILE_LIST_FILEW Lists, in a file, all files of a certain type with information ____________________________________________________________________ Description: This command makes it possible to create, in a file, a list of all files with a certain type of name. Compared with the previous function (FILE_LIST_FILE ), there is, for each file, its size and date of modification (in system form which allows easy sorting with FILE_LINES_SORT). Syntax: $Number=FILE_LIST_FILEW(filetype,listfile); Hermès API english version 1.02.doc page 41/113 Date of issue: 30/07/99 Hermes API filetype: Expression giving the path and name of the files sought (with * and ?) listfile: Expression giving the name of the file which will contain the list Example: ... $Nb=FILE_LIST_FILEW(" c :\*.bat","c:\list.tmp") ; $Nb=3 and LIST.TMP contains: C:\AUTOEXEC.BAT 487 887305206 C:\VOCALCOM.BAT 326 760024658 C:\PHONEC.BAT 147 834409910 FILE_MKDIR Creates a directory ____________________________________________________________________ Description: This command makes it possible to create a directory on a local disk or on a network Syntax: FILE_MKDIR(Dir); Dir: Expression giving the name of the directory Example: FILE_MKDIR ("\tmp"); FILE_MKDIR("h:\tmp"); FILE_MKDIR("\\test\c\tmp"); FILE_NAME Generates a full name for a file ____________________________________________________________________ Description: This command makes it possible to obtain a full name (with a path/directory) from a name (file + extension). Hermès API english version 1.02.doc page 42/113 Date of issue: 30/07/99 Hermes API If the file name specifies a path, the name remains unchanged; on the other hand, if there is no directory, this instruction automatically adds the script directory. This instruction is used internally in all macro-commands which have a file name as a parameter. Syntax: $FileName=FILE_NAME(File); File: Expression giving the file name Example: $FileName=FILE_NAME("hello.wav"); //$FileName="\onnet\001\hello.wav" FILE_NAME_CHANCE Generates a name for a games file ____________________________________________________________________ Description: This command makes it possible to generate a file name by specifying the number of winners with the concept of a random draw. When the winner is not taken into account by the random drawing of lots, the function returns an empty string. Syntax: $FileName=FILE_NAME_CHANCE(File,Nb); File: Expression giving the name of the file Nb: Expression giving the number of files to be stored $FileName: Variable in which the name of the file is returned Example: $FileName=FILE_NAME_CHANCE("lot000.WIN ",100); in $FileName, one of the following values will be returned: lot001.WIN lot002.WIN ....... lot010.WIN ..... lot100.WIN $FileName=FILE_NAME_CHANCE("lot0.WIN ",100); in $FileName, one of the following values will be returned: Hermès API english version 1.02.doc page 43/113 Date of issue: 30/07/99 Hermes API lot1.WIN lot2.WIN ... lot10.WIN ..... lot100.WIN FILE_NAME_TEMP Generates a temporary file name ____________________________________________________________________ Description: This command makes it possible to generate a temporary file name on a local disk or on a network. Syntax: $BufferName=FILE_NAME_TEMP(Dir); Dir: Expression giving the name of the directory Example: $BufferName=FILE_NAME_TEMP("\tmp"); $BufferName =FILE_NAME_TEMP("h:\tmp"); $BufferName =FILE_NAME_TEMP("\\test\c\tmp"); FILE_NB_LINE_CREATE Creates an empty text file ____________________________________________________________________ Description: This command makes it possible to create an empty file having a given number of lines. This function returns a status >0 in the event of success. Syntax: $Status=FILE_NB_LINE_CREATE(file,lines); file: Expression giving the path and name of the file lines: Expression giving the number of lines FILE_PART_NAME Extracts part of the path of a file name Hermès API english version 1.02.doc page 44/113 Date of issue: 30/07/99 Hermes API ____________________________________________________________________ Description: This command makes it possible to obtain the directory, the name or the extension from a file name. Syntax: $Part=FILE_PART_NAME(selector,file); file: Expression giving the file name selector: Selection character for the field to be extracted d: the directory N: the name with its extension n: the name with no extension e: the extension $Part: Variable in which a portion of the file name will be returned. Note: for specifying the disk, its root must be given: Example: $NameExt=FILE_PART_NAME("c:\onnet\001\tree.ons"); //$NameExt="tree.ons" FILE_TO_LINE_ADD Adds a value to a line in a text file ____________________________________________________________________ Description: This command makes it possible to add a number (positive or negative) to a line in a file containing a number. If the initial line is not numeric, its value is considered to be zero. If the file does not exist and if the line number is equal to 1, the file is automatically created. This function returns a status >0 in the event of success. Syntax: $Status=FILE_TO_LINE_ADD(file,line,value,$result); file: Expression giving the path and name of the file line: Expression giving the number of the line to be replaced value: Numeric expression $result: Variable in which the result of the addition will be returned Hermès API english version 1.02.doc page 45/113 Date of issue: 30/07/99 Hermes API FILE_RENAME Changes the name of a file ____________________________________________________________________ Description: This command makes it possible to change the name of a file. If a file using this new name already exists, it will be destroyed. In the event of a problem, the value returned is negative. Syntax: $Status=FILE_RENAME(old,new); old: Expression giving the path of the file whose name is going to change new: Expression giving the new name of the file FILE_RENAMEW Changes the name of a set of files ____________________________________________________________________ Description: This command makes it possible to change a number of files. If a file using this new name already exists, it will be destroyed. The value returned is the number of files which have changed name. Syntax: $Nb=FILE_RENAMEW(old,new) ; old: Expression giving the path of the files whose name is going to change (with the aid of the characters ? and *) new: Expression giving the structure of the new file names FILE_SIZE Gives the size of a file or of a set of files ____________________________________________________________________ Description: This command makes it possible to ascertain the number of bytes occupied on the disk by a file, or by a number of files using the characters * and ? Hermès API english version 1.02.doc page 46/113 Date of issue: 30/07/99 Hermes API Syntax: $NbBytes=FILE_SIZE(filetype); filetype: Expression giving the path and name of the files sought (* and ? capability) FILE_VERSION Gives the system version of an executable file or of a DLL ____________________________________________________________________ Description: This command makes it possible to ascertain the version of an EXE or of a DLL Syntax: $Version=FILE_VERSION(file); file: Expression giving the path of the file Example: $Version=FILE_VERSION("\onnet\onexe\onnet32.exe"); // the character string is retrieved (see Properties in the Explorer). FORMAT Formats a character string ____________________________________________________________________ Description: This command makes it possible to format a character string in a format Syntax: $Result=FORMAT(Expression,Fmt); Expression: Numeric or character expression to be formatted. Fmt: Formatting expression (see below). The following table shows the characters you can use to create user-defined number formats and their meaning: Character Meaning Empty string No formatting. Display of the number with no formatting. Hermès API english version 1.02.doc page 47/113 Date of issue: 30/07/99 Hermes API 0 Space reserved for a digit. Display of a digit or a zero. If the expression formatted contains a digit at the position occupied by the 0 in the formatting string, it is displayed; otherwise a zero is displayed at that location. If the number formatted has fewer digits than there are zeros in the formatting expression, non-significant zeros and zeros to the right are displayed. # Space reserved for a digit. Display of a digit or nothing at all. If the expression formatted contains a digit at the position occupied by the # sign in the formatting string, it is displayed; otherwise, nothing is displayed at that location. This symbol behaves like the space reserved for the digit 0, except that non-significant zeros and zeros to the right are not displayed if the number has a number of digits less than or equal to the number of # characters. % Space reserved for the percentage sign. The expression is multiplied by 100. The percentage sign (%) is inserted at the position at which it appears in the formatting string. , Thousands separator. In certain national parameters, the thousands separator is represented by a space. The thousands separator separates the thousands from the hundreds in a number which has at least four digits to the left of the decimal separator. Normal use of the thousands separator is specified if the format contains a thousands separator flanked by spaces reserved for a digit (0 or #). The character actually used as the thousands separator in the formatting of the output depends on the "Format" option for numbers recognized by your system. : Time separator. In certain national parameters, the time separator is represented by a dot. The time separator separates the hours, minutes and seconds when time values are formatted. The character actually used as the time separator in formatting the output is determined by the parameters of your system. Hermès API english version 1.02.doc page 48/113 Date of issue: 30/07/99 Hermes API / Date separator. In certain national parameters, the date separator is represented by a dash. The date separator separates the day, month and year when date values are formatted. The character actually used as the date separator in the formatting of the output is determined by the parameters of your system. - + $ ( ) space Display of a literal character. To display a character different from those listed, precede it with a backslash (\) or put it between speech marks (" "). \ Display of the next character of the formatting string. Many characters used in the formatting expression have a special meaning and therefore cannot be displayed literally if they are not preceded by a backslash. This backslash is not displayed. Its use amounts to putting the character which follows between double quotes. To display a backslash, use two backslashes (\\). Among the examples of characters which cannot be displayed as literal characters, we shall note the date and time formatting characters (a, c, d, h, m, n, p, q, s, t, w, y and /:), the numeric formatting characters (#, 0, %, E, e, decimal separator and thousands separator), and the string formatting characters (@, &, <, > and !). "ABC" Display of the character string inserted between double quotes. To include a character string in the format argument from the code, you must use the function Chr(34) to put the text between double quotes (34 is the character code corresponding to double quotes). Yes/No Display of No if the number is 0; otherwise display of Yes. True/False Display of False if the number is 0; otherwise display of True. On/Off Display of Off if the number is 0; otherwise display of On. Hermès API english version 1.02.doc page 49/113 Date of issue: 30/07/99 Hermes API The following table shows a few examples of number formatting expressions. (These examples assume that the country chosen in the International dialogue box of the Configuration Panel of your system is France.) The first column contains the formatting strings and the other columns contain the output obtained when the data formatted take the value shown in the column headers. Format (format) +5 -5 Empty string 5 -5 0 5 -5 0.00 5,00 -5,00 #,##0 5 -5 #,##0.00;;;Nothing 5,00 -5,00 #,##0F;-#,##0F 5F -5F #,##0.00F;#,##0.00F 5,00F -5,00F 0% 500% -500% A formatting expression for a number may contain from one to four sections separated by a semicolon. (If the format argument contains one of the predefined formats, only one section is allowed.) If you use Then One section only The formatting expression applies to all values. Two sections The first section applies to positive values and zeros, the second to negative values. Three sections The first section applies to positive values, the second to negative values and the third to zeros. The following example has two sections: • the first defines the format for positive values and zeros, • the second defines the format for negative values. "#,##0F;-#,##0F" Hermès API english version 1.02.doc page 50/113 Date of issue: 30/07/99 Hermes API If two semicolons follow one another immediately, the missing section is printed in accordance with the format for positive values. For example, the following format displays positive and negative values using the format of the first section and displays "Zero" if the value is equal to zero. "#,##0F;;\Z\e\r\o" The following table shows the characters you can use to create a formatting expression for strings: Character Meaning @ Space reserved for a character. Display of a character or a space. If the string formatted contains a character at the position occupied by the @ sign in the formatting expression, that character is displayed; otherwise, a space is displayed at that location. The spaces reserved are filled from right to left, unless the formatting string contains an exclamation mark (!). See below. & Space reserved for a character. Display of a character or nothing at all. If the string contains a character at the position occupied by the & sign, that character is displayed; otherwise, nothing is displayed. The spaces reserved are filled from right to left, unless the string contains an exclamation mark (!). See below. < Forced lower case. All characters are displayed in lower case. > Forced upper case. All characters are displayed in upper case. ! Forced reserved space filling from left to right. By default, filling is performed from right to left. The following table shows the names of the date and time formats to be used and their meaning: Format name Hermès API english version 1.02.doc Description page 51/113 Date of issue: 30/07/99 Hermes API General Date Display of the date and/or time. For real numbers, display of the date and time (for example, 3/4/93 17:34). The date display is determined by the parameters of your system. Long Date Display of the complete date in accordance with the format defined in your system. Medium Date Display of the date in the same format as the short date, apart from the fact that the abbreviation for the month is displayed (format appropriate to the Visual Basic language version). Short Date Display of the short date in accordance with the format defined in your system. Long Time Display of the complete time in accordance with the format defined in your system. The complete time includes the hours, minutes and seconds. Medium Time Display of the time in a 12-hour format using the hours and minutes and the indicators AM/PM. Short Time Display of the time in the 24-hour format (for example, 17:45). The following table shows the characters you can use to create user-defined date/time formats and their meaning: Character Description : Time separator. In certain national parameters, the time separator is represented by a different character (: for the French parameter). The time separator separates the hours, minutes and seconds when time values are formatted. The character actually used as the time separator in the formatted output is determined by the parameters of your system. Hermès API english version 1.02.doc page 52/113 Date of issue: 30/07/99 Hermes API / Date separator. In certain national parameters, the date separator is represented by a different character (/ for the French parameter). The date separator separates the day, month and year when date values are formatted. The character actually used as the date separator in the formatted expression is determined by the parameters of your system. c Display of the date in the form ddddd and display of the time in the form ttttt, in that order. d Display of the day in the form of a number without a nonsignificant zero (1-31). dd Display of the day in the form of a number with a nonsignificant zero (01-31). ddd Display of the day in its short form (Sun-Sat). dddd Display of the day in its full form (Sunday-Saturday). ddddd Display of a complete date (day, month and year), formatted in accordance with the short date format option defined in your system. The default short date format is dd/mm/yy. dddddd Display of a date serial number in the form of a complete date (day, month and year) formatted in accordance with the complete date format option defined in your system. The default complete date format is dddd mmmm yyyy. w Display of the day of the week in the form of a number (from 1 for Sunday to 7 for Saturday). Hermès API english version 1.02.doc page 53/113 Date of issue: 30/07/99 Hermes API ww Display of the week of the year in the form of a number (153). m Display of the month in the form of a number without a non-significant zero (1-12). If m immediately follows h or hh, the display shows the minutes and not the month. mm Display of the month in the form of a number with a nonsignificant zero (01-12). If m immediately follows h or hh, the display shows the minutes and not the month. mmm Display of the month in its short form (Jan-Dec). mmmm Display of the month in its complete form (JanuaryDecember). q Display of the quarter of the year in the form of a number (1-4). y Display of the day of the year in the form of a number (1366). yy Display of the year in the form of a two-digit number (0099). yyyy Display of the year in the form of a four-digit number (1009999). h Display of the hour in the form of a number without a nonsignificant zero (0-23). hh Display of the hour in the form of a number with a nonsignificant zero (00-23). Hermès API english version 1.02.doc page 54/113 Date of issue: 30/07/99 Hermes API n Display of the minutes in the form of a number without a non-significant zero (0-59). nn Display of the minutes in the form of a number with a nonsignificant zero (00-59). s Display of the seconds in the form of a number without a non-significant zero (0-59). ss Display of the seconds in the form of a number with a nonsignificant zero (00-59). ttttt Display of the complete time (hours, minutes and seconds), formatted using the time separator defined by the "Time Format" option recognized by your system. A nonsignificant zero is displayed if the corresponding option is selected and if it is earlier than 10 o’clock in the morning. The default time format is hh:mm:ss. AM/PM 12-hour format and display of the indicator AM in upper case for a time earlier than midday and of the indicator PM in upper case for a time between midday and midnight. am/pm 12-hour format and display of the indicator AM in lower case for a time earlier than midday and of the indicator PM in lower case for a time between midday and midnight. A/P 12-hour format and display of the indicator A in upper case for a time earlier than midday and of the indicator P in upper case for a time between midday and midnight. a/p 12-hour format and display of the indicator A in lower case for a time earlier than midday and of the indicator P in lower case for a time between midday and midnight. Hermès API english version 1.02.doc page 55/113 Date of issue: 30/07/99 Hermes API AMPM 12-hour format and display of the literal string AM, in the form defined by your system, for a time earlier than midday and of the literal string PM, in the form defined by your system, for a time between midday and midnight. AMPM is either in lower case or in upper case. However, on display, the literal string will have the form defined by your system parameters. The default format has no literal string. The following table shows examples of user-defined date and time formats for 14th October 1964: Format Display d/m/yy 14/10/64 d-mmm 14-Oct d-mmmm-yy 14-October-64 d mmmm 14 October mmmm yy October 64 hh:mm AM/PM 08:50 PM h:mm:ss a/p 8:50:35 p h:mm 20:50 h:mm:ss 20:50:35 d/m/yy h:mm 14/10/64 20:50 GLOBAL_VAR_LOAD GLOBAL_VAR_STORE Reads / Modifies a variable in a global area ____________________________________________________________________ Description: These two instructions make it possible to ascertain the value/modify the value of a variable in a global context. They make it possible to set up a dialogue between "users" using the same area. Syntax: $Variable=GLOBAL_VAR_LOAD(global,variable); Hermès API english version 1.02.doc page 56/113 Date of issue: 30/07/99 Hermes API GLOBAL_VAR_STORE(global,variable,value); $Variable: Variable which will receive the value. global: Expression giving the number of the global area variable: Expression giving the number of the variable value: Value which is going to be given to the global area variable GLOBAL_VAR_ON_GOTO GLOBAL_VAR_ON_CALL GLOBAL_VAR_OFF Enables/Disables a jump or an internal procedure call ____________________________________________________________________ Description: GLOBAL_VAR_ON_GOTO makes it possible to set up a jump which will be performed as soon as the specified variable is different from an empty string. GLOBAL_VAR_ON_CALL makes it possible to set up a call which will be performed as soon as the specified variable is different from an empty string. GLOBAL_VAR_OFF makes it possible to disable a GLOBAL_VAR_ON... type command. The specified variable is defined in a global area. Thus an action can be executed following a change in a context among a set addressing the same area. Syntax: GLOBAL_VAR_ON_GOTO(global,variable,label); GLOBAL_VAR_ON_CALL(global,variable,label); GLOBAL_VAR_OFF(global,variable); global: Expression giving the global area number variable: Expression giving the number of the variable to be monitored. GOTO V_GOTO Performs a branch internal to the tree structure ____________________________________________________________________ Description: These commands make it possible to perform a jump to another line in the tree structure (GOTO). Hermès API english version 1.02.doc page 57/113 Date of issue: 30/07/99 Hermes API The V_GOTO command makes it possible to perform branches dynamically using a label stored in a variable. Syntax: GOTO(label); V_GOTO(label); Example: ... GOTO(Summary); .... Summary: VOICE_PLAY(" your_choice "); or $Lab= LABEL_VALUE(summary); V_GOTO($Lab); .... INT_TYPE Returns the interface type ____________________________________________________________________ Description: This command makes it possible to ascertain the interface type of a server (TYPE= field of the CONFIG.INI file Syntax: $Type=INT_TYPE(Server); $Type: Variable in which the type of the server mentioned in CONFIG.INI will be returned Server: Expression giving the name of the server mentioned in CONFIG.INI Example: $Type= INT_TYPE("NET") ; IS_NUMBER Tests numeric validity ____________________________________________________________________ Description: Hermès API english version 1.02.doc page 58/113 Date of issue: 30/07/99 Hermes API This command tests whether the expression is a number. It returns a value different from 0 if the expression is a number. Syntax: $Number=IS_NUMBER(Value); $Number: Variable in which 0 will be returned if the expression tested is not a number Value: Expression to be tested Example: $Number= IS_NUMBER("3") ; //$Number !=0 $Number= IS_NUMBER(3) ; //$Number !=0 $Number= IS_NUMBER(" 3 ") ; //$Number !=0 $Number= IS_NUMBER(" +3 ") ; //$Number !=0 $Number= IS_NUMBER(" + 3 ") ; //$Number ==0 $Number= IS_NUMBER(" -3 ") ; //$Number !=0 $Number= IS_NUMBER(" - 3 ") ; //$Number ==0 $Number= IS_NUMBER(" +3 * ") ; //$Number ==0 $Number= IS_NUMBER(" #3 ") ; //$Number ==0 LABEL_VALUE Assigns a label ____________________________________________________________________ Description: This command makes it possible to assign a label in a variable It is useful with the V_GOTO and V_CALL instructions Syntax: $Variable=LABEL_VALUE(Summary); Example: $Branch= LABEL_VALUE(Summary) ; ... if ($Num==10) $Branch= LABEL_VALUE(Change) ; ... Hermès API english version 1.02.doc page 59/113 Date of issue: 30/07/99 Hermes API V_GOTO($Branch); .... MULTITASKING_LOCK Locks multitasking ____________________________________________________________________ Description: This command makes it possible to lock the multi-channels. It must be used during a very short sequence, for example changing a value in a file. Only this line progresses through its tree structure (all other lines are locked in the progress through their tree structure). It cannot be used with non-synchronized VOICE_PLAY, NET_IN_WAIT_CALL... type instructions. Syntax: MULTITASKING_LOCK; MULTITASKING_RELEASE Unlocks multitasking ____________________________________________________________________ Description: This command makes it possible to unlock the multi-channels. Syntax: MULTITASKING_RELEASE; MAIL_ALLOC MAIL_FREE Allocates/De-allocates an e-mail resource ____________________________________________________________________ Description: MAIL_ALLOC makes it possible to allocate oneself a resource dedicated to managing electronic mail. MAIL_FREE makes it possible to release a resource dedicated to managing electronic mail. Syntax: MAIL_ALLOC($Resource,user,password,download); Hermès API english version 1.02.doc page 60/113 Date of issue: 30/07/99 Hermes API MAIL_FREE($Resource); $Resource: Variable in which the resource number will be returned user: Optional login parameter password: Optional login parameter download: Optional parameter indicating that it is wished to download the new messages (if they exist) Example: ... MAIL_ALLOC($MailRes,download=1); .... MAIL_FREE($MailRes) ; MAIL_FETCH Selects the mail from an e-mail resource ____________________________________________________________________ Description: MAIL_FETCH makes it possible to . Syntax: MAIL_FILE_TO_MSGNOTE MAIL_MSGNOTE_TO_FILE MAIL_READ MAIL_SEND MAIL_WRITE Hermès API english version 1.02.doc page 61/113 Date of issue: 30/07/99 Hermes API HERMES API VOICE APPLICATIONS GENERATOR Remarques en rouge Page 16: à extraire - ne devrait-il pas être à trier? Page 18: FILE_LIST_FILEW au lieu de FILE_LIST_FILE Page 19: lorsque le gagnant n'est pas pris en compte? NET_IN_ALLOC NET_IN_FREE Allocates/De-allocates a resource dedicated to the management of an incoming call _______________________________________________________________ Description: NET_IN_ALLOC makes it possible to allocate oneself a resource dedicated to the management of an incoming call. In general, this command is not used explicitly, since it is included in the NET_IN_WAIT_CALL instruction. NET_IN_FREE de-allocates the resource allocated by the NET_IN_ALLOC command. Syntax: NET_IN_ALLOC; NET_IN_FREE; NET_IN_LIB Hangs up an incoming call __________________________________________________________________________ Description: This command makes it possible to hang up an incoming call. Syntax: NET_IN_LIB; NET_IN_RLIB_ON_GOTO NET_IN_RLIB_OFF Hermès API english version 1.02.doc page 62/113 Date of issue: 30/07/99 Hermes API Enables/Disables a jump in the tree structure in the event of hanging up of the incoming call _______________________________________________________________________ Description: NET_IN_RLIB_ON_GOTO makes it possible, in the event of hanging up of the incoming call, to stop progression through the tree structure and perform a jump to the specified label. The NETVOICE_IN_FREE instruction must be the 1st instruction called after the label. NET_IN_RLIB_OFF makes it possible to disable a NET_IN_RLIB_ON_GOTO type command. Syntax: NET_IN_RLIB_ON_GOTO(label); NET_IN_RLIB_OFF; label: Label name Example: NET_IN_WAIT_CALL; NETVOICE_IN_ACCEPT; NET_IN_RLIB_ON_GOTO(TreeStructEnd); ... TreeStructEnd: NETVOICE_IN_FREE; STAT_END; SCRIPT_RESET; NET_IN_WAIT_CALL Waits for an incoming call _______________________________________________________________________ Description: This command makes it possible to allocate oneself a NET type resource and set it waiting for a call. Syntax: NET_IN_WAIT_CALL; NET_IN_ANI Retrieves the calling party’s number _______________________________________________________________________ Hermès API english version 1.02.doc page 63/113 Date of issue: 30/07/99 Hermes API Description: This command makes it possible to retrieve the calling party’s telephone number. Syntax: $Num=NET_IN_ANI; $Num: Variable in which the calling party’s number will be returned NET_IN_DNIS Retrieves the DDI number _______________________________________________________________________ Description: This command makes it possible to retrieve the DDI number. Syntax: $Ddi=NET_IN_DNIS $Ddi : Variable in which the DDI number will be returned NET_IN_DNIS_NB Retrieves the number of connections in progress on a DDI number _______________________________________________________________________ Description: This command makes it possible to retrieve the number of calls in progress on a DDI number. Syntax: $Nb=NET_IN_DNIS_NB NET_OUT_ALLOC NET_OUT_FREE Allocates/De-allocates a resource dedicated to the management of an outgoing call _______________________________________________________________________ Description: NET_OUT_ALLOC makes it possible to allocate oneself a resource dedicated to the management of an outgoing call. NET_OUT_FREE de-allocates the resource allocated by the NET_OUT_ALLOC command. Syntax: Hermès API english version 1.02.doc page 64/113 Date of issue: 30/07/99 Hermes API NET_OUT_ALLOC; NET_OUT_FREE; NET_OUT_DIAL_CALL Dials an outgoing call _______________________________________________________________________ Description: This command makes it possible to make an outgoing call. Syntax: NET_OUT_DIAL_CALL(Number,RingingTime,port); Number: Expression giving the telephone number to be dialled RingingTime: Expression giving the ringing time in hundredths of a second port: Expression giving the number of the basic rate interface used for an SCII 4S0 card NET_OUT_LIB Hangs up an outgoing call _______________________________________________________________________ Description: This command makes it possible to hang up an outgoing call. Syntax: NET_OUT_LIB; NET_OUT_RLIB_ON_GOTO NET_OUT_RLIB_OFF Enables/Disables a jump in the tree structure in the event of hanging up of the outgoing call _______________________________________________________________________ Description: NET_OUT_RLIB_ON_GOTO makes it possible, in the event of hanging up of the outgoing call, to stop progression through the tree structure and perform a jump to the specified label. The NETVOICE_IN_FREE instruction must be the 1st instruction called after the label. NET_OUT_RLIB_OFF makes it possible to disable a NET_OUT_RLIB_ON_GOTO type command. Syntax: Hermès API english version 1.02.doc page 65/113 Date of issue: 30/07/99 Hermes API NET_OUT_RLIB_ON_GOTO(label); NET_OUT_RLIB_OFF; label: Label name Example: NET_OUT_RLIB_ON_GOTO(TreeStructEnd); ... TreeStructEnd: NETVOICE_IN_FREE; STAT_END; SCRIPT_RESET; NET_OUT_TAX Retrieves the charging for an outgoing call __________________________________________________________________________ Description: This command makes it possible to retrieve the number of charging units generated by an outgoing call. Syntax: $chargingunit=NET_OUT_TAX; $chargingunit:: Variable in which the number of charging units will be returned NET_SWITCH_S2 Switches the network channels __________________________________________________________________________ Description: This command makes it possible to switch between the different PCMs and channels of a Telecom SCII ISDN card. Syntax: NET_SWITCH_S2(0,0,ChannelOut,0,ChannelIn); Example: NET_SWITCH_S2 (0,0,$SysNetIChannel,0,$SysNetOChannel) ; NET_SWITCH_S2 (0,0,$SysNetOChannel,0,$SysNetIChannel) ; Hermès API english version 1.02.doc page 66/113 Date of issue: 30/07/99 Hermes API NETVOICE_IN_ACCEPT Accepts an incoming call ____________________________________________________________________ Description: This command makes it possible to pick up an incoming call. Syntax: NETVOICE_IN_ACCEPT; NETVOICE_IN_FREE Terminates an incoming call ____________________________________________________________________ Description: This command makes it possible to hang up an incoming call and release the incoming call NET type resource and the VOICE type resource. Syntax: NETVOICE_IN_FREE; NETVOICE_OUT_ACCEPT Accepts an outgoing call ____________________________________________________________________ Description: This command makes it possible to set up an outgoing call with a voice resource. Syntax: NETVOICE_OUT_ACCEPT; NETVOICE_OUT_FREE Terminates an outgoing call ____________________________________________________________________ Description: This command makes it possible to hang up an outgoing call and release the outgoing call NET type resource and the VOICE type resource. Syntax: NETVOICE_OUT_FREE; Hermès API english version 1.02.doc page 67/113 Date of issue: 30/07/99 Hermes API REG_LOCAL_MACHINE_READ_INT Reads a value from the register base in the HKEY_LOCAL_MACHINE part ____________________________________________________________________ Description: This command makes it possible to read a value of integer type from the register base. Syntax: $val=REG_LOCAL_MACHINE_READ_INT(Key,Section,Default); Key: expression giving the key to be opened Section: expression giving the section to be read Default: expression giving the default value (if the key or the section does not exist) Example: #constant REG_VV "System\CurrentControlSet\Services\Class\Vvdev" // This example reads the number of VV (TELECOM SCII) cards in the PC. $NbBoard=REG_LOCAL_MACHINE_READ_INT(REG_VV,"nb_board",0); RETURN Returns from an internal procedure or a script ____________________________________________________________________ Description: This command makes it possible to go back to the tree structure after the CALL instruction (16 possible levels). Note: the procedures are unstacked in the order of calling. It is necessary to use structured programming if it is wished to use this type of instruction. Syntax: RETURN(value); value: expression giving the value to be returned Example: ... CALL (NameRecording); .... NameRecording: VOICE_PLAY(" your_name "); Hermès API english version 1.02.doc page 68/113 Date of issue: 30/07/99 Hermes API VOICE_RECORD(5,$details); RETURN(0); Another example: $Status=NameRecording(); // one can also write $Status=CALL(NameRecording); .... NameRecording: VOICE_PLAY(" your_name "); VOICE_RECORD(500, $details); if FILE_SIZE($details)>1000) RETURN(0); else {FILE_DELETE($details); RETURN(1); } RND Generates a random number ____________________________________________________________________ Description: This command makes it possible to obtain a random number between 0 and the number indicated minus 1 Syntax: $Value=RND(NbVal) ; NbVal: Expression giving the number of possible values $Value: Variable in which the random value will be returned Example: $Val=RND(10); // Value returned from 0 to 9 SCK_INIT_CLIENT Opens a TCP/IP socket ____________________________________________________________________ Description: This command makes it possible to open a socket for exchanging information with other programs, etc. It returns a positive value if the socket is properly defined.(See SCK_OK_CLIENT) Hermès API english version 1.02.doc page 69/113 Date of issue: 30/07/99 Hermes API Syntax: $Handle=SCK_INIT_CLIENT(Name); Name: Expression giving the name of the client/server assembly. This name must be located in the .ini file in the form of a section. In order to work, a socket must be opened on one side in client mode and on the other in server mode. On the ONNET side it is opened in client mode; the program on the other side must use ONINT32.DLL with the ExtInitServ entry point. SCK_OK_CLIENT Checks the operation of a TCP/IP socket ____________________________________________________________________ Description: This command makes it possible to ascertain whether or not the socket is set up. It returns a positive value if the socket is set up. Syntax: SCK_OK_CLIENT(Handle,$Status); Example: $Handle=SCK_INIT_INIT (Name); SCK_OK_CLIENT(Handle;$Status); // If $Status>0, the socket is opened on both sides. SCK_ON_CALL SCK_ON_GOTO SCK_OFF Enables/Disables a jump or an internal procedure call ____________________________________________________________________ Description: SCK_ON_GOTO makes it possible to set up a jump which will be performed as soon as the socket contains something to be read, or if it fails. Hermès API english version 1.02.doc page 70/113 Date of issue: 30/07/99 Hermes API SCK_ON_CALL makes it possible to set up a subroutine call. SCK_OFF makes it possible to disable an SCK_ON... type command. Syntax: SCK_ON_GOTO(Handle,Label); SCK_ON_CALL(Handle,Label); SCK_OFF(Handle); SCK_READ_CMD Reads from a TCP/IP socket ____________________________________________________________________ Description: This command makes it possible to read information from the socket. The value returned is negative if the socket is not working, zero if there is nothing to be read and positive in the event of success. If it is ONNET formatting, use STR_TOK to retrieve the command, then EXT_OPTION_I for each parameter. Syntax: $Status=SCK_READ_CMD(Handle,$Value); SCK_STOP_CLIENT Closes a TCP/IP socket ____________________________________________________________________ Description: This command makes it possible to close the socket created with SCK_INIT_CLIENT Syntax: SCK_STOP_CLIENT(Handle); Hermès API english version 1.02.doc page 71/113 Date of issue: 30/07/99 Hermes API SCK_WRITE_CMD Writes to a TCP/IP socket ____________________________________________________________________ Description: This command makes it possible to send information to the socket. Preferably use ONNET formatting with a key word, followed by defined parameters(/upper case letter) and the EXT_OPTION_I function at parameter decoding. Syntax: $Status=SCK_WRITE_CMD(Handle,Value); Example: …. $Temp1="IDENT /R " & $NumCampReception & " /M " & $NumCampTransmission; $Status=SCK_WRITE_CMD($Handle,$Temp1); SCRIPT_CALL Uses another tree structure ____________________________________________________________________ Description: This command makes it possible to leave the current script in order to use another one. Note: at the time of compiling a script, the variables are numbered from 1; on changing from one tree structure to another there is no context saving. It is therefore necessary to manage the variables it is wished to share between the two tree structures, those which do not have to be saved at switching time... Variable 1 of the calling script will be stored at the same location as variable 1 of the called script. Variables of $Sys... type are saved and accessible provided that the monitor include files are the same. Depending on requirements, the following can be performed: • either setting the variables using the variable instruction followed by a number Hermès API english version 1.02.doc page 72/113 Date of issue: 30/07/99 Hermes API • or reserving areas for variables, making the numbers of the variables of the called script start after that of the calling script • or putting all user type variable declarations in the same include file • or a combination of the preceding methods. Syntax: SCRIPT_CALL(path); path: Expression which specifies the name of the drive, the name of the directories and the name of the script file. Example: This command can be used to perform switches to different applications depending on the time, the called number (Direct Dialling In), etc. NET_IN_WAIT_CALL; /* start of call reception */ switch(NET_IN_DNIS) //selection depending on the called number (DDI) {default : NETVOICE_IN_FREE; case 4321 : SCRIPT_CALL(" c :\onnet\weather\weather.onc "); case 4000 : SCRIPT_CALL(" c :\onnet\news\news.onc "); } SCRIPT_NAME Gives the name of the current script ____________________________________________________________________ Description: This command makes it possible to ascertain the path of the name of the script from where this instruction is called. Syntax: $Name=SCRIPT_NAME; $Name: Variable in which the name of the current script will be returned Example: In the file \onnet\001\tree.ons $Tree=SCRIPT_NAME; // $Tree will be equal to \onnet\001\tree.onc SCRIPT_IS_INITIAL Hermès API english version 1.02.doc page 73/113 Date of issue: 30/07/99 Hermes API Makes it possible to ascertain whether the current script is the initial script ____________________________________________________________________ Description: This command returns a value different from 0 if the initial script of this "user" defined in the configuration files is being executed. This instruction is used in the definition of macro-commands to ascertain whether it is necessary to release resources in an abnormal tree structure halt. (See NETVOICE.ONH.) Syntax: $Test=SCRIPT_IS_INITIAL; SCRIPT_RESET End of a script ____________________________________________________________________ Description: This command makes it possible to re-initialize the script. After this command, the instruction which will be executed is the first (include files included) in the initial script defined in the configuration file for this "user". The include files for the NET, VOICE... type servers have instructions, which are automatically added at the start of the tree structure. These instructions make it possible to release the resources used. Therefore, in general, in the event of an error not handled by the script, it is sufficient to put a SCRIPT_RESET instruction in order to halt the current script and release the resources. Note: this instruction is to be used in the event of a problem, or after having performed all the endof-call processings of the hanging up, recording of statistics, etc. type. Syntax: SCRIPT_RESET ; SCRIPT_RETURN Returns to a script ____________________________________________________________________ Description: This command makes it possible to return to the script after the SCRIPT_CALL instruction (16 possible levels). Note: the procedures are unstacked in the order of calling. It is necessary to use structured programming if it is wished to use this type of instruction. Syntax: Hermès API english version 1.02.doc page 74/113 Date of issue: 30/07/99 Hermes API SCRIPT_RETURN; Example: ... SCRIPT_CALL (" c :\onnet\weather\weather.onc "); .... (script weather.onc) VOICE_PLAY(" your_name "); VOICE_RECORD(5,$details); SCRIPT_RETURN; SHELL Starts another Windows application ____________________________________________________________________ Description: This command makes it possible to start an application in the WINDOWS sense. It is equivalent to starting by means of the WINDOWS Run menu. Syntax: SHELL(Application,Window); Application: name of the application Window: 4 = normal window, 6= icon STAT_ADD_CALL STAT_END_CALL STAT_ZONE Manages the call statistics ____________________________________________________________________ Description: STAT_ADD_CALL makes it possible to add a call into the "calls" table in the database defined by the Base parameter in the CONFIG.INI file. STAT_END_CALL makes it possible to validate the record created by the STAT_ADD_CALL command. These two commands make it possible to create a record per call by filling in the following fields in the "calls" table: Hermès API english version 1.02.doc page 75/113 Date of issue: 30/07/99 Hermes API DATE TIME DURATION SCRIPT STAT_ZONE makes it possible to define the entry into part of the tree structure and thus count the number of passes and the cumulative time in this part. Syntax: STAT_ADD_CALL; STAT_END_CALL; STAT_ZONE(ZoneNum); ZoneNum : Expression giving the number of the zone into which entry is made. In the database provided as standard by VOCALCOM, 32 zones have been defined. To change the number of zones, just modify the fields with ACCESS. STR_CMP Compares two character strings. ____________________________________________________________________ Description: This command makes it possible to compare two strings. If they are identical, the value returned is zero. Syntax: $Equal=STR_CMP(string1,string2); string1: Character string expression. string2: Character string expression. The value returned depends on the relationship between the strings: <0 if string1 is less than string2 >0 if string1 is greater than string2 =0 if string1 is equal to string2 STR_INS Inserts a sub-string inside a string ____________________________________________________________________ Description: This command makes it possible to insert a character sub-string at a given position. If the position goes beyond the length of the string, the string is extended with "spaces" to allow insertion at the location indicated. If the length of the result exceeds 255 characters, it is truncated to 255 characters. Syntax: Hermès API english version 1.02.doc page 76/113 Date of issue: 30/07/99 Hermes API $Result=STR_INS(string,sstring,position); string: Character string expression. sstring: Character string expression. position: Expression giving the insertion position for the first character of the sub-string Example: ... $Result=STR_INS(" VALCOM ", "OC ",2) ; // $Result = "VOCALCOM" STR_LEFT Returns a specified number of characters from the left-hand end of a string. ____________________________________________________________________ Description: This command makes it possible to extract a given number of characters, starting from the first character in the string. If the number of characters to be extracted is greater than the length of the string, the string resulting from the extraction is completed with spaces. Syntax: $Result=STR_LEFT(string,length); string: String expression whose leftmost characters are returned length: Numeric expression indicating the number of characters to be returned Example: ... $Result=STR_LEFT("VOCALCOM",3) ; // $Result = "VOC" $Result=STR_LEFT("VOC",4) & "ALCOM" ; //$Result= "VOCALCOM" STR_LEN Returns the number of characters contained in a string. ____________________________________________________________________ Description: This command makes it possible to calculate the length of a character string. Syntax: $Len=STR_LEN(string); string: Character string expression. Hermès API english version 1.02.doc page 77/113 Date of issue: 30/07/99 Hermes API Example: ... $Len=STR_LEN("VOCALCOM") ; // $Len = 8 STR_L_TRIM Removes the spaces at the beginning of a string ____________________________________________________________________ Description: This command makes it possible to remove the spaces at the beginning of a character string. Syntax: $Result=STR_L_TRIM(string); string: Character string expression. Example: ... $Result=STR_L_TRIM(" VOCALCOM"); // $Result = "VOCALCOM" STR_MID Extracts a sub-string from inside a string ____________________________________________________________________ Description: This command makes it possible to extract a character sub-string from a given position. If the position goes beyond the length of the string, an empty string is returned. Syntax: $Result=STR_MID(string,position,length); string: Character string expression. position: Expression giving the position for the extraction length: Expression giving the maximum length of the extracted string Example: ... $Result=STR_MID(" VOCALCOM ",1,5) ; // $Result = "VOCAL" STR_R_CHR Hermès API english version 1.02.doc page 78/113 Date of issue: 30/07/99 Hermes API Looks for a character from the end of a string ____________________________________________________________________ Description: This command makes it possible to look for the last occurrence of a character in a string. If the character is found, the command returns the position of the last occurrence; if it is not found, the function returns the value <=0 Syntax: $Start=STR_R_CHR(string,character); string: Character string expression. character: Character Example: ... $Result=STR_R_CHR("METEO ", "E") ; // $Result = 4 $Result=STR_R_CHR("VOCALCOM ", "Z") ; // $Result = -1 STR_RIGHT Returns a specified number of characters from the right-hand end of a string. ____________________________________________________________________ Description: This command makes it possible to extract a given number of characters from the end of a string. If the number of characters to be extracted is greater than the length of the string, the string resulting from the extraction has spaces at the beginning. Syntax: $Result=STR_RIGHT(string,length); string: String expression whose rightmost characters are returned length: Numeric expression indicating the number of characters to be returned Example: ... $Result=STR_RIGHT("VOCALCOM",3) ; // $Result = "COM" $Result= "VOC" & STR_RIGHT("ALCOM",5) ; //$Result= "VOCALCOM" STR_R_TRIM Hermès API english version 1.02.doc page 79/113 Date of issue: 30/07/99 Hermes API Truncates the spaces at the end of a string ____________________________________________________________________ Description: This command makes it possible to remove the space characters at the end of a character string. Syntax: $Result=STR_R_TRIM(string); string: Character string expression. STR_STR Looks for a sub-string. ____________________________________________________________________ Description: This command makes it possible to look for a sub-string (of one or more characters) in a string. If the sub-string is found, the command returns the position of the first character; if it is not found, the function returns the value <=0 Syntax: $Start=STR_STR(string,sstring); string: Character string expression. sstring: Character string expression to be looked for. Example: ... $Result=STR_STR("VOCALCOM", "OC") ; // $Result = 2 $Result=STR_STR("VOCALCOM", "OH") ; // $Result = -1 STR_TOK Extracts fields from a string ____________________________________________________________________ Description: This command makes it possible to extract fields from a character string. Syntax: $Result=STR_TOK(string,num,token) ; string: Character string expression. Hermès API english version 1.02.doc page 80/113 Date of issue: 30/07/99 Hermes API num: Expression giving the number of the field to be extracted. token: Character string expression giving all the separation characters. Example: ... $Record= "field1,field2 ;field3 !field4 ?field5) ; $Result=STR_TOK($Record,4,",;:!?"); // $Result="field4" STR_TRIM Truncates the spaces at the beginning and end of a string ____________________________________________________________________ Description: This command makes it possible to remove the space characters at the left-hand and right-hand ends of a character string. Syntax: $Result=STR_TRIM(string); string: Character string expression. SWITCH_CODEC_NET_IN Switches the codec to the incoming call ____________________________________________________________________ Description: This command makes it possible to switch the codec to the incoming call. It makes it possible to broadcast sound directly by connecting the codec to a radio, a video tape recorder, etc. Syntax: SWITCH_CODEC_NET_IN(CodecBoard); CodecBoard: Expression giving the number of the voice card from which the codec is taken. SWITCH_CODEC_NET_OUT Switches the codec to the outgoing call ____________________________________________________________________ Description: Hermès API english version 1.02.doc page 81/113 Date of issue: 30/07/99 Hermes API This command makes it possible to switch the codec to the outgoing call. It makes it possible to broadcast sound directly by connecting the codec to a radio, a video tape recorder, etc. Syntax: SWITCH_CODEC_NET_OUT(CodecBoard); CodecBoard: Expression giving the number of the voice card from which the codec is taken. SWITCH_NET_IN_CODEC Switches the incoming call to the codec ____________________________________________________________________ Description: This command makes it possible to switch the incoming call to the codec. It makes it possible to listen to or record the communication. The codec may be connected to a headset, a tape recorder, etc. Syntax: SWITCH_NET_IN_CODEC(CodecBoard); CodecBoard: Expression giving the number of the voice card from which the codec is taken. SWITCH_NET_IN_NET_IN Loops the sound from the incoming call back on itself ____________________________________________________________________ Description: This command makes it possible to cancel any sound transmission to the calling party. Syntax: SWITCH_NET_IN_NET_IN; SWITCH_NET_OUT_CODEC Switches the outgoing call to the codec ____________________________________________________________________ Description: This command makes it possible to switch the outgoing call to the codec. It makes it possible to listen to or record the communication. The codec may be connected to a headset, a tape recorder, etc. Syntax: SWITCH_NET_OUT_CODEC(CodecBoard); CodecBoard: Expression giving the number of the voice card from which the codec is taken. Hermès API english version 1.02.doc page 82/113 Date of issue: 30/07/99 Hermes API SWITCH_NET_OUT_NET_OUT Loops the sound from the outgoing call back on itself ____________________________________________________________________ Description: This command makes it possible to cancel any sound transmission to the outgoing call. Syntax: SWITCH_NET_OUT_NET_OUT; SWITCH_NET_IN_NET_OUT Switches the sound from the incoming call to the outgoing call ____________________________________________________________________ Description: This command makes it possible to switch the sound coming from the incoming call to the outgoing call. Syntax: SWITCH_NET_IN_NET_OUT; SWITCH_NET_OUT_NET_IN Switches the sound from the outgoing call to the incoming call ____________________________________________________________________ Description: This command makes it possible to switch the sound coming from the outgoing call to the incoming call. Syntax: SWITCH_NET_OUT_NET_IN; SWITCH_NET_IN_VOICE Sends the sound from the incoming call to the voice card. ____________________________________________________________________ Description: This command allows the voice card to record the sound or detect the DTMFs of the incoming call. Syntax: SWITCH_NET_IN_VOICE; Hermès API english version 1.02.doc page 83/113 Date of issue: 30/07/99 Hermes API SWITCH_NET_OUT_VOICE Sends the sound from the outgoing call to the voice card ____________________________________________________________________ Description: This command allows the voice card to record the sound or detect the DTMFs of the outgoing call. Syntax: SWITCH_NET_OUT_VOICE; SWITCH_VOICE_NET_IN Sends the sound from the voice card to the incoming call ____________________________________________________________________ Description: This command makes it possible to broadcast the sound from the voice card to the incoming call. Syntax: SWITCH_VOICE_NET_IN; SWITCH_VOICE_NET_OUT Sends the sound from the voice card to the outgoing call ____________________________________________________________________ Description: This command makes it possible to broadcast the sound from the voice card to the outgoing call. Syntax: SWITCH_VOICE_NET_OUT; SYSTEM_VAR_LOAD SYSTEM_VAR_STORE Reads / Modifies a variable in the system area ____________________________________________________________________ Description: These two instructions make it possible to ascertain the value/modify the value of a variable in the system area. They make it possible to set up a dialogue at the level of all the "users" of the ONNET32 monitor. Note: certain system variables are used by the standard macros. Hermès API english version 1.02.doc page 84/113 Date of issue: 30/07/99 Hermes API Syntax: $Variable=SYSTEM_VAR_LOAD(variable) ; SYSTEM_VAR_STORE(variable,value) ; $Variable: expression giving the variable which is going to receive the value coming from the system context. variable: expression giving the number of the variable. value: value which is going to be given to the variable in the system context. SYSTEM_VAR_ON_GOTO SYSTEM_VAR_ON_CALL SYSTEM_VAR_OFF Enables/Disables a jump or an internal procedure call ____________________________________________________________________ Description: SYSTEM_VAR_ON_GOTO makes it possible to set up a jump which will be performed as soon as the specified variable is different from an empty string. SYSTEM_VAR_ON_CALL makes it possible to set up a call which will be performed as soon as the specified variable is different from an empty string. SYSTEM_VAR_OFF makes it possible to disable a SYSTEM_VAR_ON... type command. The specified variable is defined in the system area. Thus an action can be executed following a change in one of the contexts of the server set. Syntax: SYSTEM_VAR_ON_GOTO(variable,label); SYSTEM_VAR_ON_CALL(variable,label); SYSTEM_VAR_OFF(variable); variable: expression giving the number of the variable to be monitored. TIME supplies the system time ____________________________________________________________________ Description: Returns the current system time Syntax: Hermès API english version 1.02.doc page 85/113 Date of issue: 30/07/99 Hermes API $Date=TIME ; // hh :mm :ss TIME_CENT_START Gives the elapsed time, in hundredths of a second, since Windows was started ____________________________________________________________________ Description: This command makes it possible to obtain a time value which makes it possible to perform time calculations easily and also provides a complete restart of Windows for security reasons. Syntax: $Value=TIME_CENT_START ; $Value: Variable in which there will be returned, in 1/100ths of a second, the elapsed time since Windows was last started. TIME_CENT_FROM Gives, in hundredths of a second, the duration with respect to a given time ____________________________________________________________________ Description: This command makes it possible to obtain a positive or negative duration in 1/100ths of a second (within the same day) with respect to a given time in the form HH:MM:SS. Syntax: $Wait=TIME_CENT_FROM(time) ; time: Expression giving a time of the type HH:MM:SS (Note: 00:00 is at the beginning of the day and 24:00 is at the end). $Wait: Variable in which there will be returned, in 1/100ths of a second, the time which has elapsed or is to elapse to reach time. Example: // at midday 12:00:00 $Wait=TIME_CENT_FROM("12:10"); // Value returned is 60000 TIMER_DEF_INIT TIMER_DEF_SYNC Enables an alarm/Waits for the end of an alarm ____________________________________________________________________ Description: Hermès API english version 1.02.doc page 86/113 Date of issue: 30/07/99 Hermes API TIMER_DEF_INIT makes it possible to set up an alarm which will assign the value 1 to an internal variable at the end of a time given in 1/100ths of a second. As soon as this command is initiated, the variable is initialized to an empty string. TIMER_DEF_SYNC makes it possible to wait for the end of the alarm enabled by the TIMER_DEF_INIT command. Syntax: TIMER_DEF_INIT(time) ; TIMER_DEF_SYNC; time: expression giving the waiting time in 1/100ths of a second Example: ... TIMER_DEF_INIT(12000); // at the end of 120sec in internal variable 1 // processing // processing TIMER_DEF_SYNC; // when the 120 seconds have ended, continue. TIMER_VAR_INIT Enables an alarm ____________________________________________________________________ Description: This command makes it possible to set up an alarm which will assign the value 1 to a variable at the end of a time given in 1/100ths of a second. As soon as this command is initiated, the variable is initialized to an empty string. Syntax: TIMER_VAR_INIT(time,$Variable) ; time: expression giving the waiting time in 1/100ths of a second $Variable: variable which will be equal to 1 upon expiry of the time. Example: TIMER_VAR_INIT(12000,$Cooking); // at the end of 120sec, $Cooking=1 UDP_INIT Opens an IP datagram ____________________________________________________________________ Description: Hermès API english version 1.02.doc page 87/113 Date of issue: 30/07/99 Hermes API This command makes it possible to open a datagram for exchanging information with other programs, etc. It returns a positive value in the event of success. Syntax: $Handle=UDP_INIT(WriteHost,WritePort,ReadPort) ; WriteHost: Expression giving the name of the PC for writes WritePort: Expression giving the number of the port for writes ReadPort: Expression giving the number of the port for reads UDP_ON_CALL UDP_ON_GOTO UDP_OFF Enables/Disables a jump or an internal procedure call ____________________________________________________________________ Description: UDP_ON_GOTO makes it possible to set up a jump which will be performed as soon as the datagram contains something to be read. UDP_ON_CALL makes it possible to set up a call. UDP_OFF makes it possible to disable a UDP_ON... type command. Syntax: UDP_ON_GOTO(Handle,Label) ; UDP_ON_CALL(Handle,Label) ; UDP_OFF(Handle) ; UDP_READ_CMD Reads an IP datagram ____________________________________________________________________ Description: This command makes it possible to read information. Hermès API english version 1.02.doc page 88/113 Date of issue: 30/07/99 Hermes API If it is ONNET formatting, use STR_TOK to retrieve the command, then EXT_OPTION_I for each parameter. Syntax: $Status=UDP_READ_CMD(Handle,$Value) ; UDP_STOP Closes the IP datagram ____________________________________________________________________ Description: This command makes it possible to close the datagram created with UDP_INIT Syntax: UDP_STOP(Handle) ; UDP_WRITE_CMD Writes an IP datagram ____________________________________________________________________ Description : This command makes it possible to send information. Preferably use ONNET formatting with a key word, followed by defined parameters (/upper case letter) and the EXT_OPTION_I function at parameter decoding. Syntax: $Status=UDP_WRITE_CMD(Handle,Value) ; Example: …. $Temp1="IDENT /R " & $NumCampReception & " /M " & $NumCampTransmission; $Status=UDP_WRITE_CMD($Handle,$Temp1); USER_NUMBER gives the context number Hermès API english version 1.02.doc page 89/113 Date of issue: 30/07/99 Hermes API ____________________________________________________________________ Hermès API english version 1.02.doc page 90/113 Date of issue: 30/07/99 Hermes API REMARQUES EN ROUGE Page 9: SICK_INIT_CLIENT - au lieu de SICK_INIT_INIT? Page 17: STR_MID - au lieu de STR_INS? Description: This instruction makes it possible to ascertain the number of the current context. It is useful, for example, with USER_VAR.... type instructions. Syntax: $User=USER_NUMBER ; $User: variable receiving the context number USER_VAR_ON_GOTO USER_VAR_ON_CALL USER_VAR_OFF Enables/Disables a jump or an internal procedure call ____________________________________________________________________ Description: USER_VAR_ON_GOTO makes it possible to set up a jump which will be performed as soon as the specified variable is different from an empty string. USER_VAR_ON_CALL makes it possible to set up a call which will be performed as soon as the specified variable is different from an empty string. USER_VAR_OFF makes it possible to disable a USER_VAR_ON... type command. The specified variable is defined in the context of another telephone line (or user). Thus an action can be executed following a change in another context. Syntax: USER_VAR_ON_GOTO(user,variable,label) ; USER_VAR_ON_CALL(user,variable,label) ; USER_VAR_OFF(user,variable) ; user: expression giving the number of the context to which the variable belongs variable: expression giving the number of the variable to be monitored USER_VAR_LOAD Hermès API english version 1.02.doc page 91/113 Date of issue: 30/07/99 Hermes API USER_VAR_STORE Reads / Modifies a variable in another context ____________________________________________________________________ Description: These two instructions make it possible to ascertain the value/ modify the value of a variable in another context. They make it possible to set up a dialogue between two "users" at the level of the ONNET32 monitor. They are to be used for the current user if the other users have instances of USER_VAR_ON_GOTO and WAIT_USER_VAR. Syntax: $Variable=USER_VAR_LOAD(user,variable) ; USER_VAR_STORE(user,variable,value) ; $Variable: variable which is going to receive the value coming from the other context. user: expression giving the number of the context to which the variable belongs variable: expression giving the number of the variable. value: value which is going to be given to the variable of the other context VAL Supplies the numeric value represented in a character string ____________________________________________________________________ Description: This command makes it possible to convert a character string into a 32-bit integer. Syntax: $Value=VAL(value) ; Value: Expression giving a numeric value $Value: Variable in which the integer value will be returned Example: $Val=VAL("000012"); // $VAL=12 VAR_LOAD VAR_STORE Reads / Modifies a variable in the current context ____________________________________________________________________ Hermès API english version 1.02.doc page 92/113 Date of issue: 30/07/99 Hermes API Description: These two instructions make it possible to ascertain the value/ modify the value of a variable in the current context. Syntax: VAR_LOAD(variable) ; VAR_STORE(variable) ; variable: expression giving the number of the variable. VAR_ON_GOTO VAR_ON_CALL VAR_OFF Enables/Disables a jump or an internal procedure call ____________________________________________________________________ Description: VAR_ON_GOTO makes it possible to set up a jump in the script which will be performed as soon as the specified variable is different from an empty string. VAR_ON_CALL makes it possible to set up a call which will be performed as soon as the specified variable is different from an empty string. VAR_OFF makes it possible to disable a VAR_ON... type command. Syntax: VAR_ON_GOTO(variable,label) ; VAR_ON_CALL(variable,label) ; VAR_OFF(variable) ; variable: variable which is monitored Example: The following examples are drawn from the include file NETVOICE.ONH. The two macro-commands make it possible to activate and de-activate a jump in the event of hanging up being detected. (The variable $SysNetEnd is also defined in the include file) #function NET_IN_RLIB_ON(label) {VAR_ON_GOTO($SysNetEnd;label);} #function NET_IN_RLIB_OFF {VAR_OFF($SysNetEnd);} VAR_OFF_ALL Hermès API english version 1.02.doc page 93/113 Date of issue: 30/07/99 Hermes API Disables all jumps and calls ____________________________________________________________________ Description: VAR_OFF_ALL makes it possible to de-activate all VAR_ON..., SYSTEM_VAR_ON..., GLOBAL_VAR_ON..., USER_VAR_ON... type commands in the current user. Syntax: VAR_OFF_ALL ; VBASE_ADD_NEW Adds a new record ____________________________________________________________________ Description: This command makes it possible to create a new record whose fields will be initialized using VBASE_WRITE or automatically with the default values defined in ACCESS. They return a positive value in the event of success. Note: VBASE_UPDATE must be called at the end of the writes in order to validate the record. Syntax: $Status=VBASE_ADD_NEW(Resource); Resource: Expression giving the resource number VBASE_ADD_WRITE Performs additions on one or more fields of a record ____________________________________________________________________ Description: This command makes it possible to add an individual value to one or more fields. It is useful for quickly incrementing a field without being required to read it, perform the addition and rewrite it. It returns a positive value in the event of success. Note: it is first necessary to be positioned on a record, and writing must be possible either with VBASE_EDIT, or with VBASE_ADD_NEW. Syntax: $Status=VBASE_ADD_WRITE(Resource,Field,Addition); Resource: Expression giving the resource number Hermès API english version 1.02.doc page 94/113 Date of issue: 30/07/99 Hermes API Field: Expression giving the field name Addition: Expression giving the value This command makes it possible to add values to a number of fields simultaneously (see example); for this reason, the field names and field values must not contain commas. Example: $Status=VBASE_ADD_WRITE($Resource,"CALLS",1) ; Adds 1 to the "CALLS" field of the record to which the position is set. $Status=VBASE_ADD_WRITE($Resource,"CALLS,DURATION",(1,$Duration)); Adds 1 to the "CALLS" field of the record to which the position is set. Adds $Duration to the " DURATION" field of the record to which the position is set. Pay attention to complying with the use of commas and brackets. VBASE_ALLOC VBASE_ALLOC_NOT_EMPTY VBASE_FREE Allocates/De-allocates a resource to a database table ____________________________________________________________________ Description: VBASE_ALLOC makes it possible to allocate oneself a resource which will make it possible to access a set of records in a database. It returns a strictly positive resource value in the event of success. VBASE_ALLOC_NOT_EMPTY makes it possible to allocate oneself a resource which will make it possible to access a non-empty set of records in a database. It returns a strictly positive resource value in the event of success. VBASE_FREE makes it possible to de-allocate a database resource. Syntax: VBASE_ALLOC($Resource,Base,Connection,Table,snapshot); VBASE_ALLOC_NOT_EMPTY($Resource,Base,Connection,Table,snapshot); VBASE_FREE($Resource); $Resource: Variable in which the resource number will be returned Base: Expression giving the name/path of the database (see below) Hermès API english version 1.02.doc page 95/113 Date of issue: 30/07/99 Hermes API Connection: Expression giving the connection type (see below) Table: Expression giving the name of the table or SQL query selecting elements. Snapshot : Expression able to take the values 0 and 1: 0 = the modifications performed on the database are seen dynamically. 1 = at the instant of allocation, a fixed "photograph" is taken of the database and it cannot be modified. This parameter is used where table is an SQL query. Access/Jet "" "drive:\path\filename.MDB" dBASE III "dBASE III;" "drive:\path" dBASE IV "dBASE IV;" "drive:\path" dBASE V "dBASE 5.x;" "drive:\path" Paradox 3.x "Paradox 3.x;" "drive:\path" Paradox 4.x "Paradox 4.x;" "drive:\path" Btrieve "Btrieve;" "drive:\path\filename.DDF" FoxPro 2.0 "FoxPro 2.0;" "drive:\path" FoxPro 2.5 "FoxPro 2.5;" "drive:\path" FoxPro 2.6 "FoxPro 2.6;" "drive:\path" Excel 3.0 "Excel 3.0;" "drive:\path\filename.XLS" Excel 4.0 "Excel 4.0;" "drive:\path\filename.XLS" Excel 5.0 "Excel 5.0;" "drive:\path\filename.XLS" Text "Text;" " drive:\path" Note: VOCALCOM delivers as standard ACCESS, DBASE IV, DBASE V, EXCEL 5. Example: VBASE_ALLOC($Res,"\onnet\onnet.mdb","","CALLS"); VBASE_ALLOC($Res,$Base,"","SELECT * FROM CALLS WHERE Date = " & DATE_SQL(DATE)); VBASE_ALLOC($Res,$Base,"","SELECT COUNT(DURATION) as TOTAL FROM CALLS WHERE Date =" & DATE_SQL(DATE)); Hermès API english version 1.02.doc page 96/113 Date of issue: 30/07/99 Hermes API VBASE_DELETE Destroys the current record ____________________________________________________________________ Description: This command makes it possible to destroy the current record. Syntax: VBASE_DELETE(Resource); Resource : Expression giving the resource number VBASE_EDIT VBASE_UPDATE Starts/Ends the updating of a record ____________________________________________________________________ Description: These commands make it possible to update a record. VBASE_EDIT must be called before any modification of an existing record. They return a positive value in the event of success. Note: it is first necessary to be positioned on a record. Pay attention to the status returned by VBASE_UPDATE: if, between the VBASE_EDIT instruction and the VBASE_UPDATE, another user has modified the record, the status will be negative and the modifications not carried out. The value of an index field defined with no duplicates may create a duplicate...and therefore the modifications will not be carried out... Syntax: $Status=VBASE_EDIT(Resource); ... $Status=VBASE_UPDATE(Resource); Resource: Expression giving the resource number VBASE_EXECUTE Executes a query on a database ____________________________________________________________________ Description: Hermès API english version 1.02.doc page 97/113 Date of issue: 30/07/99 Hermes API This command makes it possible to send an execution type query to a database. It returns a positive value in the event of success. Syntax: $Status=VBASE_EXECUTE(Base,Connection,Query); Base: Expression giving the name/path of the database (see above) Connection: Expression giving the connection type (see above) Query: Expression giving the query to be executed Note: the VBASE_ type instructions are directly executed by the ONNET32 monitor with a wait for the result. The query must therefore be quick to execute, otherwise ask for information from VOCALCOM for the provision of DB type instructions which make it possible also to work with ODBC and which operate asynchronously like the NET, VOICE, etc. type servers. Example: //information is kept over a period of two months $temp=DATE_SQL(DATE_ADD("m",0-2,DATE)); $temp=VBASE_EXECUTE($Base,"","DELETE * FROM CALLS WHERE Date=" & $temp); VBASE_FIND_FIRST VBASE_FIND_NEXT VBASE_FIND_PREVIOUS VBASE_FIND_LAST Moves to the first, to the next ... record ____________________________________________________________________ Description: These commands make it possible to move from one record to another among records which satisfy a given condition after having allocated oneself a resource with VBASE_ALLOC. They return a positive value in the event of success. Note: the quickest method to position oneself on a given record is using VBASE_SEEK. Syntax: $Status=VBASE_FIND_FIRST(Resource,Criterion); $Status=VBASE_FIND_NEXT(Resource,Criterion); $Status=VBASE_FIND_PREVIOUS(Resource,Criterion); Hermès API english version 1.02.doc page 98/113 Date of issue: 30/07/99 Hermes API $Status=VBASE_FIND_LAST(Resource,Criterion); Resource: expression giving the resource number Criterion: SQL type expression specifying a criterion Note: the VBASE_ type instructions are directly executed by the ONNET32 monitor with a wait for the result; the function must therefore be quick to execute, otherwise ask for information from VOCALCOM for the provision of DB type instructions which make it possible also to work with ODBC and which operate asynchronously like the NET, VOICE, etc. type servers. Example: $Status=VBASE_FIND_FIRST($Resource,"TOWN = ‘PARIS’ ") ; VBASE_MOVE_FIRST VBASE_MOVE_NEXT VBASE_MOVE_PREVIOUS VBASE_MOVE_LAST Moves to the first, to the next ... record ____________________________________________________________________ Description: These commands make it possible to move from one record to another without applying any condition after having allocated oneself a resource with VBASE_ALLOC. They return a positive value in the event of success. Note: the quickest method to position oneself on a given record is using VBASE_SEEK. Syntax: $Status=VBASE_MOVE_FIRST(Resource); $Status=VBASE_MOVE_NEXT(Resource); $Status=VBASE_MOVE_PREVIOUS(Resource); $Status=VBASE_MOVE_LAST(Resource); Resource : Expression giving the resource number Note: the VBASE_ type instructions are directly executed by the ONNET32 monitor with a wait for the result; the function must therefore be quick to execute, otherwise ask for information from VOCALCOM for the provision of DB type instructions which make it possible also to work with ODBC and which operate asynchronously like the NET, VOICE, etc. type servers. VBASE_READ Reads one or more fields of a record Hermès API english version 1.02.doc page 99/113 Date of issue: 30/07/99 Hermes API ____________________________________________________________________ Description: This command makes it possible to read the value of one or more fields. It returns a positive value in the event of success. Note: it is first necessary to be positioned on a record. Syntax: $Status=VBASE_READ(Resource,Field,$Value); Resource: Expression giving the resource number Field: Expression giving the field name $Value: Variable in which the value of the field will be written This command makes it possible to read a number of fields simultaneously (see example); for this reason, the field names and field values must not contain commas. Example: $Status=VBASE_READ($Resource,"TEL",$Tel) ; $Status=VBASE_READ($Resource,"TEL,TOWN",($Tel,$Town)) ; This instruction reads, in one go, the field TEL and the field TOWN which will be returned respectively in the variables $Tel and $Town. Pay attention to complying with the use of commas and brackets. VBASE_SEEK Positions on a record ____________________________________________________________________ Description: This command searches in the specified index for the record which satisfies the specified criteria. It returns a positive value in the event of success. This is the quickest method when VBASE_ALLOC corresponds to a database table; it works only in this case. Syntax: $Status=VBASE_SEEK(Resource,Index,Comparison,Value); Resource: Expression giving the resource number Index: Expression giving the name of an existing index in the database Hermès API english version 1.02.doc page 100/113 Date of issue: 30/07/99 Hermes API Comparison: One of the following expressions: "<" ">" "=" "<=" ">=" Value: Expression giving the value of the comparison Example: $Status=VBASE_SEEK($Resource,"TEL","=","0155373050") ; VBASE_SELECT_READ Opening + Reading of a database table ____________________________________________________________________ Description: VBASE_SELECT_READ makes it possible to combine the three instructions VBASE_ALLOC, VBASE_READ and VBASE_FREE into a single one. It returns a strictly positive resource value in the event of success. Syntax: VBASE_SELECT_READ(Base,Connection,Table,Field,$Value); Base: Expression giving the name/path of the database (see below) Connection: Expression giving the connection type (see below) Table: Expression giving the name of the table or SQL query selecting elements. Field: Expression giving the field name $Value: Variable in which the value of the field will be written Example: $Temp3="SELECT COUNT(DURATION) as TOTAL FROM CALLS WHERE Date = " & DATE_SQL(DATE); $Temp2=0; VBASE_SELECT_READ($Base,"",$Temp3,"TOTAL",$Temp2); DISPLAY_PANEL(1,$Temp2 & " Calls"); VBASE_WRITE Writes one or more fields of a record ____________________________________________________________________ Hermès API english version 1.02.doc page 101/113 Date of issue: 30/07/99 Hermes API Description: This command makes it possible to write the value of one or more fields. It returns a positive value in the event of success. Note: it is first necessary to be positioned on a record and writing must be possible either with VBASE_EDIT, or with VBASE_ADD_NEW. Syntax: $Status=VBASE_WRITE(Resource,Field,Value); Resource: Expression giving the resource number Field: Expression giving the field name Value: Expression giving the value This command makes it possible to write a number of fields simultaneously (see example); for this reason, the field names and field values must not contain commas. Example: $Status=VBASE_WRITE($Resource,"TEL","0155373050") ; $Status=VBASE_WRITE($Resource,"TEL,TOWN","0155373050,FIELD") ; $Tel="0155373050"; $Town="FIELD"; $Status=VBASE_WRITE($Resource,"TEL,TOWN",($Tel,$Town)) ; These last two VBASE_WRITE instructions write the TEL field and the TOWN field in one go. Pay attention to complying with the use of commas and brackets. VOICE_ALLOC VOICE_FREE Allocates/De-allocates a voice resource _______________________________________________________________________ Description: VOICE_ALLOC makes it possible to allocate oneself a voice resource. In general, this command is not used explicitly, since it is included in the NETVOICE_IN_ACCEPT and NETVOICE_OUT_ACCEPT instructions. VOICE_FREE de-allocates the resource allocated by the VOICE_ALLOC command. In general, this command is not used explicitly, since it is included in the NETVOICE_IN_FREE and NETVOICE_OUT_FREE instructions. Hermès API english version 1.02.doc page 102/113 Date of issue: 30/07/99 Hermes API Syntax: VOICE_ALLOC; VOICE_FREE; VOICE_NOISE_DETECT Detects a sound event _______________________________________________________________________ Description: This command makes it possible to implement a voice pointer. Syntax: $Functime =VOICE_NOISE_DETECT(Maxnoisetime,Maxfunctime); $Functime: Variable in which the duration of the function will be returned Maxnoisetime: Expression giving the time, in hundredths of a second, of the duration of the noise, which will stop the function Maxfunctime: Expression giving the time, in hundredths of a second, for the entire function VOICE_GET_DTMF Reads the keys pressed on the telephone keypad ____________________________________________________________________ Description: This command makes it possible to record, in a variable, the DTMFs entered on a telephone keypad. Syntax: VOICE_GET_DTMF(Dtmfnb,Maxfunctime,$Dtmfstr,dtmfend,dtmfinter,dtmfcmp,beep); Dtmfnb: Expression giving the number of DTMFs expected Maxfunctime: Expression giving the time, in hundredths of a second, for the entire input $Dtmfstr: Variable in which the DTMFs entered will be returned dtmfend: Expression giving the DTMF(s) on which the input ends dtmfinter: Expression giving the time, in hundredths of a second, between 2 DTMFs; if the value is negative, this time is taken into account for the input of the first DTMF. dtmfcmp: Expression giving the DTMF sequence which stops the function as soon as it is input. beep: Parameter indicating the issuing of a beep Example: Hermès API english version 1.02.doc page 103/113 Date of issue: 30/07/99 Hermes API VOICE_GET_DTMF (5,500,$Code,dtmfcmp="*0#"); 5 DTMFs are expected during 5 seconds; they will be returned in the variable Code, and the sequence *0# stops the function if it is input. VOICE_GET_DTMF (2,700,$Choice,dtmfend="1*",beep=1); 2 DTMFs are expected during 7 seconds; they will be returned in the variable Choice, the DTMFs which will stop the input will be either 1 or * and a beep will be generated. VOICE_PLAY Broadcasts a message ____________________________________________________________________ Description: This command allows broadcasting of a message. Syntax: VOICE_PLAY (Msg,pos,len,dtmfnb,dtmfstr,dtmfend,dtmfinter,dtmfcmp,dtmfclear); Msg: Expression giving the name of the message to be played pos: Expression giving, in bytes, the location of the message from which the broadcast starts len: Expression giving the length of the message to be broadcast dtmfnb: Expression giving the number of DTMFs expected for interrupting broadcasting of the message (anticipation) dtmfstr: Variable in which the DTMFs entered will be returned dtmfend: Expression giving the DTMF(s) on which broadcasting of the message ends dtmfinter: Expression giving the time, in hundredths of a second, between 2 DTMFs; if the value is negative, this time is taken into account for the input of the first DTMF. dtmfcmp: Expression giving the DTMF sequence which stops the function as soon as it is input. dtmfclear: Expression which can take the following values: 1 = purges the DTMFs present at the start of the function 2 = purges the DTMFs present at the end of the function 3 = purges the DTMFs present at the start and at the end of the function 4 = purges the DTMFs present in the middle of the function 5 = purges the DTMFs present at the start and in the middle of the function 6 = purges the DTMFs present at the end and in the middle of the function 7 = purges the DTMFs present at the start, at the end and in the middle of the function Hermès API english version 1.02.doc page 104/113 Date of issue: 30/07/99 Hermes API Example: VOICE_PLAY("hello",dtmfstr=$Code,dtmfcmp="*139#"); broadcasting of the message hello with storage of the DTMFs entered in the variable $Code and with stopping of the broadcast on the sequence *139# VOICE_PLAY_BACKGRD Broadcasts a message in the background ____________________________________________________________________ Description: This command allows broadcasting of a sound message in the background during a connection, a database search, etc. This function is interrupted either at the end of the message or with the function VOICE_STOP_FUNCTION. Syntax: VOICE_PLAY_BACKGRD(Msg); Msg: Expression giving the name of the message to be played VOICE_PLAY_ENTRY Broadcasts an area of an indexed file ____________________________________________________________________ Description: This command makes it possible to broadcast an area of an indexed file recorded with the VOICE_RECORD_ENTRY function. For example, in the voice sphere of activity, the name of a person can be stored in area 1, his town in area 2, etc. This organisation will make it possible to listen to the details again more easily. Syntax: VOICE_PLAY_ENTRY(Entry,Msg,dtmfend); Entry: Expression giving the area number Msg: Expression giving the name of the message to be played dtmfend: Expression giving the DTMF(s) on which broadcasting of the message ends Example: VOICE_PLAY_ENTRY(1, "address",dtmfend="*#"); Hermès API english version 1.02.doc page 105/113 Date of issue: 30/07/99 Hermes API The function will broadcast area 1 of the message named "address", with stopping of the broadcast if the DTMFs * or # are entered. VOICE_PLAY_ENTRY_LIST Broadcasts areas of an indexed message ____________________________________________________________________ Description: This command allows easy construction of a generator of numbers, dates, etc. Syntax: VOICE_PLAY_ENTRY_LIST(Msg,SectionList,dtmfend); Msg: Expression giving the name of the message to be played SectionList: Expression giving the list of section numbers separated by commas dtmfend: Expression giving the DTMF(s) on which broadcasting of the message ends Example: VOICE_PLAY_ENTRY_LIST("date","1,100,296"dtmfend="*#"); In entry 1 = first In entry 100 = January In entry 296 = 1996 The function will broadcast the message: 1st January 1996, with stopping of the broadcast if the DTMFs * or # are entered. VOICE_PLAY_STOPPED Tests an interruption of a message ____________________________________________________________________ Description: This command makes it possible to test whether a message broadcast by the VOICE_PLAY instruction has been interrupted by a DTMF. Syntax: if(VOICE_PLAY_STOPPED)..............; Example: VOICE_PLAY(" welcome ",dtmfnb=1); if (VOICE_PLAY_STOPPED) GOTO(Summary); .... Hermès API english version 1.02.doc page 106/113 Date of issue: 30/07/99 Hermes API Summary: ..... VOICE_RECORD Records a message ____________________________________________________________________ Description: This command makes it possible to record a message. Syntax: VOICE_RECORD(Msg,Rectime,beep,dtmfinit,voiceinit,stopsil,maxfunctime,dtmfnb, dtmfstr,dtmfend,dtmfinter,dtmfclear); Msg: Expression giving the number of the message to be recorded. Rectime: Expression giving the time, in hundredths of a second, for recording the message. beep: Parameter indicating that recording starts on a beep dtmfinit: Parameter indicating on which DTMFs recording starts voiceinit: Parameter indicating that recording starts on noise stopsil: Expression giving the time, in hundredths of a second, of the duration of silence on which recording will stop maxfunctime: Expression giving the time, in hundredths of a second, for the entire function dtmfnb: Expression giving the number of DTMFs expected for interrupting message recording dtmfstr: Variable in which the DTMFs entered will be returned dtmfend: Expression giving the DTMF(s) on which recording ends dtmfinter : Expression giving the time, in hundredths of a second, between 2 DTMFs; if the value is negative, this time is taken into account for the input of the first DTMF. dtmfclear: Expression which can take the following values: 1 = purges the DTMFs present at the start of the function 2 = purges the DTMFs present at the end of the function 3 = purges the DTMFs present at the start and at the end of the function 4 = purges the DTMFs present in the middle of the function 5 = purges the DTMFs present at the start and in the middle of the function 6 = purges the DTMFs present at the end and in the middle of the function 7 = purges the DTMFs present at the start, at the end and in the middle of the function Hermès API english version 1.02.doc page 107/113 Date of issue: 30/07/99 Hermes API Example: VOICE_RECORD(1222,1000,dtmfinit="1*"); Recording in file 1222 for 10 seconds; recording starts on input of the DTMFs 1 or *. VOICE_RECORD(1222,1000,dtmfend=VOICE_ALL_DTMF); Recording in file 1222 for 10 seconds; recording ends on input of any DTMF. VOICE_RECORD(1222,1000,beep=1); Recording in file 1222 for 10 seconds; recording starts after the sound beep. VOICE_RECORD(1222,1000,voiceinit=1,maxfunctime=2000); Recording in file 1222 for 10 seconds; recording starts as soon as the person speaks, and the function will last a maximum of 20 seconds (it is also possible to put a detection of remote hang up NET_IN_RLIB instead of the maxfunctime parameter). VOICE_RECORD_ENTRY Records an area of an indexed message ____________________________________________________________________ Description: This command makes it possible to record an area of an indexed message. The FILE_ENTRY_CREATE instruction must be called first to create the indexed file. Syntax: VOICE_RECORD_ENTRY(Entry,Msg,Rectime,beep,dtmfinit,voiceinit,stopsil,maxfunctime, dtmfnb, dtmfstr,dtmfend,dtmfinter,dtmfclear); Entry: Expression giving the number of the area Msg: Expression giving the number of the message to be recorded. Rectime: Expression giving the time, in hundredths of a second, for recording the message. beep: Parameter indicating that recording starts on a beep dtmfinit: Parameter indicating on which DTMFs recording starts voiceinit: Parameter indicating that recording starts on noise stopsil: Expression giving the time, in hundredths of a second, of the duration of silence on which recording will stop maxfunctime: Expression giving the time, in hundredths of a second, for the entire function dtmfnb: Expression giving the number of DTMFs expected for interrupting recording of the message dtmfstr: Variable in which the DTMFs entered will be returned Hermès API english version 1.02.doc page 108/113 Date of issue: 30/07/99 Hermes API dtmfend: Expression giving the DTMF(s) on which recording ends dtmfinter: Expression giving the time, in hundredths of a second, between 2 DTMFs; if the value is negative, this time is taken into account for the input of the first DTMF. dtmfclear: Expression which can take the following values: 1 = purges the DTMFs present at the start of the function 2 = purges the DTMFs present at the end of the function 3 = purges the DTMFs present at the start and at the end of the function 4 = purges the DTMFs present in the middle of the function 5 = purges the DTMFs present at the start and in the middle of the function 6 = purges the DTMFs present at the end and in the middle of the function 7 = purges the DTMFs present at the start, at the end and in the middle of the function Example: FILE_ENTRY_CREATE("details",3); creation of the details file with 3 areas. VOICE_RECORD_ENTRY(1,"details",10000,dtmfinit="1*"); Recording in area 1 of the details file for 10 seconds; recording starts on input of the DTMFs 1 or *. VOICE_RECORD_ENTRY(2,"details",10000,dtmfinit="1*"); Recording in area 2 of the details file for 10 seconds; recording starts on input of the DTMFs 1 or *. VOICE_RECORD_ENTRY(3,"details",10000,dtmfinit="1*"); Recording in area 3 of the details file for 10 seconds; recording starts on input of the DTMFs 1 or *. VOICE_SILENCE_DETECT Detects a silence _______________________________________________________________ Description: This command makes it possible to detect a silence Syntax: $Functime =VOICE_SILENCE_DETECT(Maxsiltime,Maxfunctime); $Functime: Variable in which the duration of the function will be returned Maxsiltime: Expression giving the time, in hundredths of a second, of the duration of the silence, which will stop the function Hermès API english version 1.02.doc page 109/113 Date of issue: 30/07/99 Hermes API Maxfunctime: Expression giving the time, in hundredths of a second, for the entire function VOICE_STOP_FUNCTION Stops a voice function _______________________________________________________________ Description: This command makes it possible to interrupt a VOICE_PLAY_BACKGRD type function. Syntax: VOICE_STOP_FUNCTION; VOICE_SYNC Synchronizes progression through the tree structure _______________________________________________________________ Description: This command makes it possible to synchronize progression through the tree structure with the end of a VOICE..._BACKGRD type function Note: In this documentation, only the VOICE_PLAY_BACKGRD instruction is documented. Consult VOCALCOM for the other implementations. Syntax: VOICE_SYNC; Example: VOICE_PLAY_BACKGRD("MusicThenEventMessage"); $status=.... // database access processing if ($status==0) {VOICE_STOP_FUNCTION; // OK from the database ...... // Voice broadcast of database information } else {VOICE_SYNC;SCRIPT_END;} // in the event of PB, the event message is broadcast in full. WAIT Timing wait Hermès API english version 1.02.doc page 110/113 Date of issue: 30/07/99 Hermes API ____________________________________________________________________ Description: This command makes it possible to perform a pause in the script; the duration is given in hundredths of a second. Syntax: WAIT(duration); duration: Expression giving the pause time in 1/100ths of a second Example: ... WAIT(1000); /* 10 sec timeout */ WAIT_VAR Waits for modification of a variable ____________________________________________________________________ Description: WAIT_VAR waits until the specified variable is different from an empty string. Syntax: WAIT_VAR(variable); variable: Variable which is monitored WAIT_USER_VAR Waits for modification of a variable in another context ____________________________________________________________________ Description: WAIT_USER_VAR waits until the specified variable is different from an empty string. The specified variable is defined in the context of another telephone line (or user). Thus an action can be executed following a change in another context. Syntax: WAIT_USER_VAR(user,variable); user: Expression giving the number of the context to which the variable belongs variable: Expression giving the number of the variable to be monitored. ANNEXE 1 Hermès API english version 1.02.doc page 111/113 Date of issue: 30/07/99 Hermes API BASIC INSTRUCTION SET MOD % ADD + ACD generates a series of values/addresses separated by a comma SUB MUL * DIV / LES < GRT > AND && OR || GTE >= LEE <= NE != EQ == CAT & NOT ! IIV loads a 32-bit integer value on the stack ISV loads a character string on the stack LAV loads the address of a variable on the stack SVV stores the content of the stack in a variable LVV loads the value of a variable on the stack SOP defines the option for a "server" instruction JMP performs an unconditional jump to an address JMF performs a jump to an address if the value of the top of the stack is false RTN subroutine return SRN return from a script LAB label SWI selection type instruction Hermès API english version 1.02.doc page 112/113 Date of issue: 30/07/99 Hermes API END instruction for re-initialization to the initial situation CAL subroutine call SCA calling of another script WAI wait on a variable (#0) SCS initiation of a server command SCB initiation of a Visual Basic server command SCI initialization of a server command ONN activation of a subroutine call on a variable OFF de-activation LAU loads, on the stack, the address of a USER area variable LAG loads, on the stack, the address of a global area variable LAS loads, on the stack, the address of a system area variable LOD loads, on the stack, the value corresponding to the address on the stack STO stores the value of the stack, at the address contained in the stack MTK multi-channel locking / unlocking TIM enabling of a timer USR stores the user number on the stack VCA subroutine call using a variable VJM jump using a variable ACC additional functions STR character string processing functions FIL file processing functions VBX functions implemented in Visual Basic Hermès API english version 1.02.doc page 113/113 Date of issue: 30/07/99