ExceleTel Header Logo

 

menu_end_leftmenu_homemenu_aboutmenu_productsmenu_salesmenu_supportmenu_searchmenu_end_right

 

etDataModemDial Sample Program Source Code

Private Function IsDataModem() As Boolean
Dim ModemMediaModes As Integer

    ' These are the minimal media modes expected for standard data modems
    ModemMediaModes = LINEMEDIAMODE_INTERACTIVEVOICE + LINEMEDIAMODE_DATAMODEM

    ' Check to see if the selected device is a modem and it is a voice modem
    If (InStr(1, etLine1.TAPITSP, "Modem", 1) > 0) And _
        ((etLine1.DeviceMediaModesAvailable And ModemMediaModes) >= _
        ModemMediaModes) Then
        IsDataModem = True
    Else
        IsDataModem = False
    End If
End Function

Private Function IsVoiceModem() As Boolean
Dim ModemMediaModes As Integer
Dim VoiceModemMediaModes As Integer

    ' These are the minimal media modes expected for standard data modems
    ModemMediaModes = LINEMEDIAMODE_INTERACTIVEVOICE + LINEMEDIAMODE_DATAMODEM
    ' These are the minimal media modes expected for voice modems
    VoiceModemMediaModes = ModemMediaModes + LINEMEDIAMODE_UNKNOWN + _
                            LINEMEDIAMODE_AUTOMATEDVOICE

    ' Check to see if the selected device is a modem and it is a voice modem
    If (InStr(1, etLine1.TAPITSP, "Modem", 1) > 0) And _
        ((etLine1.DeviceMediaModesAvailable And VoiceModemMediaModes) >=_
          VoiceModemMediaModes) Then
        IsVoiceModem = True
    Else
        IsVoiceModem = False
    End If
End Function

Private Sub ComboDevice_Click()
    ' Set the TAPI Line device
    etLine1.DeviceName = ComboDevice.Text

    ' Check to see if the selected device is a modem
    If IsDataModem Then
        ' Check to see if the selected device is a Voice modem
        If IsVoiceModem Then
            MsgBox ("This device is Voice Modem!" & vbCrLf & _
                    "Use the etVoiceModemDial sample program.")
            ' Disable the Dial button
            CommandDial.Enabled = False
        Else
            ' Enable the Dial button
            CommandDial.Enabled = True
        End If
    Else
        MsgBox ("This device is not a Modem")
        ' Disable the Dial button
        CommandDial.Enabled = False
    End If
End Sub

Private Sub CommandDial_Click()
    ' Use Microsoft's modem compatibility mode
    etLine1.PrivilegeNone = True

    ' Active the TAPI Line device
    etLine1.DeviceActive = True

    If Not etLine1.DeviceActive Then
        MsgBox ("Error opening line device: " & etLine1.ErrorText)
    Else
        ' Set the phone number
        etLine1.CallPhoneNumber = TextPhoneNumber.Text
        ' Dial
        etLine1.CallDial
    End If
End Sub

Private Sub etLine1_OnConnected(ByVal CallHandle As Long)
    ' As soon as the call is connected deactive the TAPI Line device
    etLine1.DeviceActive = False
End Sub

Private Sub Form_Load()
    'Enabled all ExceleTel TeleTools controls before using them
    etLine1.Enabled = True

    ComboDevice.Clear
    etLine1.DeviceID = 0
    For L = 0 To etLine1.DeviceCount - 1
        ComboDevice.AddItem etLine1.DeviceList(L)
    Next L
    If ComboDevice.ListCount > 0 Then
        ComboDevice.Text = ComboDevice.List(0)
    End If
End Sub

 

 
 


Copyright © 1997-2007 ExceleTel Inc. All rights reserved. Friday August 17, 2007 11:05:24 AM

Contact Us