Solved

How to read information programatically from an EPABX machine connected on a serial port ?

Posted on 2006-07-04
12
953 Views
Last Modified: 2008-01-09
Hi,

My client has installed an EPABX machine and he wants me to connect my VB software with the EPABX machine to generate automatic telephone billing.

The EPABX machine can be connected to the computer on a serial port and all the telephone usage details like Dialled number, Call duration, extension from which call was made, etc. are available through the HyperTerminal software (after configuring it properly).

How can I access this information through VB programatically ?

You can ask me for more details if I am not clear enough.

Thanks a lot.
0
Comment
Question by:rajesh_khater
  • 6
  • 6
12 Comments
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 17037290
You should use the MSComm control  to communicate with the serial port.
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 17037319
You would have to know the protocol for your particular piece of equipment, but there is some MSCOMM sample code here:

http://www.developerfusion.co.uk/show/195/
0
 
LVL 1

Author Comment

by:rajesh_khater
ID: 17037354
How do I find out the protocol ?
All I have is the HyperTerminal configuration.
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 17037578
The actual protocol is almost certainly ASCII.

That is to say that the data will be embedded in the messages wrapped in the ASCII control characters. Thay are listed here:
http://www.lammertbies.nl/comm/info/ascii-characters.html

I would expect the manufacturer to provide the specification for data format within the messages, though if you can see and understand it in hyperterminal, you could probably hack it.

This thread talks a bit about using MSComm with EPABX system
http://www.vbwm.com/forums/post.asp?method=Reply&TOPIC_ID=4242&FORUM_ID=8
0
 
LVL 1

Author Comment

by:rajesh_khater
ID: 17049995
How can I find out the raw stream of bytes that the Hyperterminal is sending to the EPABX machine and the raw stream (including the control characters) that it is getting back from the EPABX machine ?

That will help me in decoding the format, by comparing it with the actual data.

0
 
LVL 1

Author Comment

by:rajesh_khater
ID: 17056927
OK. I got t his information that the EPABX sends data in ASCII Packet format.

How can I find out more about this ASCII Packet format ?

While configuring the HyperTerminal, we have to set Bits per second to 4800, Data Bits = 8 and Parity = None and Stop Bits = 1 and Flow Control = None.

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Author Comment

by:rajesh_khater
ID: 17056937
And when I connect the HyperTerminal to the EPABX, then as soon as a call is made using the EPABX, the Hyperterminal displays a line showing the call details after the call is over.
0
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 250 total points
ID: 17057146
You will need to collect the data and parse it.

This Microsoft article has the code for two applications, one for sending and one for receiving. If you need to send commands to the device to get it to transmit data back to you, you will have to combine the two with a send and receive part.


http://support.microsoft.com/default.aspx?scid=KB;en-us;q194922

I have modified the setup portion of the Send application just to illustrate how to use the settings that you say that you have to use with Hyperterminal.

    Sub Form_Load()
         Form1.Caption = "App1"
         With MSCOMM1
            .Handshaking = comNone ' <--- was comRTS
            .RThreshold = 1
            .RTSEnable = True
            .Settings = "4800,n,8,1"   ' <---  was "9600,n,8,1"
            .SThreshold = 1
            .PortOpen = True
            ' Leave all other settings as default values.
         End With
         Command1.Caption = "&Send"
         Text1.Text = "Test string from App1 "
      End Sub


Knowing the Ascii control characters, like  <SOH> (01 hex or &h01 in VB hex notation) and <STX> (02), etc, from this link that I gave you before:

http://www.lammertbies.nl/comm/info/ascii-characters.html ,

you should be able to interpret the text portion of the message with the PABX documentation and what you can see in Hyperterminal.
 
 
0
 
LVL 1

Author Comment

by:rajesh_khater
ID: 17070486
The Hyperterminal does not need to send any command to the EPABX machine.

It just needs to connect with the settings I described above, and then the EPABX starts sending the data.

Is "ASCII Packet Format" not a standard format ?
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 17072374
That makes your task a bit simpler.

I don't recognise the actual term "ASCII Packet Format", but I would expect that it is sending simple ASCII messages. Although, as far as I know, the data could be raw. If so, then you won't have to strip out the ASCII control characters
0
 
LVL 1

Author Comment

by:rajesh_khater
ID: 17079032
OK. How do I find out whether it is sending control characters also in the message ?
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 17079274
Just examine the data that your program receives. If it is all printable text then you don't have to worry about it. Broadly, any byte with a value less than 32 (space) is a control character. If there aren't any, then it is probably just raw data. If there are, you can probably just discard them, but you might find them useful when parsing the data.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Window placement 17 75
DIR issue 7 51
Updates not working for MS Windows 7 12 152
using web browser with BING 40 110
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now