Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

'Glitch' with Faxstatus cmd variables.

Status
Not open for further replies.

comtechau

Technical User
Mar 24, 2007
81
0
0
AU
I'm hoping someone can help with this...
I use Procomm Plus 4.8, Build 71. We have hundreds of Fax machines that get serviced in-house. For basic testing, I wrote a script to recieve a fax, then send that fax and a cover page back to the originating machine. The entire script works [in a backwards kinda way], but I've a problem I can't solve with this line...

faxstatus CURRENT Status FileName Faxmsg FaxTSID

As per the Help File in procomm, my variable "FaxTSID" should receive the station ID. Which it nearly does EXCEPT the last character is always missing! No matter what brand/model fax machines I use, or how many characters are programmed in the Sender ID...It always drops the very last digit. Any ideas why?

I created a work around to this by ....
Code:
if strfind Faxmsg "Connected to"
;The FaxTSID is missing the last character for some reason
;hence we need to extract the TSID value differently
      	strcpy SendID Faxmsg
      	strdelete SendID 0 16
endif

But the work-around means my script can only send back to Traditional Fax Machines. For VOIP Fax / PC Fax Modems it attempts to dial back to the Station Name.

Incidentally, we can/do test using PSTN Fax Test Line Numbers... but for basic servicing, we only need to know that the sent/recieved faxes look okay.

Has anyone out there ever used that particular faxstatus variable succesfully?
I am wondering if it's a glitch in Procomm.
 
Are you able to pull the station ID by looking at the end of the Faxmsg variable, or does that only work for certain cases as mentioned in your post? Can you post an example of what is returned in Faxmsg and FaxTSID? I'm assuming it is a bug in Procomm unless there is a fixed limit that the station ID can be based on the fax protocol. If you increase the station ID by a couple characters, does the end character that you were previously missing then show up in the station ID?

 
Hi knob.
Yes, I can pull the Station ID from Faxmsg variable.
[but only from a 'real' fax machine i.e. none pc/modem]

Using a 'Real' Fax
When Faxstate is 'connected'the variables are...
Faxmsg = 61 7 xxxx1078
SendID = 61 7 xxxx1078
FaxTSID = 0
When Faxstate is 'recieving'the variables are...
Faxmsg = Recieving Page 1
SendID = 7xxxx1078
FaxTSID = 61 7 xxxx107

The last digit is missing from the 3rd variable (FaxTSID) of the 'faxstatus' command.

I never thought to ADD characters to the Station ID..
Made my Station ID 61 7 xxxx10789
When Faxstate was 'recieving'...
FaxTSID = 61 7 xxxx1078
Got the 8 this time, but no 9...


faxstatus CURRENT Status FileName Faxmsg FaxTSID

I couldn't solve this so I used the Faxmsg variable to get the Station ID instead of FaxTSID as I wanted.



EXCEPT for the following...
The fax station id has fields for Fax#, Ph# & Name.
When its a Standard Fax machine --->
Using the Faxmsg variable I get "Connected to <Fax#>"
So I can extract that number and redial it okay
Works Fine....

BUT When its a Fax Modem / VOIP Fax --->
The Faxmsg variable spits out "Connected to <Name>"
which is what it then will try to dial back to...
And that won't work...

Whichever way I go, it just don't work the way I wanted.... *darn*

I'm curious if anyone has ever succesfully used that 3rd variable for faxstatus to get the station ID, because it does not matter what I do, I come up one digit short.


 
BTW... this is the script in question...(MINUS a firm specific section that changed Public Numbers -> their INTERNAL equivelant)

Be gentle folks..This was my first procomm script!

Code:
; Fax-It-Back Script Version 06b
; last modified 17th April  2007.
; TEST VERSION

string FileName, FaxFile, Faxmsg, FaxTSID, DialStr, strvar, SendID, FaxBack, disptime, int_notes
integer Status, Len, Chr, Faxstate, cntr, iDay, iMonth, iYear, iMin, iHour, iSec   

proc main

	Status = 0
	Len = 0
	Chr = 0
        Faxstate = 0
        cntr = 0

   termreset
   termputs 2 0 "FAX-IT-BACK...v06b"	
   when USEREXIT call CleanUp    ; Watch for a disconnection.
   while 1
      ;display time/date
       ltimeints $LTIME iYear iMonth iDay iHour iMin iSec
       strfmt disptime "%02d/%02d/%d %02d:%02d:%02d" iDay iMonth iYear iHour iMin iSec
       termputs 1 0 disptime	
      
      faxstatus CURRENT Status FileName Faxmsg FaxTSID
      
      if strfind Faxmsg "Connected to"
      	;Thus
      	;the FaxTSID is missing the last character for some reason
      	;hence we need to extract the TSID value differently
       	strcpy SendID Faxmsg
      	strdelete SendID 0 16
      endif

      if strfind Faxmsg "Receiving Page"
            if Faxstate == 0
            Faxstate = 2
		;we are receiving a fax
	        ;save the fax file name
	        strcpy FaxBack FileName
                             	
                ; strip area code, etc
                ;spaces at end of #'s needed else other valid dialing digits are removed
                strreplace SendID "61 " ""
                strreplace SendID "07 " ""
                             	
		; strip all unnecessary characters from the TSID
  		strreplace SendID " " ""
  		strreplace SendID "+" ""
  		
   		; reverse the string R-L
   		strrev SendID
   		; read the string for 8 characters
   		substr DialStr SendID 0 8
   		; revert strings back to L-R
   		strrev SendID
   		strrev DialStr
   		
   		pause 2
   		
   		; this SECTION works on the extracted fax number
   		; @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
   		strlen DialStr Len         ; Get length of text string.
   		;Check for number starting with an "8", and length  
    			strgetc DialStr 0 chr
    		    			
    			if len < 7  
     				if chr == 56 ; "8"
        				;its now an internal number
         				;nothing to change
				endif         
    			else
     	 		strvar = "0,"
          			strcat strvar DialStr
           			strcpy DialStr strvar
     			endif    
            endif
      endif

      if strfind Faxmsg "Fax Successfully Received"
            if Faxstate == 2
            Faxstate = 3
            endif
      endif

     if Faxstate == 3
	if Status == 0
	;then we can send back the fax
                statmsg "PREPARING TO FAX BACK YOUR DOCUMENTS"
                pause 1
                statclear
                int_notes = "This is the cover page for an Automated Reply to the facsimile your machine has sent to our test fax line, 81-3777. If this fax has been recieved in error please disregard."
   		statmsg "Dialling Back"
       		strquote FileName
		strquote DialStr   
		faxsend CURRENT "Technicians" DialStr COVERSHEET "D:\Program Files\Symantec\Procomm Plus\Fax Cover Sheets\Faxmach2.cvr" NOTES int_notes SINGLE FaxBack
		;pause to ensure fax call is established
		pause 5
		call Loopfax
     	endif
     endif     
      if Status == 0
         strfmt FaxFile "The current fax modem is idle."
      endif
      statmsg FaxFile
yield   			;yield processing time - THIS SCRIPT IS ENDLESS LOOP           
endwhile
;end mainproc
endproc

proc Loopfax
		while $FAXSTATUS       ; Loop while fax in progress.
			;pause in 5 second increments...
			pause 5
			yield 		            ; Release processing time
						;end while fax
			endwhile
						;facsimile faxed-back
	        	
	        Faxstate = 0 	; reset the fax state
endproc

proc CleanUp
   faxcancel CURRENT            ; Cancel the fax send if user
                                ; tries to exit script.
   termreset 			; clears screen, resets comms   
   exit 			; user has selected exit so end 	
endproc


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top