Contact Caller
Ready-To-Run Applications

Copyright © 1986-2008 Stok Software, Inc.


Want a Printed Manual?

168 Page
Contact Caller
Programming
Manual
$14.90

There are three fully working Ready-To-Run Application Programs included with Contact Caller. They can be used as-is or modified to your needs.






 


Contact Caller's
Script Programming Code


Contact Caller allows script in the form of records. Each record must have a record number preceded by a colon. Record numbers can be skipped but need to be in ascending order. Each record can actually contain up to three lines of code.

Executable code must be preceded with a slash "/" and terminated with a semi-colon ";". Anything else is considered a comment.

A unique feature of Contact Caller is that speech prompts can be recorded along with any script record. This is done with CCEDIT, the programming utility that comes with Contact Caller. The script itself will guide the flow of the program. If only a prompt is recorded and there is no script, then the flow of the program continues with the next record after the prompt is played.

Comments can be used to specify speech that is spoken in any particular record. As Contact Caller executes each record of a script, it first plays the speech (if any) and then performs the function based on the script between "/" and ";" as explained above. The following is the source code of the Contact Caller Outbound Message Delivery Program.


Order Entry Program


The Order Entry Program will allow a caller to place an order using a touch tone phone.


Files Used For Order Entry Program

          ORDER.CC       Program Prompt File
          CONTROL.CTL       Control file for ORDER.CC
          SALESNO.DAT       Input file - Valid Salesperson ID's



Usage Description of the Order Entry Program

The Order Entry application allows salespersons to call into the system to enter an item or items they would like to order. A detailed description of each step of the caller session follows. The source code is below.

  1. The salesperson's four digit ID is requested and is checked for validity against a lookup file ("salesno.dat" as specified in the control file). If not valid, the program repeats the request up to three times. For this demo, the valid ID's are 1234, 2255, 7788, 5546, and 1100.

  2. A log of this call is written to file #1. Note that at this point the local variable, V2 gets the value of the global variable GV2, so that this value - used both in the data records and as a header in the recorded message for this caller - will not change during the session. A call on another line will now get the incremented value of GV2.

  3. In prompts 218-221 an item number is requested, and if not entered (or if too few or too many keys are entered), the program loops back to prompt 219 to repeat the request for the item number. When the item number is entered, it is spoken back to the caller and saved in variable S10.

  4. In a manner similar to the request for an item number, the number of items, price per item, and customer phone number is requested. Upon entry, the entered value is spoken back to the caller, and is saved in a variable.

  5. The values relating to this order are written to file #1.

  6. The caller may now choose to enter another item. If he does, the program will branch back to the request for item number (prompt 220) and continues on from there. If the caller does not want to enter another item, he will be asked for a shipping address, which is recorded and stored with the "/R" command. Note that part of the header, S2, is the value of V2 converted to a string. The filename of the recorded message (formatted in record 400) also includes this value.

  7. The system repeats the shipping address and hangs up.



Program Settings Before You Use

You need to set parameters to tell Contact Caller how to run the program. You do this with the maintenance program, CCMAINT. To set parameters for this program, type the command...

C:>ccmaint

Note that CCMAINT will edit the control file called "control.ctl" unless you specify a name in the command line. The control file for the Order Entry program is control.ctl so there is no need to specify a different name.

You need to examine the "General System Parameters" in CCMAINT menu "A" and make sure you have the proper values set for the "Hardware interrupt" and the "Software interrupt".

You also need to set the "Phone Line Modes" in CCMAINT menu "C". For starters, specify "Inbound" for lines 1 and 2. Specify "Outbound" 3 and 4. You may want to select different arrangements for your needs.

Finally, you need to specify the "Starting Record for Each Line" in CCMAINT menu "D". This is 200 for all lines. In the program listing below you can see that 200 is where the program starts.

You may want to examine other CCMAINT settings and you will notice that the following parameters are already set for you. You may change these as per your needs.

