background image

Amanda Portal System Reference Manual

Version 1.27E

The Amanda Company, Inc.

January 9, 2003

Summary of Contents for Amanda Portal Telephone Features

Page 1: ...Amanda Portal System Reference Manual Version 1 27E The Amanda Company Inc January 9 2003 ...

Page 2: ...d State 29 1 2 4 Assigning Scope to Procedures 29 1 3 Control Flow 32 1 4 Waiting for Events 34 1 5 Loadable DLLs 35 1 6 Resource Manager 36 2 Security Model 40 2 1 Ancestors and Descendents 40 2 2 Privileges 40 2 3 Login and Logout 44 3 How Amanda Portal Interacts with Telephone Switches 46 4 Mailboxes 49 4 1 Box Manipulation Functions 50 4 2 Box Settings 54 1 ...

Page 3: ...t Commands 91 6 4 Network Device Commands 93 6 5 VP Commands 98 6 6 Port Messages 109 6 7 Miscellaneous Commands 110 7 Fax Commands 113 8 Internet E Mail 115 9 Serial Devices 121 10 Miscellaneous Databases 125 10 1 List Mapping Database 125 10 2 Trie Mapping Database 129 11 The Configuration Database 133 12 Triggers 138 12 1 Autoschedules 138 12 2 Notifications and the Job Queue 141 12 2 1 The Not...

Page 4: ... Integration Modules 166 15 Call Queueing 168 16 Connecting to External Databases ODBC 191 17 Miscellaneous 197 17 1 The tokens Command 200 17 2 Time Functions 203 17 3 Terminating Threads 206 17 4 Logging 207 17 5 Speech Processing 208 17 6 Web Client Access 211 17 7 TCP Client Connections 212 17 8 VoIP Appliance Access 213 17 9 COM OLE 217 A Error Codes and Messages 218 3 ...

Page 5: ... simply given as a required parameter The box syntax is for options only A fundamental theme in Amanda Portal is the notion of the box hierarchy and permissions related to the box hierarchy Boxes create other boxes in an ancestral tree structure Generally unless specified otherwise boxes only have permission to modify their box settings and the settings of their descendents They cannot modify the ...

Page 6: ...ing system or rapid development of whole new voice processing solutions The entire Amanda Work Group Telephone User Interface TUI consists of only a few thousand lines of Tcl code This architecture has several advantages It separates functionality how a particular task is implemented from behavior why a particular task should happen such as a certain sequence of DTMF digits were input by a user Be...

Page 7: ... settings the list of settings is extensible to make development of new applications more flexible they have a set of privileges which have known semantics to the core they may have messages which they have received and the messages in turn may have zero or more MMOs associated with them Boxes may publish MMOs for others to use such as greeting recordings Boxes can establish autoschedule and notif...

Page 8: ...ding Tcl and the Tk Toolkit by Tcl s author John Ousterhout and Tcl For Dummies in the famous Dummies series While those books should be consulted for in depth examples they also cover many more features of Tcl plus the Tk graphical extensions which are not used in Amanda Portal Tcl Variables Programming languages contain two fundamental elements variables and procedures Object oriented lan guages...

Page 9: ...this point Tcl doesn t attach any meaning to the arguments themselves it s just doing simple string substitutions In the execution step the first argument of the line is treated as a command name to be run The other arguments on the command line are passed on to the command which will apply meaning if any to them The command will return a string value as the result of its processing In each of the...

Page 10: ...ring x y We ll learn how to accomplish addition shortly The last command sets x to 5 not y We have already seen an example of backslash substitution when we used to produce a literal dollar sign character in a string Many of the backslash substitutions are the same as those in Amanda DOS Symbol Meaning a Audible alert bell b Backspace f Formfeed n Newline r Return t Tab v Vertical tab ddd Octal va...

Page 11: ...okes the corresponding C procedure and processing of the command is done in compiled code The set command is a built in for example Tcl defines a number of built in commands and applications using Tcl can define additional built in com mands Not surprisingly Amanda Portaldefines quite a few application specific commands which will be covered in the Amanda PortalProgramming class So far we ve seen ...

Page 12: ... plus the name of the element The element name is enclosed in parentheses It may be a constant or a variable or a combination so long as it doesn t contain a space If the element name has a space then the entire variable name must be quoted to hide the space For example we could collect information on a person this way set person name Tim Morgan set person age 37 set person address 23822 Brasilia ...

Page 13: ...y additional values If varname didn t exist previously then it is set to value as if the set command had been used Like set append returns the new value of varname as its result The incr command is exactly like the token in Amanda DOS It allows you to do an arithmetic addition to an existing numeric variable The value added may be positive or negative and it defaults to 1 set i 1 1 incr i 2 incr i...

Page 14: ...ose elements whose names match pattern will be returned A list of name and value pairs is called an a list set name list Sets elements of the array name from list which should be of the same form as is returned by array get Normally the array command will be used in conjunction with command substitution along with some other commands which we ll examine next week In the mean time here are some sta...

Page 15: ... minus which negates the value of its operand set x 4 4 set y expr x 4 The other important unary operator is logical not which is written It changes true values to false and false values to true In Tcl as in C logical values are represented as numeric values A false value is represented as 0 while a true is any non zero value Therefore set x 4 4 set y expr x 0 set x expr y 1 Relational operators a...

Page 16: ...e last two examples function foo is not called because the result can be determined from the value of the first argument alone List Commands Tcl defines quite a few commands for operating on lists We re going to look at the following ones lindex Retrieves individual elements from a list llength Returns the length of a list lsort Returns a new list resulting from sorting an existing list lappend Ap...

Page 17: ... The lsort command returns a new list which is created by sorting an existing list The syntax is lsort flags list The flags parameter can be a combination of a type and a direction The types are integer Treat the list elements as integers ascii Treat the list elements as strings default real Treat the list elements as floating point real numbers The direction can be one of the following increasing...

Page 18: ... syntax is lappend varname value The lappend function returns the new value of varname as its result value Here are some examples set x a b c a b c lappend x d e f a b c d e f lappend x Tim Morgan Carl Doss a b c d e f Tim Morgan Carl Doss llength x 8 Notice that in the second lappend command two values are being appended This is reflected in the result of llength there are eventually 8 items in t...

Page 19: ...ms replaced by a new set of items not necessarily the same number of items Eval One final note on parsing Sometimes you have a list of items in a variable and you want to pass that list as arguments to some command such as lappend Here s an example of the problem set mylist a b c a b c set additional_items d e f d e f lappend mylist additional_items a b c d e f What we really wanted was to get a r...

Page 20: ...ment Control Flow Normally a program is executed sequentially one statement after the previous one Most programming languages including Tcl provide two basic ways to vary this Branching means skipping to or past some statements This is provided with the if and switch commands Looping allows a set of statements to be repeated zero or more times This is provided by the while for and foreach commands...

Page 21: ... a string against a number of patterns and if a match is found to execute some code The pattern matching may be one of exact The strings must match exactly glob Wildcards and can be used just like the DOS DIR command this is the default regexp Regular expression pattern matching is applied see the manual for details Suppose that you want to test x to see if it s any of the strings a b or c You cou...

Page 22: ...tatement is usually used to perform a loop for a specified number of times using a control variable to count the number of iterations The Tcl syntax like that of C is more general for init test reinit body The for statement executes the init statement Then while the test is true it executes body and reinit Thus for is really a while statement with a few other statements thrown into the mix You can...

Page 23: ...s a set a i Sometimes you want to leave a loop or repeat a loop from somewhere in its interior This is the purpose of the break statement Suppose you know that ary n is equal to 7 for some value of n To determine n you could write foreach i array names ary if ary i 7 break At this point i is the index into ary for the value 7 Using continue within a for causes the reinit code to be executed With b...

Page 24: ...ds to be executed It s just like the bodies of the if while etc statements proc name arg list body Description The proc command is used to re define a procedure You always give it three argments the name the argument list and the procedure body If a procedure or a built in with the specified name already exists then the old one is deleted and replaced by the new one Procedures can return an explic...

Page 25: ...m args set result 0 foreach i args incr result i return result sum 1 2 3 6 Notice in the previous example that we used a helper variable called result inside procedure sum When ever the set or related commands is used to create a variable inside a procedure that variable is local to that procedure That is its value is independent of any other variables named result in other procedures and when the...

Page 26: ...u remember by definition n n n 1 1 so we can write a factorial function in Tcl as follows proc fact x if x 1 return 1 expr x fact expr x 1 fact 5 120 So far every example of passing arguments to procedures has been pass by value that is the value of the variable is passed to the procedure which knows that value by its own name What if instead we want to write a procedure which can modify a variabl...

Page 27: ...aised and it would usually cause the operating system to abort the execution of your program Even DOS detects divide by zero exceptions for example Modern thinking on programming languages is that exception and error handling should be concentrated in a few places within a program rather than sprinkled throughout This has several benefits primarily that the code which does the normal work is much ...

