Solved

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

Posted on 2006-07-04
12
966 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 
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

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…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

724 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