Capture Data From PBX
Submitted by emond on Sunday, January 24, 2010 - 10:16.
Im Back again ,with another Hardware interfacing project . Good For Engineering Students and for inhouse company programmers. This sample Tutorial how to capture data from a PBX (Panasonic KXTDA100)
sorry i can't provide you all the code because we are selling the system in the market
but I will give the coders some idea on how to start interfacing the Hardware to a VB system or existing Data Logging, Billing System.
'====================================================
VB part
add MSCOMM control, a Textbox, and a List box
and paste the code
- Option Explicit
- ' Select the right COM port in the Properties of the control!
- Private Sub Form_Load()
- MSComm1.Settings = "9600,n,8,1"
- MSComm1.InputLen = 0
- MSComm1.RThreshold = 1
- MSComm1.CommPort = 1
- MSComm1.PortOpen = True
- End Sub
- Private Sub MSComm1_OnComm()
- Dim strinput As String
- strinput = MSComm1.Input
- List1.AddItem strinput
- End Sub
- '
- Private Sub Command1_Click()
- MSComm1.PortOpen = True
- MSComm1.Output = "AT" & Chr$(13)
- Do
- DoEvents
- Loop Until MSComm1.InBufferCount > 1
- Text1.Text = MSComm1.Input
- 'Write to a filesystem object (.txt)
- WriteToFile
- 'Extract the capture string then save to Table fields
- SaveToDb
- End Sub
- Function WriteToFile()
- 'codes goes here
- 'codes for writing to a .txt file for logging the output data of PBX
- 'its column oriented ,(callid, time, date, mins, etc)
- 'End Function
- Sub SaveToDB()
- 'codes goes here
- 'so extract those strings and save it to database
- use ADO, ODBC etc for this, its pretty easy
- End Sub
http://www.emondsoft-solutions.com/
Facebook Fan Page
Mobile: +639399393702Comments
Many thanks
Dear Mr. Emond,
It's very useful code but if possible please also provide how to parsing the string and save to database.
I'm newbe in VB and planning to build simple database for SMDR.
Again thanks,
Mj ([email protected]
You can contact me @
You can contact me @ +639212279363 for the details:
Fan PAge
http://www.facebook.com/pages/emondsoft/120502167993693
Website:
www.emondsoft.qapacity.com
Add new comment
- Add new comment
- 131 views