Page 28: ...ch The easiest way to use it is catch script var This will execute the command s in script If it and any procedures it calls all return normally then processing simply passes to the subsequent command Otherwise the catch command returns as its value the error code and var will be set to the error message string which was returned from the script Amanda Portal is designed to minimize the number of ...

Page 29: ...o pattern is specified all names are returned exists var Returns true if var is currently a valid variable name You might do this before trying to access its value under some circumstances procs pattern This is like commands but it returns only procedures defined in Tcl those matching pattern if it s specified tclversion Returns the version number of the interpreter vars pattern Like commands but ...

Page 30: ...te cannot be attached to Tcl variables Tcl state is attached to functions through the ClientData parameter This parameter gets set when you create the function Internal Tcl state is attached to an interpreter with the Tcl SetAssocData and Tcl GetAssocData functions Triggers called traces in Tcl can be attached to variables that fire off whenever the variable is read written or deleted 1 2 4 Assign...

Page 31: ...ments the behavior of VP devices It sets the ClientData parameter for this procedure to the internal state allocated for the new VP device 3 It sets the variable vp var to the name of this new command and it sets a deletion callback on this variable that will delete the command vp0 when the variable is deleted So if you now say set vp_var Returns variable s value you will get back the string vp0 W...

Page 32: ...p0 was called Variable handles created this way are immutable That is they can be created and destroyed but not assigned to Let s examine why this is so Suppose r is a regular variable and v1 and v2 are MMO handle variables Figure 1 1 shows the three assignment scenarios that we need to be concerned with The first scenario cannot be prevented because Tcl doesn t provide triggers on arbitrary non e...

Page 33: ...t it is hard to get from one place in the tree to a completely different place in the tree without using exceptions you have to pop the stack and reload it with different procedures corresponding to the new place in the menu hierarchy Fortunately we don t do this very much Figure 1 2 shows the general structure of the menu system and the Tcl stack at each point in time Errors in most Amanda primit...

Page 34: ...ain Menu To listen to your messages press 1 login menu main menu Play Message You have 1 new message login menu main menu play msg Set Options To set your options press login menu main menu set options H HHH HHH j Figure 1 2 Flow control in Amanda Portal 33 ...

Page 35: ...sociated with the handle If a different thread is associated with a handle the thread is either started when the handle is created or by a member function on the handle When you delete a handle your ownership of that object ceases and the object referred to by the handle is either freed or released for other users to use Any threads associated with that handle are killed too Currently the only two...

Page 36: ...izes components The list of DLLs that are loaded when Amanda Portal starts up is listed in the Configuration Database the dlls setting When a DLL starts up the DLLMain procedure initializes any information that the DLL may need For example it may interrogate the Dialogic boards in the system to see how many resources they have and then register these resources with the resource manager Some DLLs p...

Page 37: ...ly to avoid deadlock For example suppose there are only two LS resources and there are two tasks that need both LS resources If task 1 acquires the first LS resource and then task 2 acquires the second LS resource they both will not be able to continue until one of them releases their resource To avoid this Amanda allows you to allocate all the resources you need atomically Most resources are indi...

Page 38: ...rt type devices only the all index is set The number of units asked for does not effect the denial number that is even if the process asks for 5 devices and is denied the denial count gets incremented by 1 current wait This value returns the number of resource units being waited on Again the return value is an a list as with times denied However the number of units asked for does effect the count ...

Page 39: ...ecified if more than one item is available for immediate selection then the one with the lowest unit number will be returned if ascending is specified the highest one available if decending is specified and otherwise the least recently used one This gives you great flexibility in how ports are used to place outbound calls For indistinguishable objects such as fax resources use the LRU method since...

Page 40: ... used The group argument is the same as for grab res you may use it or unit but not both simultaneously Similarly specific type and port are the same as for grab res and have the same restrictions on its use as with that function If net and vp are defaulted then the function also performs a make local net vp command to make those handles member functions be locally available in the interpreter Ret...

Page 41: ...sed on those of the box they are cloned from intersected with the set of privileges that the creating box has You can later assign any privileges you have to a box but you cannot assign any privileges you don t have to another box The topmost box of each tree is special They are known as superboxes and they automatically get all privileges Currently there is only one tree hierarchy with box 999 as...

Page 42: ... privilege existence The different privileges are ANNOUNCEMENTS This privilege allows you to create and modify announcements in your box BOX CREATION This privilege allows you to create non guest boxes CALL SCREEN Allows you to set the call screening CALL SCREEN and modified call screening MOD CALL SCREEN setting on a box CHANGE METHOD This privilege allows you to change the CALLER CODE USER CODE ...

Page 43: ...o determine whether your box has a certain privilege If box is given test the given box instead You can only test the privileges of your box or descendents of your box If you are testing the privileges of the box you are logged in under then the test is done against the state associated with the interpreter i e Tcl SetAssocData If you test another box s privileges then the test occurs against the ...

Page 44: ... against the database with your own box by using the use db flag The only time the values would be different is if another thread modified you privileges from under you Return values An a list with the privilege as the index Error codes NOTNONNEG box BOXNOTEXIST box PERMDENIED box PRIVNOTEXIST privilege INVALIDVALUE value delete privilege box privilege Description This function deletes the privile...

Page 45: ... 2 3 Login and Logout When you log into a box you get the box s privileges and new commands may be injected into your interpreter that give you additional functionality In addition your password and your box number are set in the global array taaPriv When you log out your password and box id are removed from the global variable taaPriv The login related commands are defined as follows login box pa...

Page 46: ...ed if EXPUNGE LOGOUT is set for the box This command exists only if you are logged in Return values Empty string verify sac box password Description This function verifies the password is the correct password for box Return values 0 or 1 Error codes KILLED 45 ...

Page 47: ...ng things i e there is no standard Smart switches generally cost more than dumb switches but both types of hardware are extremely reliable Every phone switch can be told to transfer calls from one extension to another and every phone switch has an audio jack for hold music where you can hook up a CD player or radio to play music to the person when the person is put on hold The switch automatically...

Page 48: ...n from the outside and should receive the company greeting In the first case Amanda should give the voice mail greeting for the box the call was destined for In the second case Amanda should begin call processing by playing a general greeting Without integration information Amanda must always give the general greeting If the switch provides integration information to the voice mail system then the...

Page 49: ...s of switches the caller may miss the first part of the speech of the callee The reason is that there is a delay in recognizing the human voice and transferring the call to the callee s extension While the callee is talking Amanda is busy transferring the caller to that extension and the caller misses the first part of the callee s speech The lines running to Amanda from the phone switch are not s...

Page 50: ...s the creator gets to select the box number There are separate privileges for creating guest and non guest boxes To create non guest boxes you need the BOX CREATION privilege To create guest boxes you simply need a positive BOXES LEFT setting on your box Every time you create a new non guest or guest box this number is decremented So even if you have the BOX CREATION privilege you still must have ...

Page 51: ...ction creates a new box If box is given then a non guest box is created with the appropriate box number otherwise a guest box is created You will need the BOX CREATION privilege to create boxes using the box number You will need a positive BOXES LEFT box setting to create guest boxes Every time you create a guest box this number is automatically decremented by the system Also every time you give a...

Page 52: ...UE value reparent box move children move box new parent Description Changes the parent of a box The box must not be currently logged in The box and its new parent must be descendents of the logged in box making the call The box must not currently be an ancestor of its new parent The new parent must have enough guest allowances This command will fail if the box has children and move children is not...

Page 53: ...s the previous box allocated in the system before box If 1 is given for the box return the last box Return values Box number or empty string if box given is first box Error codes errorCode Description NOTINTEGER box OUTOFRANGE box User gave negative number besides 1 get box children box box Description Returns the child boxes of the current box or the box given If you are not logged in you must gi...

Page 54: ...ust reset the password if you forget it Return values Empty string Error codes errorCode Description NOTNONNEG box BOXNOTEXIST box PERMDENIED box INVALIDPASSWORD password Password can only be numeric set box encrypted password box box encrypted password Description Sets the password for the current box or the box given You can only set the password for your box or one of your descendent boxes Ther...

Page 55: ...ou or any of your ancestor boxes can set it If a setting is ancestor read write only your proper ancestors can create or set the value Also settings can be deleteable or non deleteable If a setting is deleteable then you or your ancestors can delete the value from the table If the setting is non deleteable then it cannot be deleted from the table The settings which are built into the system cannot...

Page 56: ...mutability you must set a value on one of your proper descendent boxes only You cannot set a setting on your own box with this mutability or you wouldn t be able to modify or delete the setting You can create a setting with read write mutability on your box or any of your descendent boxes The deleteability and mutability options apply to all the key value pairs on the command line If you wish to i...