Program: ORDER.CC
Delay between calls: 1
Retries for invalid entry: 2
Wait time for user input: 6
File 0: Type: Lookup Name: salesno.dat
File 1: Type: Write Name: output.dat
Lines 1 and 2: Inbound
Lines 3 and 4: Outbound
Program starts at 200
Numbers start at 100



Running The Program

To run the Outbound Message Delivery Program type the command...

C:>caller

Just like CCMAINT, CALLER will open the control file called "control.ctl" unless you specify a name in the command line. The control file for the Order Entry program is control.ctl so there is no need to specify a different name. CALLER will follow the parameters in "control.ctl" to run the Order Entry program.


Valid Salesperson ID's File Format

Here is an example of SALESNO.DAT with sample data. This is an ascii file with one sales ID number per line, separated by a carriage return, line feed. This is the standard file format that is created with most text editors in text mode.

1234
2255
7788
5546
1100



The Program Source Code

The listing of the program code follows. There is a liberal use of comments to clarify the commands.

:1   Speech: 1.72 seconds
Your entry was invalid.

:2   
Thank you

:3   
* GV2 is record counter for output file. Used as id in recorded msg. *
/B C GV2=1;

:10   Speech: 1.64 seconds
* Used as ending to many prompts *
Then press the number key.

:50   Speech: 1.27 seconds
The product is ...

:51   Speech: 1.56 seconds
The order date is ...

:52   Speech: 1.37 seconds
The ship date is ...

:53   Speech: 1.80 seconds
The invoice amount is ...

:54   Speech: 1.70 seconds
No product name recorded.

:100   Speech: 0.63 seconds 
Zero 

:101   Speech: 0.42 seconds 
One 

:102   Speech: 0.37 seconds 
Two 
 
:103   Speech: 0.48 seconds 
Three 
 
:104   Speech: 0.58 seconds 
Four 
 
:105   Speech: 0.79 seconds 
Five 
 
:106   Speech: 0.66 seconds 
Six 
 
:107   Speech: 0.49 seconds 
Seven 
 
:108   Speech: 0.65 seconds 
Eight 
 
:109   Speech: 0.40 seconds 
Nine 
 
:110   Speech: 0.37 seconds 
Ten 
 
:111   Speech: 0.50 seconds 
Eleven 

:112   Speech: 0.44 seconds 
Twelve 

:113   Speech: 0.63 seconds 
Thirteen 
 
:114   Speech: 0.73 seconds 
Fourteen 
 
:115   Speech: 0.83 seconds 
Fifteen 

:116   Speech: 0.72 seconds 
Sixteen 
 
:117   Speech: 0.90 seconds 
Seventeen 
 
:118   Speech: 0.64 seconds 
Eighteen 
 
:119   Speech: 0.70 seconds 
Nineteen 
 
:120   Speech: 0.62 seconds 
Twenty 
 
:121   Speech: 0.52 seconds 
Thirty 
 
:122   Speech: 0.55 seconds 
Forty 
 
:123   Speech: 0.51 seconds 
Fifty 
 
:124   Speech: 0.65 seconds 
Sixty 
 
:125   Speech: 0.79 seconds 
Seventy 
 
:126   Speech: 0.53 seconds 
Eighty 
 
:127   Speech: 0.70 seconds 
Ninety 
 
:128   Speech: 0.58 seconds 
Hundred 
 
:129   Speech: 0.74 seconds 
Thousand 
 
:130   Speech: 0.50 seconds 
Million 
 
:131   Speech: 0.60 seconds 
Dollars 
 
:132   Speech: 0.70 seconds 
Cents 
 
:133   Speech: 0.55 seconds 
and 
 
:134   Speech: 0.71 seconds 
Negative 
 
:200   Speech: 3.85 seconds
Welcome to the Stok Software demonstration order entry system
 
:201   Speech: 4.88 seconds
You will be asked a number of questions. Please respond by pressing the 
buttons on your phone.
 
