Solved

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

Posted on 2006-07-04
12
959 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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
 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

820 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