Page 57: ... overrides the mutability attribute Return values Empty string Error codes NOTNONNEG box BOXNOTEXIST box PERMDENIED key KEYNOTEXIST box key INVALIDVALUE value get box setting box box key Description This command gets the value of the settings of keys for a particular box atomically You can read any box s settings including your ancestors Return values Value is returned as an a list Error codes NOT...

Page 58: ...children this number will be decremented This number is decremented for guest boxes only BUSY CODE str read write Code to execute when a transfer for this box detects a busy signal BUSY HOLD bool read write Determines whether a caller can hold for a busy extension CALLER CODE str read write Tcl code to execute when someone calls this box Usually you will set this to a procedure name in the persist...

Page 59: ...created in number of seconds since midnight January 1 1970 GMT CTRIGGER COUNT num read only of times that a notify record has been executed for this box CTRIGGER TIME num read only Time the last notify record executed CUSTOM BUSY bool read write Does user want his custom busy message to play If so the custom busy message is looked up in the MMO Lookup Table under the key busy msg DATE TIME bool re...

Page 60: ...s tech support and accounting for example to answer the phone with an appropriate greeting LANGUAGE str read write Current language for the box If set to a non empty string then the TUI will attempt to load this language whenever the user logs into this box LOCATION str read write Location of user Used for call routing May eventually store IP address or whatever You need the EXTENSION privilege to...

Page 61: ... box at one time MSGS RECEIVED num read only Count of the number of messages that have ever been received by this box over all time NEW FOLDER num read write Folder number for new non urgent messages See also URGENT FOLDER PARENT num read only Parent box Empty string for root box PLAY FROM bool read write Play back who the message was from either the box number or the name of the person PLAY NEW F...

Page 62: ...n This command starts statistical information over for the specified box The specified box must be either the current box or a descendent box Also you need the RESET STATS privilege to execute this call Return values Empty string Error codes NOTNONNEG box BOXNOTEXIST box PERMDENIED set internal box setting box CALLS CONNECT Description This command sets the box settings CALLS TIME and CALLS COUNT ...

Page 63: ...ng this box so the system should record the duration value in the CALLS SECS setting To be effective of course the TUI Tcl code must call this function when appropriate Return values Empty string Error codes errorCode Description NOTNONNEG box BOXNOTEXIST box CTIMENOTSET box The call time hasn t been set through the set internal box setting call 62 ...

Page 64: ...ead only you cannot change its contents because there may be other references to that same MMO you can only dereference it yourself When you overwrite writable MMOs you may use a different type if you wish If an MMO is forwardable then you are free to forward this MMO to another person s mailbox If an MMO is non forwardable then you cannot store it in any way typically such as forwarding it to ano...

Page 65: ...or 1 mmo func forwardable Description This function determines whether an MMO handle can be forwarded to a user or not Return values 1 MMO is forwardable 0 MMO is not forwardable mmo func ref count Description This function returns the number of references to the MMO Return values Reference count mmo func type Description This function returns the type of the MMO handle 64 ...

Page 66: ...ers For Unicode it is still the character length which will be half the byte count since Unicode uses 16 bit characters Error codes errorCode Description UNKNOWNTYPE The MMO has not been assigned to yet so the type is unknown mmo func audio length Description This function is just like the length member function but it returns the length of an audio recording in milliseconds rather than in seconds...

Page 67: ...ext type only html HyperText Markup Language unicode Unicode ascii Ascii Fax type only tiff Fax TIFF F image Other grammar Compiled SAPI speech recognition grammar Error codes UNKNOWNTYPE mmo func date Description This function returns the last modified date on the file underlying this MMO The date is returned as an integer number of seconds since midnight January 1 1970 GMT i e the Coordinated Un...

Page 68: ...le mmo func must be writable mmo func path Description This function returns the actual location path on the disk of the backing store of this MMO mmo func date Description This function returns the last modified timestamp on the file underlying this MMO The result is the number of seconds since 1 1 1970 GMT mmo func id Description Returns a unique identifier for each MMO within the system The sam...

Page 69: ...but not of other MMOs mmo func get text Description This function returns the text associated with the MMO Return values Text Unicode MMOs currently come back as strings since Tcl doesn t currently support Unicode mmo func set text html args Description This function sets the value of the textual MMO to the arguments passed If multiple arguments are passed it concatenates the strings using spaces ...

Page 70: ...ment the MMO s reference count It does not copy the contents of the MMO into a new backing store location Return values Empty string print mmo var printer name Description Print an existing viewable MMO handle using the appropiate application through shell extensions This will use the specified printer name This function uses the printto shell extension By default Microsoft Notepad is used to prin...

Page 71: ...priate option from the voice menu Some messages are private Private messages cannot be forwarded onto other users Messages also have a priority level which is urgent or normal This priority level is independent of the privateness Each message is also marked with as read or unread i e heard or unheard for voice messages You mark a message as read by setting the read flag to the set msg attr command...

Page 72: ... deleted messages will be expunged on logout or when the interpreter is deleted deleting an interpreter executes the logout function automatically To simulate the Amanda Work Group functionality using this scheme we can simply stick all messages in folder 0 and use the normal urgent and read unread flags to determine the message status For non Amanda Work Group behavior we can stick urgent message...

Page 73: ...gs then the message found must have that attribute Also you cannot give both flags in the above pairs or a match would never succeed i e a message can t be both urgent and normal The wrap option says to start over at the beginning if you don t find the message off the end of the folder msg var is a variable to be filled out with information about the message If the variable already exists it is de...

Page 74: ... interpreter this entry is not set forwarded by If the message was forwarded who it was forwarded by This will not be set if the message wasn t forwarded receipt message read deleted Only set if message is a receipt message This message was sent in response to another box reading the message i e setting the state of the message to read See set msg attr This is set on the response message you get b...

Page 75: ...ber is used Remember relative message numbers are never used You can even change deleted messages before they are expunged The first time that you change an unread message to an read message or delete an unread message by switching the state flag a return receipt message is sent to the sender if return receipt requested is set A return receipt is also sent when the message is expunged without bein...

Page 76: ... 2 tuple is an a list describing information about the message The location of the 2 tuple determines the relative message number For example the list returned may look like 46 urgent 1 read 0 3 urgent 0 read 1 deleted 0 Relative message 0 has internal message number 46 message 1 has internal message number 3 etc The information values returned are the same as those filled in by get next msg with ...

Page 77: ...ries are Key Value msgs Total of messages in all folders unread msgs Total of unread messages deleted msgs Total of deleted messages urgent msgs Total of urgent messages normal msgs Total of normal messages urgent unread msgs Total of unread urgent messages normal unread msgs Total of unread normal messages goto msg msg msg var Description This function goes to a message using the message number T...

Page 78: ... Messages can be sent either to individual boxes or mailing lists When sending to mailing lists the contents of the mailing list are automatically looked up in the list mapping database see page 125 Recipients are specified with the syntax box or list box To send to a box you just give the box number To send to a mailing list you send to a list number followed by a Optionally you can also give a b...

Page 79: ...fy records This template then can sends a page to the recipient telling him the number in the relay field so that he can return the call directly without having to listen to voice mail first mmos mmo func list Send the MMOs listed to the person This option will usually always be given because you will usually be sending voice mail to people It is possible to send messages to somebody without any M...

Page 80: ...ipient INVALIDTIME time CMDNOTEXIST mmo func CMDNOTHANDLE mmo func UNKNOWNTYPE subject func MMONOTFORW subject func MSGNOTEXIST msg MSGNOTFORW msg move msgs to box from box dest box Description This command moves all messages from one of your descendent boxes to a different descendent box The messages stay in the same folder and retain their other attributes You need the MESSAGE MOVE privilege to ...

Page 81: ...C C C C C C C C C C C O Figure 5 2 Internal MMO database structure Return values Empty string Error codes NOTNONNEG box BOXNOTEXIST box PERMDENIED box 5 2 MMO Database MMOs are stored internally on disk as files The types of these files vary depending on whether the MMO is a voice file text file etc Also access to MMOs is restricted by the kernel interface of Amanda the calls built in If access we...

Page 82: ...set you cannot store the message in the MMO Lookup Table If you could then you could bypass security by extracting the message from the MMO Lookup Table which always sets forwarding to forwarding OK The whole forwarding concept is built into the system to support people sending you private messages These messages shouldn t be able to be heard by anyone except the box owner the message was destined...

Page 83: ...e keys when you don t have permission to look at them The set of fields are as follows description Description field private Privateness access field box Owner mailbox field key Key field Valid values for the private field world Anyone can access the MMO even non logged in users logged in Any logged in mailbox can access the MMO family Only ancestors descendants and owner can access the MMO owner ...

Page 84: ...the MMO table Values are stored under the given key When modifying values in the table any values not set are left unmodified You can set the MMO or any of the other attributes in the table using this function This function will also create the key if it doesn t exist The defaults on a newly created key are an empty MMO handle the empty string for the description and private world You may also giv...

