arunvelusamy has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks,

I want to send and receive data through analogue modem. I couldn't find any sample program for doing this. I tried and succeed in dialing using Device::Modem, but could not answer the call through program nor send data through it. Can anyone post a sample code for receiving a data from analogue modem?

Thanks monks.

Replies are listed 'Best First'.
Re: Communicating using modem
by roboticus (Chancellor) on Jun 09, 2006 at 12:28 UTC
    arunvelusamy:

    I just looked over Device::Modem's page. Are you having difficulty because of the documentation? It took me a few read-throughs, but it appears to me that you want to use the atsend() function to send data to the modem, and answer() to receive it. (I think the atsend method is misnamed--it looks as if it should be just send. As it's named now, it appears that it's useful only for sending AT commands.) Does that help? (I hope so, as none of my computers has a modem connected to it...)

    --roboticus

Re: Communicating using modem
by kabeldag (Hermit) on Jun 09, 2006 at 09:53 UTC
    You should of course check out standard MODEM commands for initializing the device (if you havn't already), setting it to certain modes etc. Once you know that, it's just a matter of writing/reading to and from it at the right times, via a handle of some sort.

    I don't have any examples :(.
    Though I can remember writing stupid dialer programs in C and BASIC to annoy people a long time ago.

    Would be interesting to see what people have to offer.

    PS: Ever heard a room full of Windows box's ringing like a phone, without a MODEM. All at the one time ? It's really amuzing :D ;) Well. For me it was :P Especially watching a few school teachers running for the IT support hotline..
Re: Communicating using modem
by jesuashok (Curate) on Jun 09, 2006 at 10:07 UTC
    Hi

    I have done modem stuff programs in 'C'. As kabeldag said, If your modem command works fine with your Os. The rest work will only a FileHandle Operation in perl.

    Modem commands

    "Keep pouring your ideas"
Re: Communicating using modem
by Argel (Prior) on Jun 09, 2006 at 21:05 UTC
    Not sure if this will help you or not, but a good example of an application using Device::SerialPort (the module Device::Modem is built upon) is sendPage.