:205
/C v3 = 3;
 
:210   Speech: 4.14 seconds
Please enter your four digit salesperson ID number. 
/C v3=v3-1; /I 4;
 
:212  
/C s0 = si; /FL 0, s0; /(!vf) > 217;
 
:214   Speech: 1.98 seconds
That is not a valid ID number
/(v3 > 0) >210;
 
:215  
/H;
 
:217
/C v2 = Gv2; /C gv2 = gv2+1;    * write initial record for this call *  
/FWR 1,"Call ",v2," Line ",vl," Salesperson ",si,  
" Date ",sd," Time ",st,"<0x0d><0x0a>";
 
:218
/C v3=3;
 
:219
/C v3=v3-1; /(v3<0) H;
 
:220   Speech: 3.41 seconds
Please enter an item number, four digits or less.   
/S P 10;   Then press the number key.
 
:221
/I4# I-219 B-219;
 
:225   Speech: 1.64 seconds
You entered item number...  
* save item number, then speak it as individual digits from input buffer * 
/C s10 = si;  /S I;
 
:228
/C v3=3;

:229
/C v3=v3-1; /(v3<0) H;
 
:230   Speech: 2.58 seconds
Please enter the number of items you wish to order.   
/S P 10;   Then press the number key.
 
:231
/I4# I-229 B-229;
 
:235   Speech: 0.89 seconds
You have ordered...   
save number of items, then speak number *
/C v0=vi, s11=si;  /S V; 
 
:236   Speech: 0.50 seconds
...items.
 
:238  
/C v3=3;
 
:239 
/C v3=v3-1; /(v3<0) H;
 
:240   Speech: 1.77 seconds
Please enter the price per item.
/S P 10;   Then press the number key.
 
:241   
/I8# I-239 B-239;
 
:245   Speech: 1.31 seconds
The price you entered was... 
* speak amount entered in dollars and cents *     
/C v10 = vi / 100;  /S $ v10;
 
:247   Speech: 2.85 seconds
The total amount for the last items entered is...       
/C v1 = v10 * v0;  /S $ v1;
 
:248   
/C v3=3;
 
:249
/C v3=v3-1; /(v3<0) H;
 
:250   Speech: 3.73 seconds
Please enter the customer's phone number in case of difficulty.   
/S P 10;   Then press the number key.
 
:251
 * Receive input. If no entry, loop back and repeat request * 
/I 11# I-249 B-249;
 
:255   Speech: 1.58 seconds
The phone number you entered was...
* save phone number and then speak back this number (individual digits) * 
/C s12 = si;  /S I;

:288   
* Write values to output file *   
/FWR 1,"Call ",v2,"        Item ",s10," Qty ",s11, 
" Price ",v10," Phone ",s12,"<0x0d><0x0a>";
 
:300   Speech: 4.09 seconds
Do you want to enter another item? Press 1 for yes, 9 for no.   
/I1 1-220 9-400;
 
:400   Speech: 6.80 seconds
Please wait for the tone and verbally state the shipping address.
You will have 30 seconds, and may stop by pressing any button.   
/C s2 c=v2, s12 = "SALES ID " + S0, s13 = "MSG" + s2, s13 = s13 + ".MSG";
 
:401  
* record message *     
/R s2,30,s12, s13;
 
:410   Speech: 2.04 seconds
The address you just recorded was...  
/SR sm;
 
:500   Speech: 1.99 seconds
Thank you for your order, Goodbye.
/H;

 


Information Inquiry Program


The Information Inquiry Program is a fully working program that is included with Contact Caller. It can be used as is or modified to your specs. In its present form it will allow a caller to enter a payment number and the system will look up the information in the database file and speak all the information to the caller about the order.


Files Used For The Inquiry Program

INQUIRY.CC   Program Prompt File 
INQUIRY.CTL  Control file 
INQNAMES.CC  Recordings of spoken names 
INQLIST.DAT  Input file with Reference Data 



Program Settings Before You Use