Page 85: ...he same announcement A message is usually in one language for it is directed at a particular recipient MMOs are used to store the different languages For example the administrator of the system can have a Message of the Day announcement that everyone in the system listens to Announcements can be marked heard by a particular mailbox to remember what is heard or not But if the owner of the announcem...

Page 86: ...ion CONFNOTEXIST announcement box owner edit announcement id category category begin time begin time end time end time recip type list recip type list outbound total outbound total mmo list mmo list Description The function edits an existing announcement The id states which announcement to edit The category states the general subject of the announcement The begin time and end time defines when the...

Page 87: ...nouncement is doing the getting then all the attributes are returned If a recipient is doing the getting then only the following attributes are returned category owner heard mmo vars and id The mmo vars uses the name of the language that each mmo represents Return values INVALIDID The id of the announcement to edit is invalid Possibly the id is good but the it is not the right time as defined by t...

Page 88: ...n receive The recip type list filters the an nouncements for only those recipient types The category filters the list to only include those announcements of the specified category Return values id list A list of announcement ids outbound list announcement category category Description The function gets a list of existing announcement that have a positive outbound total The category filters the lis...

Page 89: ...f the callee wishes to talk to the caller basicaly a form of call screening The following are the commands to manipulate announcements publish mmo mmo func common key publish var mailbox Description Publish the mmo func to the specified mailbox list If no mailbox list is specified then all this is published to everyone If mailbox is EVERYONE then it explicitely states to publish the mmo to everyon...

Page 90: ...ription Get a list of Published MMOs that you have access to What is returned is a list of unique key that can be used by the get published mmo function to get the actual mmo The returned list can be empty Return values unique key list A list of published mmo unique keys 89 ...

Page 91: ...hin that device s class That is each VP device will have a different unit number but there may be an LS device with the same unit number In addition to unit numbers physical telephone ports are assigned unique port numbers When connecting devices on an SCBus any device can broadcast to as many devices as possible but only listen to one device at a time Figure 6 1 shows the concept The VP device is...

Page 92: ...ialogic puts LS and VP devices on the same board or allows you to connect the devices on separate boards through the SCBus This bus is a connector cable between two different boards that allows the boards to communicate with each other at high speed Unfortunately some Dialogic boards have limitations on the separate simultaneous use of the LS and VP devices such that it is better to use a correspo...

Page 93: ...it proc func args list uplevel 1 list handle list func args Delete procedure upon variable exit There should already be an unset trace on this variable for handle cleanup but we can add many more for each function we just added uplevel list trace variable handle_var u list _delete_cmd func Internal routine used by make_local proc _delete_cmd func var index op catch rename func The make local comma...

Page 94: ...ll be set to the board error message Virtually every board related function can receive an error of this type so these error codes are not listed To allocate an LS VP or Fax device you ll need to use the grab res routine discussed on page 38 or the dsp attach command The network device T1 and LS commands are as follows For simplicity we use ls to represent any kind of network device and note any d...

Page 95: ...string ls connect half resource func Description Connect the LS device to another resource If half is given only a half duplex connection is set up otherwise a full duplex connection is set up With a half duplex connection the resource func device listens to the ls device but not vice versa The use of dsp attach is preferred over this command because it takes into account dependencies between the ...

Page 96: ...so take care in using this function in this situation it will not return if reorder tone is detected On a T1 line it waits for digital indication that the far end has hung up If milliseconds is given wait a maximum of milliseconds else wait forever Return values Empty string Success TIMEOUT Waited more than milliseconds Error codes NOTNONNEG milliseconds ls wait on milliseconds Description On an a...

Page 97: ...t ls unit Description Return unit number of LS device Devices of the same type have different unit numbers but devices of different types may have the same unit number This command won t return the BOARDERROR errorCode like the other commands will because it doesn t make calls to the device driver for the board Return values Unit number ls port Description Return port number of LS device Every net...

Page 98: ...devices the A and B bits are dropped for the duration of the flashtm parameter or 500ms if that parameter is not specified in the Configuration Database Return values Empty string ls get dnis Description This function works only on GlobalCall network handles It returns the Dialed Number Identification String as returned by the GlobalCall driver for the associated port If no DNIS information is ava...

Page 99: ...cks them against the setting of dt hangup in the Configuration Database for the port to which the VP device has most recently been dsp attach d remember that potentially the same VP device can be used with different network ports which are connected to different telephone switches which might send different hangup sequences In the first two cases the network device will signal the VP device which ...

Page 100: ...ring Success NOOPINPROGRESS No operation is currently in progress vp skip backward forward Description Skip forward or backward in the audio that is playing by skipby seconds skipby defaults to five seconds or the value of the PLAY SKIP box setting and can be set with the skipby option on the play command line This command should only be executed after you have started an asynchronous play operati...

Page 101: ...milliseconds times n delay milliseconds pause pause key resume key volume up key down key speed fast key slow key skip backward key forward key skipby seconds term key string fromend noretain mmo func Description Plays a set of audio MMOs on the specified VP device The MMO internal procedures names should be given by dereferencing the MMO variables The options are as follows async Play asynchronou...

Page 102: ...it is shown here only to separate the two words in the command description skipby seconds Set the number of seconds to skip forward or backward by term key string Terminate playing when one of the keys in key string is pressed The default is all keys except for the skip speed or volume keys To not terminate on any keys give the empty string fromend Start playing from the end Playing is started ski...

Page 103: ...The options listed mean the same thing as the play command with the exception of the following 102 ...

Page 104: ...value from load prompt set Each prompt has a number You give the sequence of the prompts to play on the command line The meaning of the options is the same as the play command Return values Empty string Play finished or async was given and there was no error key key was pressed STOPPED A stop command was issued Error codes NOTNONNEG prompt PROMPTNOTEXIST prompt FAX INITIATION FAX ANSWER TONE tonei...

Page 105: ... in the Configuration Database for silence termination If tmo silence is not set the default is 5 seconds initsilence seconds Sets the initial silence to allow before termination If given then seconds seconds of initial silence is allowed If sound is heard within this time after silence seconds recording will terminate Useful for allowing a long lead time for someone to say something but after the...

Page 106: ...WER A fax answer tone was heard NOANSWER Phone rang but no answer NORINGBACK No ringback was detected TONE toneid Error codes errorCode Description NOTNONNEG rings HANGUP FAX INITIATION This normally would not happen Normally you call out and wait for the other side to answer using this call When the other side answers you hear a fax answer tone You should never hear a fax initiation tone when the...

Page 107: ...is that now multiple prompt sets can be loaded at the same time for each language Therefore this function does not set the current language nor does it source the prompt set s tcl file It is now designed so that the prompt set s tcl file calls this function Still a list of available languages is returned by the function list languages described on page 111 Return values prompt set Error codes LANG...

Page 108: ...t 0 unlimited time initsilence milliseconds milliseconds is the maximum initial silence before giving up Default 2000 2 seconds interdigitsilence milliseconds If more than milliseconds occurs between a user typing a digit assume the user is done typing digits Default 2000 2 seconds maxdigits number Listen for a maximum number of digits If you want to listen for a single digit give 1 retain Return ...

Page 109: ...e vp device Some boards such as Dialogic have consolidated tone sets where each VP device understands all the tones and which are configured using the device driver For these devices this function is a no op Other boards such as Rhetorex may only understand a certain tone set for each VP device which needs to be configured at run time It is for the latter class of boards that this function is rese...

Page 110: ... the Call Queue but the Call Queue handles a list of calls that are not yet talking to the callee Port Messages are actions from the client to the port once the caller is talking to the callee What is similar to Call Queue is the type of actions TRANSFER BOX HANGUP HOLD and VOICEMAIL The following commands are used to manipulate Port Messages enqueue port msg net var mailbox var Description This f...

Page 111: ...a command message to the specified port The possible commands are hangup transfer voicemail hold If box or voicemail then box must be specified to designate where to The grt may be specified to play a greeting to the caller before the action is taken usually to tell the caller what is going on Return values Empty string Error codes MSGNOTFORW port 6 7 Miscellaneous Commands get port status port De...

Page 112: ...use Description Returns a Tcl list of the ports currently off hook reset port port Description Resets the ports given If the port is not doing anything such as playing some audio this command is a no op You need the RESET PORT privilege to execute this command and it is available only when the Dialogic DLL has been loaded with the system Return values Empty string Error codes NOTNONNEG port PORTNO...

Page 113: ... name Description This function takes one or more names and returns a corresponding list of keypad encodings of those names using the standard American keypad mapping of letters to digits Return values digits list 112 ...

Page 114: ...etwork resource such as an LS or T1 device You should have already established the telephone connection to the remote fax device either by detecting a CNG tone FAX INITIATION or by dialing out and using PCPM to detect a fax answer tone FAX ANSWER Once this has been accomplished you may release the VP device which was used to do the dial and PCPM operations and make the full duplex connection betwe...

