Loading

Capture Data From PBX

Submitted by: 


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

  1. Option Explicit
  2.  
  3. ' Select the right COM port in the Properties of the control!
  4.  
  5. Private Sub Form_Load()
  6. MSComm1.Settings = "9600,n,8,1"
  7. MSComm1.InputLen = 0
  8. MSComm1.RThreshold = 1
  9. MSComm1.CommPort = 1
  10. MSComm1.PortOpen = True
  11. End Sub
  12.  
  13. Private Sub MSComm1_OnComm()
  14. Dim strinput As String
  15. strinput = MSComm1.Input
  16. List1.AddItem strinput
  17. End Sub
  18.  
  19.  
  20. '
  21. Private Sub Command1_Click()
  22. MSComm1.PortOpen = True
  23. MSComm1.Output = "AT" & Chr$(13)
  24. Do
  25. DoEvents
  26. Loop Until MSComm1.InBufferCount > 1
  27. Text1.Text = MSComm1.Input
  28. 'Write to a filesystem object (.txt)
  29. WriteToFile
  30.  
  31. 'Extract the capture string then save to Table fields
  32. SaveToDb
  33.  
  34. End Sub
  35.  
  36. Function WriteToFile()
  37. 'codes goes here
  38. 'codes for writing to a .txt file for logging the output data of PBX
  39. 'its column oriented ,(callid, time, date, mins, etc)
  40. 'End Function
  41.  
  42. Sub SaveToDB()
  43. 'codes goes here
  44. 'so extract those strings and save it to database
  45. use ADO, ODBC etc for this, its pretty easy
  46. End Sub

http://www.emondsoft-solutions.com/

Facebook Fan Page

http://www.facebook.com/pages/emondsoft/120502167993693

Mobile: +639399393702




Comments

Thanks Mr.emond
Very Usefull code i am Searching in Net

Thanks lot

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 (mj.cisco74@gmail.com

emond's picture

You can contact me @ +639212279363 for the details:

Fan PAge
http://www.facebook.com/pages/emondsoft/120502167993693

Website:

www.emondsoft.qapacity.com

emond sabiniano
System Developer-Software Consultant

Pages

Add new comment

Filtered HTML

  • You may insert videos with [video:URL]
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <asp>, <c>, <cpp>, <csharp>, <css>, <html4strict>, <java>, <javascript>, <mysql>, <php>, <python>, <sql>, <vb>, <vbnet>. The supported tag styles are: <foo>, [foo].
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.