You need to set parameters to tell Contact Caller how to run the program. You do this with the maintenance program, CCMAINT. To set parameters for this program, type the command...

C:>ccmaint inquiry

Note that CCMAINT will edit the control file called "inquiry.ctl".

You will see that all lines are specified as "Inbound" for the "Phone Line Modes" in CCMAINT menu "C". There is no need for outbound calling since this is an inbound inquiry program.

You need to examine the "General System Parameters" in CCMAINT menu "A" and make sure you have the proper values set for the "Hardware interrupt" and the "Software interrupt".


Running The Program

To run the Outbound Message Delivery Program type the command...

C:>caller inquiry

CALLER will open the control file called "inquiry.ctl" and follow those parameters to run the inquiry program.


Reference Data File Format

Here is an example of INQLIST.DAT with sample data. This is an ascii file were each record contains several items of information about an order. Each item is separated by a comma. Each record is separated by a carriage return, line feed. This is the standard file format that is created with most text editors in text mode.

719241, 10,      013075, 4/27/2000, 5/17/2000, 4/29/2000,  15, 652-433, 64A, 8, 1,  15 
801246, 11,   B98647400, 4/06/2000, 5/14/2000, 4/07/2000,  16, 98A-444, 65B, 9, 2,  16 
805019, 12,    HL138540, 4/06/2000, 5/14/2000, 4/11/2000,  17, 333-56B, 66C, 0, 3,  17 
805063, 13, 100756S5789, 4/05/2000, 1/17/2000, 4/29/2000,  18, 123-AB6, 67D, 1, 4,  18 
805169, 14,      D03659, 4/07/2000, 1/17/2000, 4/16/2000,  19, 698-327, 68E, 2, 5,  19 
805222, 15,       40274, 12/08/1999, 2/17/2000, 2/27/2000, 332, 987-122, 77F, 9, 2, 114 
805365, 16,      008979, 12/12/1999, 1/15/2000, 1/18/2000,  66, 114-567, 16G, 4, 2, 104 



Variables Used For The Inquiry Program

In program record 320 (see program below) the following variables are used for the following information...

S1 = Payment No.
S2 = Customer Name (spoken from INQNAMES.CC file)
S3 = Purchase Order No.
S4 = Date received
S5 = Scheduled date
S6 = Ship date
S7 = Carrier
S8 = Bill of Lading No.
S9 = Product No.
S10 = Trail No.
S11 = Pieces
S12 = Weight



The Program Source Code


:300
"Welcome to the telephone inquiry system."

:310
"Please enter the six digit reference number of the order
 about which you are inquiring."
/I 6 T-450;

:320
* Lookup record for ref in SI and load data into variables *
/FL 1, SI, S1, S2, S3, S4, S5, S6, S7, S8, S9, S10, S11, S12;

:321
/(VF != 0) >400;    * Go to 400 if no match *

:322
"The customer name is..."

:323
/S P s1;   * speak company name from alternate prompt file *

:324
"The purchase order number is... "

:325
/S V S2;    * speak value in S2.

:326
"The date shipped is... "

:327
/S D S3;    * speak date in S3.

:328
"The total value of this purchase is..."

:329
/S $ S4;    * speak value in S4 as a dollar amount.

:350
"To request another record, please press the number key.  
To quit press the star key."
/I 1 "*"-450 "#"-310

:400
"That reference number does not exist."  />350;

:450
"Thank you for your call."    /H;

 


Outbound Message Delivery Program


The Outbound Message Delivery Program is a fully working program that is included with Contact Caller. It can be used as is or modified to your specs. In its present form it will call a list of phone numbers and deliver a message to whoever answers the phone. A separate line can be set aside for an administrator to call in to control the system. The administrator can record and change the Out-Going-Message (OGM). He or she can start and stop the system. And he or she can listen to messages left by the people called.


Program Settings Before You Use