Page 115: ...s CMDNOTEXIST func CMDNOTHANDLE func HWRONGTYPE func HANGUP FAX INITIATION FAX ANSWER TONE toneid fx receive fax mmo func Description Receives a fax on the specified fax device mmo func should be an MMO previously allocated with create mmo Return values NOFAXRECEIVED Receiving a fax failed Perhaps the other side hung up before sending the fax or an error occurred during the transmission csid The c...

Page 116: ... Amanda Portal messages via a standard e mail client is to tell the client to access Amanda Portal as a POP3 server Amanda Portal will automatically translate all messages stored in the user s mailbox into standard MIME format messages so the POP client is unaware that they were originally voice and fax mail messages SMTP server The purpose of the SMTP server is mainly for when a user sends Intern...

Page 117: ...The From field of the generated message will normally default to mailbox hostname The mailbox portion can be overriden by the smtp from configuration setting and similarly the hostname can be overriden by the smtp hostname configuration parameter However all of this is superceded if the from argument is used Return values Empty string HOSTNOTEXIST host CONNREFUSED host USERNOTEXIST recipient Error...

Page 118: ... the message given are returned Return values An ordered a list is returned The first part of each 2 tuple is the message number and the second part is the size of that message in bytes Error codes NOTNONNEG msg num MSGNOTEXIST msg num CONNBROKEN hfunc uniq id list msg num Description Returns a unique id list for all the non deleted messages or a unique id list for the message given by msg num The...

Page 119: ...eturned followed by n body lines Return values The headers and first n body lines are returned Error codes NOTNONNEG msg num n MSGNOTEXIST msg num CONNBROKEN hfunc delete msg msg num Description Delete the message indicated by msg num As mentioned earlier the message is not actually deleted by the pop server until a quit command has been issued the undelete msgs member command may be used to reviv...

Page 120: ...Therefore clients should issue the quit command first if they want to insure that the deleted messages are actually deleted Return values Empty string Error codes CONNBROKEN There is one more function that becomes available when the pop dll module is loaded parse mail msg text msg var Description Parse the text given as an e mail message and fill in msg var msg var has the same structure as a mess...

Page 121: ...e contains audio MIME parts they will be extracted as audio MMOs If the message contains textual MIME parts they will be extracted as textual MMOs Return values Empty string Success PARSEERROR Couldn t parse the text 120 ...

Page 122: ...ou must create a global Configuration Database parameter comn with a value equal to a string of settings similar to the DOS mode command That is 9600 n 8 1 or baud 9600 parity N data 8 stop 1 will both work When the system starts up it opens any such comn devices and initializes them according to these settings Normally you will not have to change the baud rate parity etc settings at runtime thoug...

Page 123: ... function this parameter should be set to true The gets command eliminates any null bytes regardless of the setting of this parameter Default false ignore null characters Error codes NOTBOOLEAN boolean hfunc flow out value Description Sets the output flow control to value which must be one of none xon cts or dsr or returns the current setting Error codes INVALIDVALUE value hfunc flow in value Desc...

Page 124: ...to 8 or returns the current setting Error codes NOTNONNEG bits INVALIDVALUE bits hfunc gets timeout milliseconds Description Read newline terminated text from the port The terminating carriage return line feed combination is not returned and null characters are ignored If timeout is given time out after that many milliseconds otherwise wait forever Return values TIMEOUT Timed out value Value retri...

Page 125: ...NONNEG milliseconds hfunc write string Description Write the string to the serial port Return values Empty string hfunc read max Description Read a string of max characters from the serial port Return values The string is returned in ASCII hex That is a string of length max 2 is returned The return value is in hex so you can decipher null characters Error codes NOTNONNEG max 124 ...

Page 126: ...pping database though If key is copy to then you must have the COPY TO privilege to change the mapping This list is used internally to determine whether messages for boxes should be copied to other boxes on receipt In addition to the COPY TO privilege the regular ancestor relationship restrictions in Amanda Portal apply so you cannot modify the copy to of a non descendant even if you have the priv...

Page 127: ...g see the set lmapping call Return values Empty string Error codes NOTNONNEG box BOXNOTEXIST box PERMDENIED box INVALIDVALUE value VALUENOTEXIST value get lmapping box box key Description This gets the value of the list mapping at the specified index Return values A Tcl list is returned with the list value If there is no such index an empty Tcl list is returned Therefore there is no difference bet...

Page 128: ...he list mapping deletion function since setting the list to empty and deleting the list are equivalent Return values Empty string Error codes NOTNONNEG box BOXNOTEXIST box PERMDENIED box INVALIDVALUE value get lmapping keys box box Description Get all the keys for the list mapping for the specified box or the current box if logged in Return values The keys for all the lmappings as a Tcl list Error...

Page 129: ...ecified which does not exist then it is treated as if it did exist with the value 0 The option by can be used to specify the integer value by which the variables are to be incremented It defaults to 1 Error codes errorCode Description INVALIDKEY The specified key is not currently defined NOTINTEGER The value of the specified variables is not an integer set global name value Description This functi...

Page 130: ... type in the letters of the person s last name and the trie tree is traversed looking for matches If a single match is found then the value is looked up and returned For example if the value is the user s extension then this value is spoken back to the user If multiple matches are found all the names found are read back to the user Since the user s only input is often a phone two entries are actua...

Page 131: ...keyss to the database if the key doesn t exist in the database already otherwise append the values to the list associated with the key already in the database key must be alphanumeric If key contains letters then two keys are actually entered into the database one with the alphanumeric name and one with only the numeric name corresponding to the alphanumeric name on the telephone keypad These two ...

Page 132: ... is deleted You need the CHANGE TMAPPING privilege for this call Return values Empty string Error codes errorCode Description PERMDENIED INVALIDKEY key Key isn t alphanumeric KEYNOTEXIST Key does not exist VALUENOTEXIST Value does not exist on the key given MAPNOTEXIST map name INVALIDVALUE value delete tmapping by value map name value Description This function searches the lists of all the intern...

Page 133: ... multiple keys If the list for an index contains more than one entry then there are multiple values for that key For example there may be multiple boxes with the name Bob If the a list returned contains no entries then nothing matched Error codes INVALIDKEY key fragment MAPNOTEXIST map name INVALIDVALUE value get tmapping keys map name value Description Gets all the keys containing value somewhere...

Page 134: ... a short form which is a 1 tuple e g n rings and a long form which is a 2 tuple e g n rings 2 or n rings The long form has a special wildcard form specified with a which means all ports extensions or PBXes the n rings form in the previous sentence Non wildcard forms are considered more specific than wildcard forms and take precedence over them The parameters in these categories are pretty much fix...

Page 135: ... id global port extension pbx key Description This function gets the values of all the parameters with the keys given Keys should be given in short form The id option may not be given if the type is global and must be given if the type is not global This is the main function for looking up a single value When looking up port values the pbx database is searched as described above Return values An a...

Page 136: ...to iterate over all the keys in the database Error codes KEYNOTEXIST key get param keys global port extension pbx help Description This function returns all the long key names for all the parameters of a certain type The pbx database is not searched if the port category is used Return values A regular Tcl list with the keys in long form are returned set param table global table port table extensio...

Page 137: ...ases like the regular Configuration Database If you have two keys with the same name in the global and port databases for example they must have the same help text The help text manipulation functions are as follows get param help text key Description Gets the help text for the specified keys Return values An a list is returned with the key and help text associated with the key If a key doesn t ex...

Page 138: ...Return values Empty string Error codes PERMDENIED For a list of all the parameters recognized by the system see The Amanda Portal Administration Guide 137 ...

Page 139: ... Tcl code to be executed and when that code should be executed The code to execute may simply be the name of a Tcl proc and often this procedure is defined via the unknown mechanism that is it is automatically loaded into the Tcl interpreter when you first attempt to use it and it s not already defined When the code is executed it runs in its own interpreter logged into the box to which the autosc...

Page 140: ...EAR Once the METHODON command has been executed and if the DURYEAR DURMONTH DURDAY DURHOUR and or DURMINUTE fields are non zero then the schedule is considered to be still in force This feature is used in combination with the METHODOFF field to specify an action which is to occur some time after the METHODON action usually to undo the METHODON action The duration time must be earlier than the time...

Page 141: ...n a list of parameter and value pairs as the value of the function Error codes PERMDENIED INVALIDKEY sched num INVALIDVALUE value schedule delete box sched num Description Deletes the indicated schedule Error codes PERMDENIED INVALIDKEY sched num INVALIDVALUE value schedule list box var Description Retrieves a list of all schedules for the current or indicated user id Returns the list as the value...

Page 142: ...voice mail which has been marked urgent Once the conditions of a notification record have been met the system will automatically submit a job to the job queue For historical reasons the job queue is known as the notify instance database since it holds instances of notification records which have fired However in practice the notification instance records can created directly For instance an outbou...

