COMMENT - Check for existence of ACU directory ; assign _acudir \v(home)ckermit.kad ; This should actually be system wide, ; but overidden by environment. if not exist \m(_acudir) goto noacu ; And names are \v(system) dependent. COMMENT - Have acu directory, so read it and define related macros ; echo { ACU directory is \m(_acudir)} def max_acus 25 ; Adjust this if you have more than 25 entries! open read \m(_acudir) ; Open ACU directory file xif fail { - echo Can't open \m(_acudir), - goto noacu - } declare \&a[\m(max_acus)] ; Declare array for acu directory entries for \%i 1 \m(max_acus) 1 { - ; Read entries into array read \&a[\%i], - if fail goto acudone - } close read ; Didn't reach the end echo - ; Close the file and print useful message \?Too many entries in ACU directory: echo { Maximum is \m(max_acus).} echo { Change definition of max_acus in \v(cmdfile) to allow more. } echo { ACU directory disabled.} goto noacu :ACUDONE ; We have the ACU directory in memory asg \&a[0] \feval(\%i - 1) ; Keep size of array in zeroth element COMMENT - ACUMATCH macro. Arguments: ; ; \%1 = modem type ; \%2 = speed ; \%3 = acu modem type ; \%4 = acu speed ; \%5 = acu line def acumatch if not = \v(argc) 6 end 1 ACUMATCH missing arguments,- if not eq "\%1" "\%3" return,- if not eq "\%2" "\%4" return,- return \%5 COMMENT - GETACU macro. Arguments: ; ; \%1 = modem type ; \%2 = speed ; define GETACU if not = \v(argc) 3 end 1 Usage: GETACU modem speed,- set case off,- ; Ignore alphabetic case for \%i 1 \&a[0] 1 { - ; Loop thru ACU directory asg \%3 \fexec(acumatch \%1 \%2 \&a[\%i]),- if not def \%3 continue,- set line \%3,- ; this should "lock" the line according to system rules if success break - ; If it works, we're done },- if not > \%i \&a[0] return \%3 ; Return the ACU line name COMMENT - ACUCALL macro. Arguments: ; ; \%1 = modem type ; \%2 = device name ; \%3 = speed ; \%4 = phone number ; ; This is an ACU-aware version of the CALL macro from the ckermit.ini ; file. It will use an ACU directory to find a dial line that is available ; when the line name in the service directory is ACU. It then uses CALL ; to do the actual calling. ; define ACUCALL if < \v(argc) 5 end 1 Usage: ACUCALL modem device speed number,- set modem \%1,- if fail end 1 unknown modem type: \%1,- xif equal \%2 ACU { - getacu \%1 \%3,- if def \v(return) asg \%2 \v(return), - else end 1 ACU type \%1 at speed \%3 unavailable.,- },- echo ACUCALL setting line to \%2,- ; tell user what ACU we picked call \%1 \%2 \%3 {\%4} ; phone numbers often have spaces in them. :NOACU