Home > Amanda > Communications System > Amanda Work Group 7xx Installation Manual

Amanda Work Group 7xx Installation Manual

Here you can view all the pages of manual Amanda Work Group 7xx Installation Manual. The Amanda manuals for Communications System are available online for free. You can easily download all the documents as PDF.

Page 161

Chapter 11:
Programming Amanda
Using Tokens
The Token Programming Language allows you to write programs for 
Amanda. These programs consist of tokens entered in Extension fields 
(defined per mailbox using Amanda Administrator’s Mailbox window or 
Amanda Standalone’s Users screen) and/or in Method fields (defined per 
mailbox using Amanda Administrator’s Notify window or Amanda 
Standalone’s Notify Screen). This section describes the language and 
introduces you to common programming terms. Understanding...

Page 162

150 Installing [email protected]
 Stop Amanda’s normal processing of the fields and tell her what to 
do.
In this case, the first character in the field is @. Then you add the tokens 
that tell Amanda what to do.
For example,
@
R(G1,%S1)
assigns the DTMF digits entered by the caller to a variable named %S1. 
This starts with an @ to indicate that you are NOT processing this 
Extension field normally.
Normal processing for the Extension field: Amanda plays “Please hold 
while I try that extension,” puts...

Page 163

Chapter 11: Programming Amanda 151
You use additional fields for any of the following reasons:
 The logic of the program branches or repeats. You use a G() com-
mand or I() command to create the branch or loop. See “Flow of 
Control: Branching and Looping” on page 162 for more details.
 The length of the string of tokens exceeds 65 characters, so you are 
forced to continue in another field. You use a G() command to ex-
tend the token string to a new Extension field.
Mailbox Settings
If you are using a...

Page 164

152 Installing [email protected]
For a literal or system variable, there is no such thing as failure. The token 
always succeeds. Some tokens define almost any behavior as successful. For 
example, you can have Amanda spell an empty string. Amanda doesn’t say 
anything, but no failure occurs either. 
Tracing Token Execution
Amanda’s trace files can let you know where and how a token program is 
failing. This is an invaluable debugging tool. 
Amanda creates trace files as she runs, because the following...

Page 165

Chapter 11: Programming Amanda 153
Press O to stop the display. On-screen traces for Amanda Voice Server are 
not stored in a file. You can create trace files using Amanda Monitor. For 
details, see Administering [email protected]/DOS. You can use 
Amanda Monitor to display on-screen traces as well.
Kinds of Tokens
Tokens fall into the following categories: 
 Literals
Variables
 Commands
Literals
A literal is an exact value such as the whole numbers 4 or 1144. Notice that 
you do not use commas within...

Page 166

154 Installing [email protected]
Variables
Each variable is the name of a storage location within the computer that can 
store a string or a whole number. After you store something in a variable, you 
can use that variable’s name instead of typing the string or the number. This 
is useful because:
 Amanda’s variables have simple names (no more than four charac-
ters) and save you typing time. (You are less likely to make a mistake 
typing a short variable name than a long string.)
 You can change the...

Page 167

Chapter 11: Programming Amanda 155
Assignment
You control port and global variables. For example, you can assign numbers 
or strings to them and later change those numbers or strings. For example, 
you might assign the value of 65 to %G4 and the value Amanda to %S9. 
Assigning a value to a variable copies that value to the variable’s storage 
location. 
Initially, each port and global variable has the empty string as its value. 
Assignment is done in the Token Programming Language using the 
assignment...

Page 168

156 Installing [email protected]
The command P(0745,T) tells Amanda to say the number 0745 as a time. It 
also has the command name P, but it has two parameters: the number 0745 
and the literal T.
When a command is referred to by name in this guide, the parentheses 
appear after the command’s name. For example, the command named P is 
referred to as the P() command, which is read as “the P command.” 

Page 169

Chapter 11: Programming Amanda 157
Parameters
Parameters can be required or optional. The syntax places brackets […] 
around optional parameters.
Parameters can also be for input or for output. Input parameters provide the 
information that Amanda needs in order to perform the action that you 
requested. For example, Amanda might need the name of the file in which to 
store a fax or the telephone number for a pager. You supply the input 
parameters and make sure that the information in them is correct....

Page 170

158 Installing [email protected]
Most system variables do not have parameters. However, a couple of system 
variables have parameters that affect the contents of that system variable. For 
example, to use %I, the system variable that retrieves data from specific 
fields of specific messages, you use parameters to indicate which field, 
message number, and mailbox you want the data from.
Syntax
The exact sequence of characters for each token is defined by its syntax, so 
you have to learn to read syntax....
Start reading Amanda Work Group 7xx Installation Manual

Related Manuals for Amanda Work Group 7xx Installation Manual

All Amanda manuals