FaxMan Jr
Rings

 

FaxMan Jr. also gives you the ability to simply listen for a ring on the phone line connected to the faxmodem by calling the Listen method. The Listen method waits until a ring is detected on the phone line. When a ring is detected, the Ring event is fired, and your application gets an opportunity to decide what happens next, depending on the value you set for the Action parameter passed to the Ring event. These are the valid values for the Action parameter:

 

 Action = 0 – quit listening for rings and return from the Listen method.

 Action = 1 – ignore the ring and continue listening for rings.

 Action = 2 – answer the ring and attempt to receive a fax.

 

The following Ring event code listens for 3 rings and then attempts to receive a fax:

 

‘nRingCnt is a global variable which is set to 0 the first time

‘this event is fired...

Private Sub faxctl1_Ring(pnAction As Integer)

 

 

 nRingCnt = nRingCnt + 1

 

 if nRingCnt = 3 then

  nRingCnt = 0 ‘reset this for next calls

  pnAction = 2 ‘now try to receive a fax

 else

  pnAction = 1 ‘keep listening ‘till we get 3 rings

 end if

End Sub

 

 


© 2014 Data Techniques, Inc. All Rights Reserved.

Send comments on this topic.