Have you looked at vgetty? I started down this path and got side tracked. I remember this doing most of what I wanted. There's a module as well Modem::Vgetty, though I've never really looked at it.
And this one looks like the fun sloution to figure out. I think once I figure out what VOCP is doing I'll give a shot at writing my own using vgetty. Understanding it all definitely wouldn't hurt.