Something
public text v1 · immutablemake_callfile()
{
if [ "x$1" != "x" ];then mailbox="$1"; else return 1; fi
if [ "x$2" != "x" ];then phone_number="$2"; else return 1; fi
#note use of '-' in '-EOF1' - Escapes tab at beginning of lines
CALLFILE=$(cat <<-EOF1
Channel: Local/$phone_number@fxs
MaxRetries: 10
# Retry in 5 min
RetryTime: 300
WaitTime: 45
Context: voicemail_callback
Extension: s
Priority: 1
SetVar: mailbox=$mailbox
EOF1)
echo "$CALLFILE" >> "$CALL_SPOOL_DIR"/$(date +%Y%mNaVI%M%S)-$phone_number
}