Sure.
I will get my guys to give the the code extract and I'll post soonest.
Main Topics
Browse All TopicsHi Guys,
My developer has written an C# app/service that needs to connect via TCP/IP to an IP and port on a PBX to collect CDR (call data record) data and pipe it to a sql2005 table.
We collected sample raw CDR (see attached) from the PBX (Samsung 7200) using Putty and replay it (to simulate) through SocketWorkbench, then the app works fine and does not fail.
When trying the app onsite connecting directly to the actual IP and port of the PBX, the app fails when a heading/empty-row of data is received and stops receiving/processing any new data that the PBX makes available. THIS IS OUR PROBLEM AND CANNOT SEEM TO SEE WHY. HELP!!!!
On another site using the same app. We connected to another PBX (Mitel 3300) also to a IP and port where the raw CDR data (see attached) does not have any headings/empty-rows, the app runs fine and does what it is suppose to without fail.
Please help!
Thanks again in advance.
Hannes.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Here is my guys code:
TcpClient client = new TcpClient(ServerIP, ServerPort);
if (client.Connected)
{
//Get the SMDR
NetworkStream network = client.GetStream();
StreamReader SMDRReader = new StreamReader(network);
string SMDR = "";//SMDRReader.ReadLine()
//SMDR = SMDRReader.ReadLine();
//ProcessSMDR(SMDR);
while ((SMDR = SMDRReader.ReadLine()) != null)
{
//Check if there is data to save
if (SMDR.Trim() != String.Empty)
ProcessSMDR(SMDR);
SMDR = "";
}
}
I do not see a problem with that code. I do see that the files have different formats. Particularly, there seems to be an inconsistency with the line terminators. The 3300 file ends the lines with CR-BACKSLASH-LF, while the 7200 file ends the lines with BACKSLASH-LF-BACKSLASH-LF.
Could it be a transport problem, where the line terminators are being mangled?
-dZ.
Hi Guys,
Seems that our problem has elevated itself into another dimension or something similar.
Okay, let me try explain ... we have managed to establish that we do NOT have a connection or connection-state problem from the service to the PBX IP+port, as we added extra code that we can see that when CDR is given off by the PBX by being recognized by the service and a entry created in the sql table.
What we still have issue with, is when the service/app is started the very first string of CDR is captured correctly, but all the CDR strings after that is being recognized (row created in the table), but the data/message field is just empty.
We also noticed that we get an error returned when trying to INSERT data into the MESSAGE field saying that our strings longer than 4000 characters (which is the limit for this field).
Another suspect issue is that the 'empty strings' are actually not empty, but when doing a character count on the empty strings, that can vary between 80 to 100s of characters in length which is just empty spaces ... it seems.
My take on this at the moment is that we are getting an END OF LINE identifier or CARRIAGE RETURN, but out code cannot interpret the character or command issued.
Your help & comments please?
Thank you.
Hannes,
One more thing I'd like to add is that you should make sure that the format of the files, as you are storing them, is correct; that no transport level translations are occuring to newline delimiters and such.
As for parsing the lines, I concur with SunnyDark. The StreamReader.ReadLine() method expects either a line-feed (\n) or a carriage-return + line-feed (\r\n) delimiter, and your files have various sequences that may be affecting the reader.
-dZ.
Hi Guys,
I want to do a simple test to see if I have the same issue, for when my service is receiving the data instead of requesting the data.
I am searching the web for a utility to test with that will allow me to connect to an IP+port and forward onto an IP+port (my service). I managed to find a lot of port forwarders, but only listeners, not the one I need.
I'd appreciate if you ca recommend something.
Thank you.
Hannes.
Are you looking for a network sniffer to look at the TCP transaction while it's happening? If so, then I recommend WireShark. It can analyse TCP communications by protocol and let you view what is going on.
http://www.wireshark.org/
dZ.
Hi dZ,
NO, I am not trying to sniff the data, but I need to be able to connect to an IP+port (similar to a telnet connection) AND also be able to forward the data that is received/collect to another IP+port.
I managed to find a lot of utils to listen on a local port and forward to an IP+port, but I need to connect to an IP+port first to get my data and not just listen on a port.
I hope this explains this?!?!?!
Thanks.
Hannes.
If I understand correctly, what you want to do is open a connection to a remote IP, retrieve data, then open another connection to a separate host and transmit the data from one to the other. Off hand, I do not know of any tool that does this. You could build your own, I suppose.
What are you trying to accomplish with this, and how does it relate to your problem?
-dZ.
Business Accounts
Answer for Membership
by: SunnyDarkPosted on 2008-12-10 at 23:56:09ID: 23146462
This might be not a problem with the TCP comunication but a problem in the code that is processing the data.
Without you , posting the code it is hard to tell.
In order for us to be able to help you we need to see the part in the code that is processing the data.