Page 143: ...er privilege This function does not check for duplicate records The type list is a tcl list of any combination of the following system known values or a type of another name normal A normal notification record is fired whenever a new message is received by the mailbox regardless of the urgency of the received message urgent An urgent notification record is fired only when an urgent message is rece...

Page 144: ...tion Deletes notify record s for the current mailbox or for the indicated box by id The ids are returned by the nfr add and nfr list commands If a specified id is invalid then an appropriate error message is returned and processing stops ie any id s after that one are not processed Return values Empty string Error codes BOXNOTEXIST box PERMDENIED box IDNOTEXIST id nfr list box Description Returns ...

Page 145: ... type If there are any then they are fired off being passed the variable Return values Empty string 12 2 2 The Notify Instance Job Queue Database notify schedule box box template variable successes failures days from to after every msg num nfr recno type port group Description 144 ...

Page 146: ... of minutes which must pass from the time the job is submitted before it is first executed every This integer value specifies the number of minutes which separate each successful or failed execution That is the job is repeated every every minutes except for the day of week and time of day restrictions If a job would otherwise run but it is restricted from doing so it is rescheduled automatically f...

Page 147: ...ed to that template the number of successful executions so far the maximum number permitted the number of failed executions so far and its maximum permitted value a boolean value specifying whether the job is currently executing a boolean value specifying that the record was deleted while it was executing so it is to be destroyed when its execution finishes and the notify record number and type in...

Page 148: ...the value of the variable argument to notify schedule This is used to implement the V token last failure will be set to a Tcl boolean value If true then if the notify fails this time it will not be rescheduled to execute again If false then an error return will cause the instance to be requeued This information may be of use to the notify template so that it can clean up state as in the MMO lookup...

Page 149: ...and loads template name into the calling interpreter This results in defining a function called notify with one argument as described above Return values Empty string but upon success it will have created or changed the notify proc in the interpreter Error codes INVALIDKEY template name template body template name Description The template body command returns the body of template name This command...

Page 150: ...t on port 5000 The client listens on port 5000 and the server connects to it This dtrigger is assigned id id1 which the client can later use to reference this dtrigger Later the client receives an update for a box setting on port 5000 Next the client requests information about lmapping and autoschedule record changes to be sent on port 3000 Lastly the client decides to no longer monitor box settin...

Page 151: ...ed asynchronously Send me info about lmapping changes on port 3000 Port 3000 opened Send me info about autoschedule record changes on port 3000 Existing port used Stop monitoring dtrigger id id1 Last dtrigger Port 5000 closed dtrigger id id1 Server notices disconnect Removes all dtriggers to client Figure 12 1 Example use of dtriggers 150 ...

Page 152: ...ctrigger ctrigger proc mmo lookup call queue call queue view persistent proc or privilege When a notification to the client occurrs for the first time it causes a TCP connection to be established to the client Thereafter for efficiency the connection stays around until that monitor is deleted or the client disconnects or logs out We want to make sure that the client cannot be spoofed by a hacker s...

Page 153: ...oolean value 0 or 1 Error codes NOTNONNEG id IDNOTEXIST id add trigger request port cookie type Description This function adds a low level monitor which will not cause further tracing or monitoring so it is non invasive and it won t cause any infinite loops or deadlocks within the system It is used only for writing system monitoring programs The port argument is a TCP port number on the client to ...

Page 154: ...delete trigger request type Description Deletes a previously established low level data trigger of type type If no trigger of that type exists no indication is given to the caller Return values Empty string add dtrigger type port cookie box Description 153 ...

Page 155: ...le records database being updated ctrigger The ctrigger rule database being updated ctrigger proc The ctrigger proc database being updated lmapping The lmapping database being updated tmapping The tmapping database being updated persistent proc The persistent procedure database being updated call queue The call queue being modified call queue view The call queue updating active calls or active age...

Page 156: ...pe name is the same as the type name given in the add dtrigger command That is the client has a function with the same name as the type This function updates the client as appropriate The cookie is sent back so the client can verify that it is actually the server that is sending it data The box argument is only given for types that are box specific The rest of the args are type specific They funct...

Page 157: ...r id box delete ttrigger id The ttrigger ids given have been deleted from the system ctrigger cookie dtrigger id box add ctrigger id key value A new ctrigger for the specified box has been added to the system The key value pairs are the same as those given to add ctrigger ctrigger cookie dtrigger id box delete ctrigger id The ctrigger ids given have been deleted from the system ctrigger proc cooki...

Page 158: ... persistent proc cookie dtrigger id rename old proc new proc old proc has been renamed to new proc in the persistent method database If new proc is the empty string the proc has been deleted message cookie dtrigger id box add key value A new message has been added to box The key value pairs are the same as the array indices that are filled in by get next msg see page 72 call except that the MMOs a...

Page 159: ...lege cookie dtrigger id box add priv value Privileges have been added with the values given privilege cookie dtrigger id box delete priv Privileges have been deleted mmo lookup cookie dtrigger id box add key a list The keys given in the MMO database have been added or modified a list is an a list containing the keys description and private as in the function lookup mmo attrs see page 82 You will o...

Page 160: ...n by the call info command see page 188 call queue cookie dtrigger id queue delete call id A call s has been deleted or in other words removed from the queue identified by id call queue priv cookie dtrigger id queue set accept id call callid status newstatus This is a notification of a call callid being assigned to an agent that has the option to accept or reject the call New status of the agent i...

Page 161: ...l queue view cookie dtrigger id queue set agentBox box key value A agent s attributes has changed The key value pairs have the same values as that given by the agent info command see page 182 call queue view cookie dtrigger id queue expunge agentBox box The agent has been removed from the queue If box is 1 then all the agents have been removed from the queue usually because the queue is being expu...

Page 162: ...l queue view cookie dtrigger id queue delete agent agentId mailbox box The agent identified by agentId has left the queue call queue stats cookie dtrigger id queue set callStats key value Real time statistics update for the queue 161 ...

Page 163: ...sts for the CALLER CODE RNA CODE etc settings on a box see page 57 These settings consist of Tcl code to execute when a user calls in when a user s extension is busy etc These fields are limited in length though so they often simply contain calls to a persistent procedure In addition by factoring out the behavior from the setting on a box we centralize the code into one place making modification e...

Page 164: ...nd if not given all the procedure names in the persistent procedure pool are returned If it is given then regular expressions determine which procedure names are returned just like the info procs command The body argument can only be used if a logged in user has the EDIT PMETHOD privilege Return values Return value is described above Error codes PROCNOTEXIST proc PERMDENIED rename proc old name ne...

Page 165: ...That is the data comes back like reason arg For example for a busy extension the data may come back as A12 The A says that the extension is busy and the 12 says that the extension that was busy is extension 12 We could create the pattern Abb where bb has special meaning in this case the extension that was busy To handle a three digit extension we can have another pattern like Abbb We can create a ...

Page 166: ...IN The call is a direct call from a station which will be identified in the CalledMailbox variable Normally the system will invite the caller to log into that box by asking only for a password RECORD The call is an immediate record situation with the mailbox identified in the CalledMailbox variable in the interpreter HANGUP This was a hangup indication Amanda usually ignores such calls ANSWER This...

Page 167: ... of Amanda Sets the CalledMailbox variable in the interpreter s Station information When Amanda receives a bbb rrr or eee call the switch may also provide station information for who the caller was This information will match the sss in the integration pattern Sets the CallingMailbox variable in the interpreter t Trunk information Amanda may use this information to process calls differently depend...

Page 168: ...interpreters which were created in response to an incoming phone call When integration information comes in it may not come into Amanda in lock step with the call coming to Amanda Therefore Amanda has a window within which the integration information must be received before it is considered valid This window is specified with the smdi pretimeout and smdi timeout values in the Configuration Databas...

Page 169: ... calls but the calls queue up while you are talking You can review the calls in the queue on your screen and decide to either preempt the call you are currently on to take another call in the queue send one of the calls in the queue to voice mail or make the people in the queue wait You can even set up rules on how to dispose of calls in the queue You may wish to send certain calls automatically t...

Page 170: ...e may have a number of skills such as speaking Spanish Likewise each call that comes in may require a number of skills of the agent that takes the call If an agent is to take a call they must have at least the skills required by the call That is if a call requires skills a and b then the agent must at least have the skills a and b to take the call The agent may have more When an agent is allowed i...

Page 171: ...ls Figure 15 1 shows the behavior Call centers have a notion called wrapup When an agent is done with a call the agent may have to finish up some paperwork related to the call This is called the wrapup period Some sites have a limit on the amount of time an agent can spend in the wrapup period These sites will automatically send the next call in the queue to the agent if the agent exceeds the wrap...

Page 172: ...ffect the agent is marked as unavailable Rest of logic the same as agent rejecting call Call in queue too long QUEUE TIMEOUT returned and call deleted Call position change Call variable returns POSITION CHANGED Enter call in queue Call returned Agents that could handle call leave Call variable returns NO MORE AGENTS Play the specified greeting back to the caller Only if rejection privilege Only if...

