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

i met a question when dial a number thought a modem
here is the scripts
use Device::Modem; my $modem = new Device::Modem( port => '/dev/ttyS1' ); if( $modem->connect( baudrate => 9600 ) ) { print "connected!\n"; } else { print "sorry, no connection with serial port!\n"; } # when program running at this line, return connected!, $modem->attention(); # send `attention' sequence (+++) $modem->dial('02270469012'); # dial phone number #when program running at this line was halted
after a quite long time (about 5 minutes), program printed out following message.
print " dial number was sent \n";
no any noise happened at the modem. seems just halting.
could you give me a hand, thanks.

20030519 Edit by Corion Fixed code tags

Replies are listed 'Best First'.
Re: modem question
by teabag (Pilgrim) on May 19, 2003 at 14:03 UTC
    uhm.. I never use this module. but looking at the docs it looks like you just copied some lines of the synopsis?

    Try some testing like:

    $modem->is_active(); # Tests whether modem device is active + or not # So far it works for modem OFF/ modem + ON condition

    And you might also want to check out the examples/dial.pl examples/shell.pl, and examples/active.pl scripts that come with the module.

    And please use <CODE> tags next post? ;)

    Teabag
    Sure there's more than one way, but one just needs one anyway - Teabag

      ok, thank you so much
Re: modem question
by zby (Vicar) on May 19, 2003 at 13:13 UTC
    And did you try to send the commands to the modem interactively with a terminal like minicom? I would try that first.