You need to set parameters to tell Contact Caller how to run the Outbound Message Delivery Program. You do this with the maintenance program, CCMAINT. To set parameters for this program, type the command...

C:>ccmaint obmsg

Note that CCMAINT will edit the control file called "obmsg.ctl".

In CCMAINT you need to specify on which phone line(s) you want to run the Administrator's menu and which lines should be used for the outbound calls. You do this in Menu "D". This is the "Starting Record for Each Line" menu. The outbound system starts in program record number 200 (see program below) and the Administrator's menu starts in record number 300. So you need to specify these appropriately.

You also need to set the "Phone Line Modes" in CCMAINT menu "C". Specify "Inbound" for the Administrator's line and "Outbound" for all the others.

Finally, you need to examine the "General System Parameters" in CCMAINT menu "A" and make sure you have the proper values set for the "Hardware interrupt" and the "Software interrupt".

There are other parameters that you need to set for proper operation. These are all explained in the following discussion.


Phone Number File

Record 370 in the program (see program below) loads the list of phone numbers to be dialed from the file called "PHONES.DAT". This is an ascii file with one phone number per line, separated by a carriage return, line feed. This is the standard file format that is created with most text editors in text mode. This file is later loaded into an internal file called CALLSTAT.DAT for actual processing.

Here is a sample PHONES.DAT file:

5551221
5551226
5551224
5551227
2125551212

Contact Caller will place a "1" in front of a 10 digit number if you indicated this in CCMAINT menu F ("Dial "1" for long distance numbers").

All phone numbers must be 11 digits or less. In the event a prefix dialing string is needed (to get an outside line), this can be specified in CCMAINT menu F ("Dialing prefix to get outside line").

To load the numbers from the PHONES.DAT file, select option "4" from the Administrator's menu in the OBMSG program.


Generated Phone Numbers

Instead of loading phone numbers from PHONES.DAT, you can let Contact Caller generate the numbers for you using its built in list generator in CCUTIL. See "Auto Dialer Laws and Regulations" in section "5" for regulations about using Contact Caller as an auto-dialer in this fashion.


Running The Program

To run the Outbound Message Delivery Program type the command...

C:>caller obmsg

CALLER will open the control file called "obmsg.ctl" and will use the parameters from that file to run the program. Call the line you have specified as the Administrator's line. You will be asked for a password. This is the number saved in the file called PASSWORD.DAT. You can change this file with any text editor to make your own password.

After you enter the right password you will hear the following prompt...

To start calls, press 1
To stop calls, press 2
To reset the phone list, press 3
To load a new list, press 4
To record new OGM, press 5
To hear the OGM, press 6
To listen to msgs, press 7
To end the call, press 9

You need to first press 4 to load the list from the PHONES.DAT file, unless you had Contact Caller generate the list for you. If Contact Caller generates a list then it is already considered "loaded."

To activate the callout system so that it begins making calls, press 1.

You may call into the Administrator's line anytime you want to change the OGM or to hear the messages left by the people being called.


How To Remove The Function To Record A Response.

The supplied program is coded to take a message after playing the outgoing message. If you do not want to have the program take a message after playing the OGM, then just run CCEDIT and remove record 215 from the program (see program Source Code below).

To edit the Outbound Message Delivery Program type the command...

C:>ccedit obmsg


Detecting an Answering Machine

You can detect an Answering Machine to transfer live calls to an extension (if installed behind a PBX)) or to process differently (such as wait for the OGM and then leave a recorded message or just hang up). Line 212 in the code below checks for an answering machine and forces the program to hang-up after recording the OGM rather than wasting time waiting to record a response. This method is explained in detail in the "Advanced Programming" section.


The Program Source Code

:1   Speech: 2.56 seconds
Your entry was invalid. 

:200 /c s1 = "OGM.VOX"; This is start of OGM call. Set OGM.VOX to var s1.

:211 /sr s1; Play OGM

:212 If answering machine, don't try to record response. Just hangup. /(va > 400) > 240;