Page 173: ...the queue Optionally a greeting to play is specified The mailbox of the greeting is the queue mailbox unless grtBox is specified QUEUE TIMEOUT grt grtBox The call was in the queue too long That is it exceeded the QUEUE TIME which was specified by the creator of the queue this may be used to set a policy that callers who wait longer than some given time are sent to voicemail for a later callback fo...

Page 174: ...eue if any agent is attached to it The default queue is the current box if queue is not given You need the CREATE QUEUE privilege to delete a queue for a box Return values Empty string Error codes PERMDENIED queue INVALID QUEUE queue AGENT ATTACHED queue create queue columns queue queue key value Description Create additional parameters to be used by the queue The parameters are not necessarily kn...

Page 175: ...an infinite timeout This is the default max calls size If the queue reaches this size any enqueue call call will fail with MAX QCALLS The default is no limit on the size of the queue require wrapup boolean Allow a wrapup period after taking a call The default is false Return values Empty string Error codes PERMDENIED queue INVALID QUEUE queue INVALIDVALUE key value get queue setting queue queue De...

Page 176: ...n call attach to queue to actually start receiving calls If queue is given then modify the given queue rather than the current box You need to call set agent settings to modify the agent s per queue privileges Return values Empty string Error codes PERMDENIED queue INVALID QUEUE queue INVALID AGENT queue AGENT EXISTS agent BOXNOTEXIST agent set agent setting queue queue agent list key value Descri...

Page 177: ...ue There are several privileges each agent can have 1 The agent can view the calls and agents in the queue view 2 The agent can reject a call being sent to him from the queue rejection In this case the agent will get a popup on the screen asking him if he wishes to accept the call He can then accept or reject every call as it comes to him The agent should use the accept call member function to acc...

Page 178: ...DENIED queue INVALID QUEUE queue INVALID AGENT queue disable agent queue queue agent Description This function disables the agents from the list of boxes allowed to receive calls from the queue If any of the agents are currently talking to a call from the queue the call is not killed and the variable the agent is using is still valid and the agent can still receive calls He will not be disabled un...

Page 179: ...ttach to a queue you are listed as unavailable unless you don t have the available privilege in which your state will be available You must call the available or wrapup functions before you are considered available to take a call You cannot attach to a queue if you are already attached You will get an error Any existing var is silently replaced Return values agent id Error codes INVALID AGENT agen...

Page 180: ... id then the call remains under the management of the queue If the disposition is hold then mailbox and agent id options are ignored and the call remains in the queue If the disposition is allow timeout then the the grt value specifies if the queue s setting max wait will take affect or not This is useful in keeping a caller in the queue beyond the max wait setting Return values Empty string Error...

Page 181: ... use the bathroom or a long period of time such as when an individual is using these features to effect network call screening An agent could make himself unavailable just by removing himself from the queue but then the handle would disappear and any calls that only matched that agent would be removed These calls currently stay in the queue until the agent makes himself available again To specify ...

Page 182: ... gets sent a call for acceptance or rejection he is automatically marked for deciding call If he rejects the call he is marked back to the agent s previous state whether it was available or unavailable but the call is annotated with information noting that the call should not be sent back to the same agent again see figure 15 1 This is also true if the agent doesn t respond within the rejection ti...

Page 183: ... agent id for each agent in the queue The value of the array at this index is another a list that contains the following key value pairs agent id The current queue manager s id of the agent mailbox box The mailbox of the agent view boolean Whether the agent has the view privilege rejection boolean Whether the agent has the rejection privilege disposition boolean Whether the agent has the dispositi...

Page 184: ...qhandle active call info Description This command returns all the information about the call an agent is connected to in a queue You don t need the view privilege to execute this call Return values An a list of a lists The first a list is a list of the call id The second nested set of a lists has the same key value pairs as the call info command on page 188 Error codes errorCode Description INVALI...

Page 185: ...number The total number of calls that have gone to voicemail hour answered number The total number of calls that have been answered by agents within the last hour hour lost number The total number of calls that hungup within the last hour hour reload number The total number of calls that exited the queue by dialing digits within the last hour hour total number The total number of calls that have e...

Page 186: ...ort covers activities by all agents of the queue In this case the from and to arguments may be used but the by and agent id arguments are not used The function returns an a list of agent id values with statistical data about each agent as the associated value The data summarizes that agent s activities over the entire period specified by the from and to arguments or their default values qhandle ci...

Page 187: ...d to requeue the call then we can use the top option so that the call isn t put back at the end of the queue after having waited to reach the top already When you use this option it has the side effect that the agent the call was originally sent to is made unavailable as if the agent had executed the qhandle available false call Since the agent didn t answer it is assumed he is unavailable but for...

Page 188: ... a caller to use IVR or some other audio application while waiting in the queue Perhaps they are allowed to listen to menus which answer commonly asked questions on the hope that they will answer their own question while still in the queue While they are doing this they are not monitoring their queue variable so they need to indicate that they are not available to be transferred to an agent for th...

Page 189: ...value pairs skills skills Necessary skills needed for this call caller id phone number Phone number of caller call state state state is either enabled disabled wait for agent response call taken connecting or transfer failed When enabled the call is allowed to be transferred to an agent When disabled a transferable false has been executed and the call is not going to get sent to an agent time ente...

Page 190: ...om connecting to unavailable The call will return to the queue manager for further assignment This function can also be called out of context basically the normally context is when a caller is connecting to an agent Out of context is any other time in which the reason must be used During these other times the caller can call this proc to update the status of its state For example the caller can te...

Page 191: ...s that the agent has put this call on hold for the indicated number of seconds This information is recorded in the queue statistics database for the agent not for the call chandle agent redirect Description This function indicates that the agent is redirecting this call transferring it This information is recorded in the queue statistics database for the agent not for the call 190 ...

Page 192: ...e database goes away Normally each operation is a separate transaction This eliminates cumbersome begin commit fetch sequences If you want to bundle up operations into one transaction begin the transaction with the begin member function and end it with commit or rollback You can then use the fetch operation to retrieve the results Because multiple ports and or network clients may be executing SQL ...

Page 193: ... after all the variables using the connection are gone and timeout minutes occurs the connection is released The default is 5 minutes If you are sharing the connection and you are not the first one to make the connection timeout is ignored That is only the first shared connection which is the one which establishes the connection gets to set the timeout value Return values Empty string Error codes ...

Page 194: ...mally the SQL command is executed synchronously and control will not return to the Tcl interpreter until it has completed The async option causes the query to be run in a separate thread In this case you can use member functions result and stop and use the hfunc with the wait command just as with VP devices Return values An a list with two elements row count and col count You can use fetch to retr...

Page 195: ...and you wish to use that default value then you may omit specifying that particular parameter altogether For each in parameter you must specify the parameter name and the value which is to be passed into that parameter For each out parameter you must specify a Tcl variable name into which the returned value should be stored For each inout parameter you must specify a Tcl variable name into which t...

Page 196: ...ormation about the result set that will be returned by the fetch command Return values An a list of a lists The first a list is ordered and the key is the name of the column The value is an a list with the following keys size data type nullable and significant digits hfunc get isolation Description Returns information about the transaction isolation levels available on this database connection in ...

Page 197: ...isolation level Description This function sets the transaction isolation level for this database connection to one of the four possible levels read uncommitted read committed repeatable read and serializable 196 ...

Page 198: ...e If there are fewer than n lines in the file or if the file has wrapped around then trace out may return fewer than n lines If the file is empty or is not being written to trace out returns the empty string The logged in mailbox must have the MONITOR privilege whoami Description This function returns the mailbox number that the interpreter is currently logged in as If not logged in then the empty...

Page 199: ...m will send a Return Linefeed pair after string but this behavior can be suppressed by using the nonewline option random limit seed seedval Description Generate a pseudorandom integer greater than or equal to zero and less than limit If seed is specified then the function resets the random number generator to a starting point derived from the seedval Often the value of clock seconds is used for th...

Page 200: ... enable debugger boolean Description Turns on or off the Tcl debugger within the current interpreter It makes the debug window pop up It must be called at the top of the call stack and TclDebug dll must be loaded use the dlls setting in the Configuration Database Return values Empty string Error codes NOTBOOLEAN boolean get free disk space Description Returns the integer percent free disk space ac...

Page 201: ...bmitted to the queue to execute as the future delivery mailbox so this configuration database parameter must be defined and this mailbox must exist for anonymous users to be able to submit fax requests The command is defined for anonymous users only on interpreters started to process inbound telephone calls The job template used is called FaxOut This template must exist for the job to be processed...

Page 202: ...ing F field mailbox Expand the name field using the User Name field in the MMO Lookup Table or the comment field using the COMMENT box setting depending on the value of field If field is 1 or 2 expand the name field I know this is weird but it is the way Amanda Work Group works If field is 3 expand the comment field F Perform a hookflash G0 G1 G2 G3 G4 G5 G6 G7 G8 G9 The 10 global variables G mail...

