The protocol you may be looking for is TAP. This is a modem-to-modem protocol for sending pager messages, rather than dialing acoustical DTMF tones using a modem.
Check out sendpage at http://sendpage.cpoint.net/. The software is entirely written in Perl and may include what you're looking for.