ExceleTel Header Logo

 

menu_end_leftmenu_homemenu_aboutmenu_productsmenu_salesmenu_supportmenu_searchmenu_end_right

 

etCallerID Sample Program Source Code

Private Sub ComboDevice_Click()
    If etLine1.DeviceActive Then
        etLine1.DeviceActive = False
    End If
    etLine1.DeviceID = ComboDevice.ListIndex
    etLine1.PrivilegeMonitor = True
    etLine1.PrivilegeOwner = True
    etLine1.DeviceActive = True
    If (Not etLine1.DeviceActive) Then
        If etLine1.ErrorNumber = LINEERR_INVALMEDIAMODE Then
            MsgBox ("TeleTools has detected that your device is a (" & _
                    etLine1.DeviceName & ") DATA modem and therefore " & _
                    has no voice capabilities." & vbCrLf & vbCrLf & _
                    "This device will be able to:" & vbCrLf & vbCrLf & _
                    vbTab & "DIAL" & vbCrLf & vbCrLf & _
                    "If you think you have a voice modem, expected more " & _
                    "functionality, or other programs provide more " & _
                    "functionality  with this modem, see the " & _
                    "topic 'Working with Modems' in the Appendix of the " & _
                    "TeleTools help file.")
        Else
            If etLine1.ErrorNumber = INVALID_SERIAL_NUMBER Then
                MsgBox ("Error opening line device: " & etLine1.ErrorText & _ 
                        vbCrLf & vbCrLf "See the help topic:" & vbCrLf & _
                        vbCrLf & vbTab & "Why Serial Numbers Are Important")
            Else
                MsgBox ("Error opening line device: " & etLine1.ErrorText)
            End If
        End If
    End If
End Sub

Private Sub etLine1_OnCallerID(ByVal CallHandle As Long)
'When this event is called copy the etLine.CallCallerIDName and
'etLine.CallCallerIDNumber properties to the edit controls for display.
    If (etLine1.CallCallerIDFlags And LINECALLPARTYID_NAME) <> 0 Then
        TextCallerIDName.Text = etLine1.CallCallerIDName
    End If
    If (etLine1.CallCallerIDFlags And LINECALLPARTYID_ADDRESS) <> 0 Then
        TextCallerIDNumber.Text = etLine1.CallCallerIDNumber
    End If

    'Check a few of the etLine.CallerIDFlags
    If etLine1.CallCallerIDBlocked Then
        Caption = "Blocked"
    End If
    If etLine1.CallCallerIDOutOfArea Then
        Caption = "Out of area"
    End If
End Sub


Private Sub etLine1_OnOffering(ByVal CallHandle As Long)
'Some telephony devices provide the CallerID information when the call is created.
    etLine1_OnCallerID (CallHandle)
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
    ComboDevice.ListIndex = 0
End Sub


Private Sub Form_Unload(Cancel As Integer)
    'Close the etLine control when closing the form
    etLine1.DeviceActive = False
End Sub

 

 
 


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

Contact Us