Page 203: ...d number as a date The number should be MMDDYY or MMDDYYYY e g 06261994 for June 26th 1994 P amount currency Say the amount as a currency currency can be for dollars and cents F for francs and centimes and P for pesos and centavos P number N Say the absolute value of a number P time T Say the specified number as a time of day time should be in HHMM format P A string Say the characters of the speci...

Page 204: ... for the first character and also between characters for the character to be received on the serial port T Expands to the number of seconds that the current call has been active U Expands to current mailbox number V Expands to the variable field of a ctrigger record W Expands to the day of the week as an integer Number 1 is Sunday W n event mailbox Wait for an event If only the first argument is g...

Page 205: ...x Locale specific date format X Locale specific time format y Year without century 00 99 Y Year with century e g 1990 Z Time zone name If the format argument is not specified the format string a b d H M S Z Y is used If the gmt argument is present the next argument must be a boolean value which if true specifies that the time will be formatted as GMT If false then the local timezone will be used a...

Page 206: ...table units are year fortnight month week day hour minute or min and second or sec The unit can be specified as a singular or plural as in 3 weeks These modifiers may also be specified tomorrow yesterday today now last this next ago The actual date is calculated according to the following steps First any absolute date and or time is processed and converted Using that time as the base day of week s...

Page 207: ...cting and terminating threads in the system They are as follows get thread info me category category Description Return information on each thread running in the system If category is given only return information on the threads in each category Category can be monitor notify template AutoScheduler spawn phone network sound card startup and pop If me is specified then only information about the cu...

Page 208: ...d Description Kills the threads with the given thread ids You need the KILL privilege to execute this command and the threads need to be running as descendents of your box Return values Empty string Error codes THREADNOTEXIST thread id PERMDENIED 17 4 Logging There are a couple of functions for logging information to files or the console They are as follows wlog arg Description Write a log message...

Page 209: ...ech recognition with the VP recognize command Return values Empty string Error codes PERMDENIED GRAMMARCOMPILEERR grammar The following member functions for voice processing resources become enabled create sr engine var Description The create sr function can be used to create a speech recognition engine which can be used with the recognize function described below to perform speech recognition fun...

Page 210: ...The default is 50 and 75 respectively The actual value recieve on a particular recognition is returned in the confidence value speak play options gender male female neutral speaker name language langcode sublanguage sublangcode phrase Description Perform text to speech on the phrase s specified Most play options are supported nodtmf clear volume speed term noretain bargein and maxpause The gender ...

Page 211: ...tions to dynamic rules of the grammar rule is the dynamic rule to modify property is the property name PROPNAME attribute of the elements to add var list is a list of elements to add For example this can be used to add the names of the mailboxes into the grammar at run time sr set profile profile attrib Description This set the current profile for the recognition engine to use In general a profile...

Page 212: ...quest The key value list argument must be a list with an even number of elements that alternate between keys and values The keys become header field names Newlines are stripped from the values so the header cannot be corrupted For example if keyvaluelist is Pragma no cache then the following header is included in the HTTP request Pragma no cache The query option causes http geturl to do a POST of ...

Page 213: ...pecialized way The TCP Client Connection feature allows you to do this create tcp server port handle Description The create tcp function allows you to create a TCP connection To be able to call it you must be logged in or the current interpreter must be a channel interpreter which is running in response to an incoming telephone call If create tcp fails it returns the failure reason and TCL OK On s...

Page 214: ...ng anything on the socket before returning whatever has been received to that point handle stop Description This function causes a previously issued asynchronous receive command to be stopped if it is still running handle result Description This function returns the results of a previous issued asynchronous receive function If the function is still running then it will block until the function fin...

Page 215: ...et was done then an empty string is returned Note that the indavo box sends a reset recommendation when certain fields are set mainly the ones in set config and set ring group If the Indavo box sends that recommendation then it is reset and the socket is close Return values Empty string Error codes FAIL LOAD PARAM FAIL SAVE PARAM ILINK FAIL CONNECT ILINK CORRUPT ILINK RESET handle var set ring gro...

Page 216: ...ANGE FAIL GET PARAM handle var set port port field value Description This sets the field of an extension port The port is 1 based ranging from 1 to 12 Must call save after all the set xxxx have been called fields can be any of the following phone name rings rna busy fwd phone and call waiting Return values Empty string Error codes ILINK INVALID PORT ILINK PORT RANGE FAIL GET PARAM handle var get p...

Page 217: ...fter all the set xxxx have been called Return values Empty string Error codes ILINK INVALID PORT ILINK PORT RANGE FAIL GET PARAM handle var set config field value Description This sets the basic configuration settings of the indavo box Must call save after all the set xxxx have been called fields can be any of the following 911 redirect 411 redirect voicemail redirect base ext base group operator ...

Page 218: ...COM needs to be initialized and uninitialized in a consistent manor within a particular connection instance to Amanda thread The following function within the core of Amanda will control that enable com multithreaded Description This function will enable COM for this particular connection thread Consult the particular module s documentation on what the value of multthreaded should be This boolean ...

Page 219: ...occurred BOARDNOTEXIST Board does not exist BOXEXISTS Box exists BOXHASCHILD Cannot delete a box with children BOXHASMSGS The destination box has messages BOXLOGGEDIN Cannot delete a box that is logged in BOXMANDATORY You must give the box argument when not logged in BOXNOTEXIST Box does not exist BREQNLOGIN You must be logged in or specify box CALLNOTOUTSTAND There is no outstanding call to accep...

Page 220: ...lid SQL statement INVALIDTIME Invalid time INVALIDTYPE Invalid type INVALIDVALUE Invalid value INVRECIPIENT Invalid recipient KEYMANDATORY Key is mandatory KEYNOTEXIST Key does not exist KILLED Interpreter was killed LANGNOTEXIST Language does not exist LOGINFAILED Login failed MALFORMEDFILE Malformed file MAPEXISTS Map exists MAPNOTEXIST Map does not exist MAXHANDLES The maximum number of handles...

Page 221: ...TCONFLICT Cannot give two variables the same port number PORTNOTEXIST Port does not exist PORTPRIVILEGED Cannot open privileged port PRIVNOTEXIST Privilege does not exist PROCINUSE Procedure is in use PROCNAMETOOLONG Procedure name is too long PROCNOTEXIST Procedure does not exist PROMPTNOTEXIST Prompt does not exist QEXISTS Queue already exists QUEUENOTEXIST Invalid queue QUEUEFULL The queue is f...

Page 222: ...andle stop 189 chandle transfer failed 189 chandle transfer ok 189 chandle transferable 187 chandle wrap up mode auto 188 change folder 71 check recipients 77 cid report 185 clock 203 204 columns 192 COM 217 command substitution 11 commit 194 compile grammar 208 connect 94 connect indavo 213 connect odbc 192 connect to pop server 116 continue 22 convert to 66 copy to 67 create box 50 create mmo 69...

Page 223: ...t lmapping keys 127 get mmo 108 get msg 118 get msg top 118 get next msg 71 get odbc sources 191 get param 134 get param by long 134 get param help keys 136 get param help text 136 get param keys 135 get port 215 get port status 110 get ports in use 111 get prev msg 73 get privilege keys 44 get privilege value 43 get published mmo 88 get queue setting 174 get resource stats 37 get ring group 215 g...

Page 224: ...117 list enqueued ports 110 list languages 111 list published mmos 89 list resource types 36 list tmapping databases 132 lists 9 llength 16 load prompt set 106 load tones 108 Logging Events 207 login 44 logout 45 lookup mmo 81 lookup mmo attr 82 lookup mmo keys 83 lrange 18 lreplace 18 ls connect 94 ls disconnect 94 ls dsp attach 94 ls flashhook 97 ls get ani 97 ls get dnis 97 ls port 96 ls seize ...

Page 225: ...e 178 qhandle event 179 qhandle position 182 qhandle queue info 181 qhandle stats 184 qhandle status 183 qhandle stop 179 qhandle wrapup 180 query tmapping 132 queue fax 200 queue info 181 187 quit 119 random 198 read 124 read only 64 receive 212 receive fax 114 recip heard announcement 87 recip list announcement 87 recognize 208 record 103 ref count 64 rename proc 163 reparent box 51 reset box st...

Page 226: ...s 203 tokens 201 trace out 197 transfer failed 189 transfer ok 189 transferable 187 type 64 undelete msgs 119 uniq id list 117 unit 96 98 113 unset 12 uptime 205 upvar 25 variable substitution 8 verify sac 45 VoIP Appliance Functions 213 vp beep 105 vp dial 108 vp dialtone 106 vp get digits 107 vp get mmo 108 vp init fax 109 vp load prompt set 106 vp load tones 108 vp pause 98 vp pcpm 104 vp play ...

Reviews: