📄 identifier.frm
字号:
Left = 690
TabIndex = 4
Text = "Status"
Top = 2955
Width = 1575
End
Begin VB.TextBox Status
Enabled = 0 'False
Height = 285
Index = 2
Left = 690
TabIndex = 3
Text = "Status"
Top = 795
Width = 1575
End
Begin VB.TextBox Status
Enabled = 0 'False
Height = 285
Index = 1
Left = 690
TabIndex = 2
Text = "Status"
Top = 435
Width = 1575
End
Begin VB.CommandButton ClearEvents
Caption = "Clear Events"
Height = 255
Left = 7785
TabIndex = 1
Top = 90
Width = 1095
End
Begin VB.ListBox IdentifierEvents
Height = 4935
Left = 5760
TabIndex = 0
Top = 360
Width = 3135
End
Begin MSCommLib.MSComm Comm1
Left = 5040
Top = 3360
_ExtentX = 847
_ExtentY = 847
_Version = 393216
DTREnable = -1 'True
Handshaking = 2
InputLen = 1
RThreshold = 1
BaudRate = 4800
End
Begin VB.Label Label13
Caption = "Initialization Parameters"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 46
Top = 3480
Width = 2655
End
Begin VB.Label Label12
Caption = "Identifier Events Received:"
Height = 255
Left = 5760
TabIndex = 37
Top = 105
Width = 1965
End
Begin VB.Label Label11
Caption = "Line 8"
Height = 255
Left = 90
TabIndex = 36
Top = 2955
Width = 495
End
Begin VB.Label Label10
Caption = "Line 7"
Height = 255
Left = 90
TabIndex = 35
Top = 2595
Width = 495
End
Begin VB.Label Label9
Caption = "Line 6"
Height = 255
Left = 90
TabIndex = 34
Top = 2235
Width = 495
End
Begin VB.Label Label8
Caption = "Line 5"
Height = 255
Left = 90
TabIndex = 33
Top = 1875
Width = 495
End
Begin VB.Label Label7
Caption = "Line 4"
Height = 255
Left = 90
TabIndex = 32
Top = 1515
Width = 495
End
Begin VB.Label Label6
Caption = "Line 3"
Height = 255
Left = 90
TabIndex = 31
Top = 1155
Width = 495
End
Begin VB.Label Label5
Caption = "Line 2"
Height = 255
Left = 90
TabIndex = 30
Top = 795
Width = 495
End
Begin VB.Label Label4
Caption = "Line 1"
Height = 255
Left = 90
TabIndex = 29
Top = 435
Width = 495
End
Begin VB.Label Label3
Caption = "Caller ID Name"
Height = 375
Left = 4050
TabIndex = 28
Top = 75
Width = 1575
End
Begin VB.Label Label2
Caption = "Phone Number"
Height = 255
Left = 2370
TabIndex = 27
Top = 75
Width = 1575
End
Begin VB.Label Label1
Caption = "Current Status"
Height = 255
Left = 690
TabIndex = 26
Top = 75
Width = 1455
End
Begin VB.Menu Properties
Caption = "&Port Settings..."
End
Begin VB.Menu Connect
Caption = "&Connect"
End
Begin VB.Menu Exit
Caption = "&Exit"
End
End
Attribute VB_Name = "frmLineInfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'----------------------------------------------------------------------------------------------
'Sample Visual Basic 6.0 program to initialize and decode Identifier multi-line CID hardware
'----------------------------------------------------------------------------------------------
Private Enum IDENT_LINESTATUS
ON_HOOK = 0
RING_START = 1
RING_END = 2
OFF_HOOK_INCOMING = 3
OFF_HOOK_ORIGINATE = 4
End Enum
Private Enum IDENT_EVENTS
VALID_CALLER_ID = 1
LINE_STATUS = 2
WATCHDOG = 3
INVALID_CALLER_ID = 4
DTMF = 5
SIGNAL_ERROR = 8
End Enum
Private Enum IDENT_FEATURES
WATCHDOG = 64
DTMFDIGITS = 16
HOOKSTATUS = 8
RINGSTOP = 4
RINGSTART = 2
CALLERID = 1
End Enum
'Private Variables
Private fo As FileSystemObject
Private db As Database
Private wrk As Workspace
Private rs As Recordset
Private m_stDataPath As String
Public bEcho As Boolean 'public echo flag for com
'Private Constants
Private Const chEventStart = "+"
Private Const DefDataPath = "C:\"
'----------------------------------------------------------------------------------------------
'Each event is presented in fixed field format.
'Sample Identifier output in event mode:
'----------------------------------------------------------------------------------------------
'+2,4,002 OFF HOOK OUTGOING LINE 2
'+5,3,002 DTMF DIGIT 3 PRESSED LINE 2
'+5,4,002 " 4 "
'+5,4,002 " 4 "
'+5,7,002 " 7 "
'+5,6,002 " 6 "
'+5,6,002 " 6 "
'+5,5,002 " 5 "
'+2,1,001 RING START LINE 1
'+2,2,001 RING STOP LINE 1
'+1,9543440584,Y E S SOFTWARE ,001 CALLER ID INFO INCOMING LINE 1
'+2,1,001 RING START LINE 1
'+2,2,001 RING STOP LINE 1
'+2,3,001 OFF HOOK INCOMING LINE 1
'+2,0,002 ON HOOK LINE 2 IDLE
'+2,0,003 ON HOOK LINE 1 IDLE
'+2,4,002 OFF HOOK OUTGOING LINE 2
'+5,3,002 DTMF DIGIT 3 PRESSED LINE 2
'+5,4,002 " 4 "
'+5,4,002 " 4 "
'+5,7,002 " 7 "
'+5,6,002 " 6 "
'+5,6,002 " 6 "
'+5,5,002 " 5 "
'+2,1,003 RING START LINE 3
'+2,5,003 RING STOP LINE 3 WITH 2 BURST DISTINCTIVE RING
'+2,1,003 RING START LINE 3
'+8,2,003 CALLER ID SIGNAL ERROR 2 ( NO SIGNAL )
'+2,5,003 RING STOP LINE 3 WITH 2 BURST DISTINCTIVE RING
'+2,0,002 ON HOOK LINE 2 IDLE
'+2,0,003 ON HOOK LINE 3 IDLE
'----------------------------------------------------------------------------------------------
Private Sub ProcessEvent(stEvent As String)
Dim stArray() As String
Dim iLineNum As Integer 'Line number for Idnetifier events
IdentifierEvents.AddItem stEvent 'Add Identifier event to event listbox
stArray() = Split(stEvent, ",", -1, vbTextCompare) 'parse the event string into a one dimensional array
iLineNum = CInt(stArray(UBound(stArray))) 'line number is always last field
With frmLineInfo
Select Case CInt(stArray(0)) 'event type is always first in the array
Case IDENT_EVENTS.VALID_CALLER_ID 'Caller ID Event
.Number(iLineNum).Text = stArray(1)
.CallName(iLineNum).Text = stArray(2)
AddRecord iLineNum
Case IDENT_EVENTS.LINE_STATUS 'Line status event
Select Case CInt(stArray(1)) 'Get type of line status event
Case IDENT_LINESTATUS.ON_HOOK 'On hook/Idle event
.Number(iLineNum).Text = ""
.CallName(iLineNum).Text = ""
.Status(iLineNum).Text = "Idle"
Case IDENT_LINESTATUS.RING_START 'Ring start Event
.Status(iLineNum).Text = "Ring"
Case IDENT_LINESTATUS.RING_END 'Ring stop event
.Status(iLineNum).Text = "Ring Stop"
Case IDENT_LINESTATUS.OFF_HOOK_INCOMING 'Off Hook incoming call
.Status(iLineNum).Text = "Answered"
Case IDENT_LINESTATUS.OFF_HOOK_ORIGINATE 'Off Hook originating call
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -