If I understand your question, you're saying that you have a Windows machine with a modem, and you want to write a program that will interface with the modem on that machine, and when someone dials into the modem, you want your Perl program to initiate a TCP connection to something else and bridge all input and output between the two. Right?
If I got that part right, then I have to assume that you haven't done a lot of socket programming, and you're not sure how to handle listen to two things at once (the modem and the socket) so that you can effectively pass the data back and forth.
If I guessed all that stuff right, then I think the answer you're looking for is in the modules IO::Select and IO::Socket. However, I know there used to be some problems with sockets under Windows, so check on that first. Also, you can check the fine tutorial Reading from more than one socket at once | [reply] |
I guess my English is worst than I was thinking ;)
I have two Win32 machines, each with a modem.
The first one should dial the phone number of the second machine.
I know how to use the Win32::Serialport to do that, and I know how to exchange data through a normal phone when you know the protocole at server side.
I just need to know how the second machine can listen at the serial port and get the line if called.
This is not "socket programmming". But handle socket and the modem at the same time has been done here before, see http://www.perlmonks.org/?node_id=353466
Anyway, thank for your time splinky
| [reply] |
It seeems that the Telephony API of microsoft (TAPI) allows to listen at the serial port and thus take the line on call.
But that TAPI is a mess of undocumented functions.
Nobody had tried that before, using Win32::API call?
| [reply] |