Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Win32::SerialPort server side

by didier (Vicar)
on Oct 04, 2005 at 07:23 UTC ( #497150=perlquestion: print w/ replies, xml ) Need Help??
didier has asked for the wisdom of the Perl Monks concerning the following question:


Hello,

I was using Win32::SerialPort to speak, over a phone line, with a data service without any problem.
Now I need to set up a service...
I know that I can configure an XP box to link modem's inbounds calls to a TCP interface on server side, but I hope a better solution.
So my question is: is someone knows how to listen the modem for incoming call and how to get the line using Perl ?

Thanks.

Comment on Win32::SerialPort server side
Re: Win32::SerialPort server side
by splinky (Hermit) on Oct 04, 2005 at 14:43 UTC
    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


      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


      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?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://497150]
Approved by Corion
Front-paged by planetscape
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (10)
As of 2014-09-17 20:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (98 votes), past polls