Handbook:Advanced Server Configuration:Per-call Dynamic Configuration
A program can make dynamic configuration changes, before faxgetty will answer a call, based on the device and CallIDs. This program can also be used to reject (to not answer) a call.
DynamicConfig option must be set in each modem config file, specifying the program to run before answering a call. The specified program must be executable by the user running faxgetty.
The DynamicConfig program is called with the device id as first parameter and all CallID following it. To change a parameter for the current call, the program must send to standard output the configuration items to change. The format used is the same as in the config files. i.e. One configuration item per line with the parameter and value separated by a colon (:), e.g. LocalIdentifier: 1.800.555.1212. To reject a call, the special parameter RejectCall can be set to true.
Here is a sample DynamicConfig script which will set the LocalIdentifier to the called DID, rejects call from 8005550313 and disable extended resolutions from 2125550148:
#!/bin/sh DEVICE=$1; shift; COUNT=1 while [ $# -ge 1 ]; do # The eval has $1 set yet, and this forces a variable-to-variable # assignment, allowing us to not need to do escaping eval CALLID$COUNT='$1' shift COUNT=`expr $COUNT + 1` done # CALLID3 contains the last 4 digits of the called number echo "LocalIdentifier: +1.408.555.$CALLID3" # CALLID1 contains the Caller ID case $CALLID1 in 8005550313) echo "RejectCall: true";; 2125550148) echo "Class1ExtendedRes: false";; esac