There is no program that I know of that can do this, but there are several programs with scripting languages that will allow you to do this.
Basically you want to wait for "RING" and type:
ATDT9,9,9,9,9,9,9,9;
and then press Enter. The semicolon at the end of the line tells the modem to return to command mode at the end of the command rather than entering data mode. You also need some way to determine that the call has ended in order to send the "ATH" to hang up the phone line.
Better yet, if you have a voice modem, you could use that to receive and send without concerning yourself with going into data mode.
As far as software goes, if you are a Windows user the only software that I could recommend would be Procomm, which uses the ASPECT scripting language that is very powerful. It is also pretty expensive for simple terminal emulation software.
If you are willing use Linux, you can use the SEND/EXPECT, or chat or numerous other methods to process the incoming strings and produce outgoing responses.
pansophic