:215 /r ,,sn; RECORD RESPONSE (Remove 215 if you don't want response).

:240 /H; HANG UP.

:250 Speech: 2.04 seconds Calling in progress

:251 Speech: 2.18 seconds Shutdown in progress

:252 Speech: 2.36 seconds Outbound system stopped

:253 Speech: 2.73 seconds Waiting for callout time period

:254 Speech: 1.92 seconds All calls complete

:300 Speech: 3.40 seconds START OF ADMINISTRATORS LINE Prompt: "Please enter your security code" /i8#; Get up to eight digits.

:305 /fs 2,0,0;

:310 /fr 2,v1; Read password from PASSWORD.DAT and save in v1.

:311 /(vi != v1) > 385; If password does not match value in PASSWORD.DAT then end.

:315 Speech: 1.89 seconds Welcome supervisor

:320 Speech: 2.28 seconds Current system status is: /c v1 = 250 + vo;/S P v1;

:330 Speech: 27.08 seconds Press 1 to start calls, 2 to stop, 3 to reset phone list, 4 to load a new list, 5 to record new OGM, 6 to hear OGM, 7 to listen to msgs, press 9 to end. /i1 "1"-340 "2"-350 "3"-360 "4"-370 "5"-400 "6"-410 "7"-420 "9"-450 t-450;

:340 /(vo = 0) > 320; /(vo = 1) > 320; /(vo = 3) > 320; /Oc; Start callouts if in stopped state /(vf)>348;

:344 />320;

:348 Speech: 4.41 seconds Error starting callout system, error number /S V vf;

:349 />320;

:350 If shutdown in progress, already stopped, or callouts complete, skip /(vo = 1)>320; /(vo = 2)>320; /(vo = 4)>320; /Os; /(vf)>358;

:354 />320;

:358 Speech: 4.73 seconds Error stopping callout system, error number /S V vf;

:359 />320;

:360 Speech: 3.40 seconds /(vo = 0)>364;/(vo = 1)>364; /(vo = 3)>364; Resetting all phone numbers, please wait /Or; /(vf)>368;

:362 Speech: 3.06 seconds Phone number list fully reset />320;

:364 Speech: 2.59 seconds System must be stopped first. />320;

:368 Speech: 7.80 seconds An error occurred during reset of phone number list, please check the system before attempting to re-start. The error number is /S V vf;

:369 />320;

:370 Speech: 3.21 seconds /(vo = 0)>364;/(vo = 1)>364;/(vo = 3)>364; Loading new numbers list, please wait /Ol "PHONES.DAT"; /(vf)>378;

:374 Speech: 2.06 seconds Finished loading new numbers />320;

:378 Speech: 4.23 seconds An error occurred while loading the new phone list, error number is /S V vf;

:379 />320;

:385 /s p 1; say invalid password

:386 /H;

:400 /(vo > 1) > 405; CALLOUT'S STOPPED, OKAY TO RECORD NEW MSG.

:401 Speech: 5.32 seconds Some callout's are still in progress. You may not record a new message at this time. />320;

:405 Speech: 5.65 seconds Record the new outgoing message at the tone. /r ,600,,"OGM.VOX";

:406 />320;

:410 /sr "ogm.vox";

:412 />320;

:420 /c s1 = "*.MSG";

:421 /ff s1,s2; Find the next message

:422 /(vf != 0) > 440;

:423 /sr s2; Play the recorded message

:424 Speech: 8.93 seconds To replay press 1. To save and play next, press 2. To delete and play next, press 3. To quit, press 9. /i 1 "1"-423 "2"-430 "3"-425 "9"-320 B-424 I-320 T-450;

:425 /fd s2; DELETE MESSAGE

:430 /c s1 = ""; /> 421; Continue looking for more messages.

:440 Speech: 1.84 seconds

There are no more messages />320;

:450 Speech: 0.90 seconds Supervisor Complete, goodbye. /h;



Table of ContentsTop of This SectionContact Caller InfoHome