I found some code Dev Ashish posted nearly a decade
ago in response to someone's inquiry describing their need
to dial a number, monitor call progress and determine whether
it was busy. This was back when A2.0 was more widely used,
so the code is Access Basic. Autodialer is not the answer, as
it requires users to take handsets off-hook manually.
I find myself in need of more direct control of a voice/data/fax
modem from an A97 program. There's a 3Com chipset on the
card. I want to seize a line, take it off-hook, dial a number and
hang it up (go back on hook) at a desired time. That's the basics.
If it is possible, some call progress feedback would be nice to
read and act upon. Yes, if after picking up on a line, if no dialtone
is present, I would like to hang it back up (IE, someone has picked
up on the line at another extension and is already using it). If I can
get feedback on ring detect, busy, fast busy - that would be great
and I can use it. But I'll be content to pickup, dial and hangup.
Am seeking some example procedures illustrating basic concepts.
Here's a snippet from Dev's 1997 post...
' ************************************************** *********
' FUNCTION: DialNumber()
'
' PURPOSE: To dial a telephone number using the computer's modem
'
' ARGUMENTS:
' PhoneNumber: The telephone number to dial
'
' CommPort: The communications port the modem is connected
' to. Typically, modems are found on COM2, however,
' they can be configured for any COM port.
'
' EXAMPLE:
' Type the following in the Immediate window using a modem
' connected to the COM2 port:
'
' ? DialNumber("555-1212", "COM2")
'
' ************************************************** *********
Function DialNumber (PhoneNumber, CommPort As String)
Dim Msg As String, MsgBoxType As Integer, MsgBoxTitle As
String
Dim ModemCommand As String
Dim OpenPort As Integer
Dim RetVal As Integer
Dim StartTime
Dim CR As String: CR = Chr$(13)
Dim LF As String: LF = Chr$(10)
' Ask the user to pick up the phone
Msg = "Please pickup the phone and choose OK to dial " _
& PhoneNumber
MsgBoxType = MB_ICONINFORMATION + MB_OKCANCEL
MsgBoxTitle = "Dial Number"
If MsgBox(Msg, MsgBoxType, MsgBoxTitle) = ID_CANCEL Then
Exit Function
End If
' Open the communications port
OpenPort = OpenComm(CommPort, 1024, 128)
If OpenPort < 0 Then
Msg = "Unable to open communication port " & CommPort
GoTo Err_DialNumber
End If
' Send the telephone number to the modem
ModemCommand = "ATDT" & PhoneNumber & CR & LF
If WriteComm(OpenPort, ModemCommand, Len(ModemCommand)) < 0
Then
Msg = "Unable to dial number " & PhoneNumber
GoTo Err_DialNumber
End If
' Wait WAITSECONDS seconds for the phone to dial
StartTime = Timer
While Timer < StartTime + WAITSECONDS
DoEvents
Wend
' Reset the modem and take it off line
ModemCommand = "ATH0" & CR & LF
RetVal = WriteComm(OpenPort, ModemCommand, Len(ModemCommand))
' Close the communications port
RetVal = CloseComm(OpenPort)
Exit Function
Err_DialNumber: 'This is not an On Error routine
Msg = Msg & CR & CR & "Make sure no other devices are using _
communication port " & CommPort
MsgBoxType = MB_ICONSTOP
MsgBoxTitle = "Dial Number Error"
MsgBox Msg, MsgBoxType, MsgBoxTitle
End Function
4. Open the Employees form in Design view.
5. Place a command button with the following properties on the form,
next
to the Home Phone field.
Microsoft Access 1.x:
ControlName: btnDialPhone
Caption: Dial
OnPush: =DialNumber([Home Phone], "COM2")
Microsoft Access 2.0:
Name: btnDialPhone
Caption: Dial
OnClick: =DialNumber([Home Phone], "COM2")
6. View the form in Form view. To dial an employee's home phone
number,
choose the Dial button.
--
__________________________________________________ ________________________
Dev Ashish
dash...@mailnet.ho.att.com
Applied Technologies Organization Holmdel, NJ
AT&T Laboratories