rlarranaga / bafprp

Automatically exported from code.google.com/p/bafprp
0 stars 0 forks source link

Adding record type 5000 #45

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?
I want to decode the CDRs with struture code 5000,If i am adding some new feild 
like account id,provider id code its giving error like 2015-05-08 14:10:29 
ERROR: Record has outgrown its stated length of 7. It is now 11,- 2015-05-08 
14:10:30 FATAL: Unexpected end of file at 24743310.  Record is 65535 bytes 
long, but only 414 bytes are left
- 2015-05-08 14:10:30 ERROR: Error processing mcas12.20150420000006.ama.0030

I also want to know where i can find datatypes for fields like account id etc

Attache are record file and log file

What version of the product are you using? On what operating system?
I am working on linux centos 5.10
bafprp version is 1.3.1

Please provide any additional information below.

Original issue reported on code.google.com by ankitaga...@gmail.com on 8 May 2015 at 8:56

Attachments:

GoogleCodeExporter commented 9 years ago
It looks like bafprp is having trouble parsing your files.  

Did you make any modifications to the program? If so does the program work 
without modifications?

And are you sure your input file is in baf format?

Original comment by charless...@gmail.com on 8 May 2015 at 9:33

GoogleCodeExporter commented 9 years ago
Thanku you so much for replying.I need to submit my work in 2 days only.
Ya I made some modifications.I added strructure code 5000 in bafrecord.cpp
and added feilds in ifeilds.cpp.
common feilds like structure code,call typ ,senson type,senson id and two
more feilds of record id it is parsing correctly.
The fields i added like account id provider id code and few more its not
decoding properly.

input i have in .ama file..

Original comment by ankitaga...@gmail.com on 9 May 2015 at 6:30

GoogleCodeExporter commented 9 years ago
You need to add new records in record_defs.cpp, new fields in field_defs.cpp

Your new fields might be causing the issues, if you supply an incorrect field 
length then the parser will get thrown off.

For example this line
makeField( "servicefeaturecode", "number", "3", "Service Feature Code" );

defines the field as type "number" with a length of 3.  
You'll have to consult with your docs to find the right length of these new 
fields.  And make sure you subtract 1 if the length is even.  Most docs I've 
seen include the trailing C as part of the length of a field.

Original comment by charless...@gmail.com on 9 May 2015 at 7:10

GoogleCodeExporter commented 9 years ago
Thank you so much for reply..i will try with subtracting length 1.one more
thing i want to know that while parsing file i incresed its offset with 14
, as 14 bytes is header..is it correct?

Original comment by ankitaga...@gmail.com on 10 May 2015 at 4:30

GoogleCodeExporter commented 9 years ago
Hi,
I have to subtract even length by 1 for every field value,or the only fieds
containing c at their end?

Original comment by ankitaga...@gmail.com on 11 May 2015 at 4:53

GoogleCodeExporter commented 9 years ago
In general the length of fields is always odd, as there is always a trailing C

As for the header, the baf header is pretty standard - depending on the file 
type.  You shouldn't have to adjust it

Original comment by charless...@gmail.com on 11 May 2015 at 4:56

GoogleCodeExporter commented 9 years ago
I m not clear about length of field .Can u help me in following fields
length?
Account ID                      : fff9 1929 2929 292d
Provider ID Code                : ffff fff1 004d
Class of Service Code           : 80 218c
Generation Timestamp            : f142 9703 308d    --Wed Apr 22 11:48:28
2015

Event Label                     : f13d
Event Result                    : ff1d
SCP    Number                      : ffff ffff ffff ffff
Location Info                   : ffff ffff ffff ffff
IMSI Overflow                   : ffff ffff ffff ffff
IMSI                            : f4 0412 345d
Pre    Event Primary Balance       : fffffff

Original comment by ankitaga...@gmail.com on 11 May 2015 at 5:04

GoogleCodeExporter commented 9 years ago
1. 15
2. 11
3. 5

etc

A field that is all FF means the data does not exist / not used.  

Some of these fields seem to be terminated by a D which is odd but shouldn't 
affect anything.  

Original comment by charless...@gmail.com on 11 May 2015 at 5:12

GoogleCodeExporter commented 9 years ago
thank you so much for your immediate reply.I will try with this

Original comment by ankitaga...@gmail.com on 11 May 2015 at 5:15

GoogleCodeExporter commented 9 years ago
Hi

Decrementing feild length by 1 works.It is now incrementing correct
length.But I ts not printing that
in my_records.log file.only few fields i am able to see in- my record
file.and it is still showing
- 2015-05-11 11:30:05 WARN: Record did not have 0xAA prefix, or we failed
to find it

- 2015-05-11 11:30:05 ERROR: Could not find record of type '8006'

2015-05-11 11:30:05 FATAL: Unexpected end of file at 26638705.  Record is
65535 bytes long, but only 29030 bytes are left

Can you please help me on this

Original comment by ankitaga...@gmail.com on 11 May 2015 at 6:34

GoogleCodeExporter commented 9 years ago
Looks like you'll also have to define record type 8006.
When bafprp encounters an unknown record it tries to skip over it but usually 
doesn't get the length right and causes the scanning to malfunction.  
That would cause the 0xAA prefix error and the unexpected end of file

Original comment by charless...@gmail.com on 12 May 2015 at 6:56