Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Perl, Expect Fax modem problem

Posted on 2003-02-25
2
Medium Priority
?
406 Views
Last Modified: 2013-12-27
I'm trying to use the mon dialin.monitor to make sure that our hylafax server is running. (It sometimes hangs for no reason)  I don't know what I need the script to Expect to be returned upon the connect to the fax server.  It waits for a connect but return a NO CARRIER.  It doesn't seem to respond to the fax servers request for a speed change.  Any clues would be appreciated.  Code and logs follow

Expect code for connect check:

   print $s "ATDT$NUMBER\r";
#    $s->expect(0);
#       $s->exp_before();
   ($matched_pattern_position, $error,$successfully_matching_string,
           $before_match,$after_match) =
           $s->expect ($DIAL_TIMEOUT, "CONNECT", "BUSY", "NO CARRIER", "NO DIALTONE");

if ($error eq "1:TIMEOUT") {
       unlock_modem;
       return "timeout waiting for connection [$before_match] [$after_match]";
   } elsif (!defined $matched_pattern_position) {
       unlock_modem;
       return "no pattern matched waiting for connection";
   } elsif ($matched_pattern_position != 1) {
       unlock_modem;
       return "no connection: $successfully_matching_string";
   }
   $s->clear_accum;



Output on client side:

dialing and waiting for carrier
Beginning expect from handle id(3).
Accumulator: ''
Expect timeout time: 60 seconds.
expect: Pty=handle id(3), time=1046199201, loop_time=60
expect: handle handle id(3) ready.
expect: read 8 byte(s) from handle id(3).
NO CARexpect: handle handle id(3) ready.
expect: read 6 byte(s) from handle id(3).
Matched pattern 3 ('NO CARRIER')!
       Before match string: '\r\015'
       Match string: 'NO CARRIER'
       After match string: '\r\015'
Returning from expect successfully.
Accumulator: '\r\015'
This is the matched pattern 3
This is the error
This is the success NO CARRIER
This is before the match
This is after the match
       unlocking modem



This is the hylafax log of the connection:

Feb 25 13:01:52.55: [ 6712]: SESSION BEGIN 00000785 19995551212
Feb 25 13:01:52.55: [ 6712]: HylaFAX (tm) Version 4.1.5
Feb 25 13:01:52.55: [ 6712]: MODEM set XON/XOFF/FLUSH: input ignored, output disabled
Feb 25 13:01:52.55: [ 6712]: <-- [13:AT+FCLASS=1A\r]
Feb 25 13:01:58.12: [ 6712]: --> [7:CONNECT]
Feb 25 13:01:58.12: [ 6712]: ANSWER: FAX CONNECTION  DEVICE '/dev/ttyS0'
Feb 25 13:01:58.12: [ 6712]: MODEM input buffering enabled
Feb 25 13:01:58.12: [ 6712]: RECV FAX: begin
Feb 25 13:01:58.12: [ 6712]: MODEM input buffering disabled
Feb 25 13:01:58.12: [ 6712]: <-- data [23]
Feb 25 13:01:58.12: [ 6712]: <-- data [2]
Feb 25 13:01:58.16: [ 6712]: --> [7:CONNECT]
Feb 25 13:01:58.16: [ 6712]: <-- data [10]
Feb 25 13:01:58.16: [ 6712]: <-- data [2]
Feb 25 13:02:00.10: [ 6712]: --> [2:OK]
Feb 25 13:02:00.10: [ 6712]: <-- [9:AT+FRH=3\r]
Feb 25 13:02:03.20: [ 6712]: --> [0:]
Feb 25 13:02:03.20: [ 6712]: MODEM <Empty line>
Feb 25 13:02:03.20: [ 6712]: MODEM TIMEOUT: waiting for v.21 carrier
Feb 25 13:02:03.20: [ 6712]: <-- data [1]
Feb 25 13:02:03.21: [ 6712]: --> [2:OK]

**************** --> Following repeated 5 times
Feb 25 13:02:16.67: [ 6712]: DELAY 1500 ms
Feb 25 13:02:18.17: [ 6712]: <-- [9:AT+FTH=3\r]
Feb 25 13:02:18.21: [ 6712]: --> [7:CONNECT]
Feb 25 13:02:18.21: [ 6712]: <-- data [23]
Feb 25 13:02:18.21: [ 6712]: <-- data [2]
Feb 25 13:02:18.24: [ 6712]: --> [7:CONNECT]
Feb 25 13:02:18.24: [ 6712]: <-- data [10]
Feb 25 13:02:18.24: [ 6712]: <-- data [2]
Feb 25 13:02:20.29: [ 6712]: --> [2:OK]
Feb 25 13:02:20.29: [ 6712]: <-- [9:AT+FRH=3\r]
Feb 25 13:02:23.39: [ 6712]: --> [0:]
Feb 25 13:02:23.39: [ 6712]: MODEM <Empty line>
Feb 25 13:02:23.39: [ 6712]: MODEM TIMEOUT: waiting for v.21 carrier
Feb 25 13:02:23.39: [ 6712]: <-- data [1]
Feb 25 13:02:23.40: [ 6712]: --> [2:OK]
******************************--> repeat done

Feb 25 13:02:36.86: [ 6712]: RECV FAX: No answer (T.30 T1 timeout)
Feb 25 13:02:36.86: [ 6712]: RECV FAX: end
Feb 25 13:02:36.86: [ 6712]: SESSION END


Here is the stty init string

$s->exp_stty ("9600", "cs8", "crtscts", "-parenb", "-cstopb");
0
Comment
Question by:bkern
2 Comments
 
LVL 1

Accepted Solution

by:
rickisme earned 1500 total points
ID: 8022657
I sure am no expert on this kind of stuff but in reviewing the info it is clear to me that the receiving station is not acknowledgeing the attempt to connect and is timing out the send string.  I have had similar problems with other type systems and on several occassions have found the the final reset command was not present so "basically" after booting or seeing the first attempt it never does a complete reset so all attempts have this timeout problem.  It does appear that the send is going through and the reset on the sending side is OK as it repeatidly tries to resend.  If you have the manual on the software you might want to check to see if the reset command is being issued as the final (or first) string command to the downline systems(dependant upon your setup) after boot or initial attempt.  

Will the hylafax server allow you to do basic ping testing between systems?  It may be the best way to isolate the problem.  

Lord knows this will be a challenge... better you than me <g>.  Good Luck and God Bless, Rick.  >>I use to think I was a Tech... then I read this <bwg>.
0
 

Author Comment

by:bkern
ID: 8748988
Still haven't managed to get this working, it kind of fell through the cracks.  Upgrading to a modem that never locks up was an even easier solution!
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Before I go to far, let's explain HA (High Availability) and why you should consider it.  High availability is the mechanism used to provide redundancy to any service at the same site and appears as a single service to the users of that service.  As…
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses
Course of the Month15 days, 12 hours left to enroll

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question