Solved

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

Posted on 2006-07-04
12
949 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

706 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

16 Experts available now in Live!

Get 1:1 Help Now