You might want to RESET, besides ATTENTION (AT).
You might want to even force a Dial on one modem to your office phone, and get NO-HandShake/Modem present...
There has to be some public domain software to do what your expect.. have you search under google.com or maybe even Linux to get the "cu" source code.
The problem with Cu, I think it reads from standard-input... would be nice to change this to read from a script, much like, what uucp does.
a Great Reference Book:
UNIX Network Programming, W. Richard Stevens, Prentice Hall, 1990. ISBN 0-13-949871-1.
Golf is a Good Walk Spoiled, Mark Twain.