« Back to Technical Questions

RE: CDR duration of a call

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Hi All.
 
Please could anyone help me to calculate duration of calling from a number to another number because I am reading about this for about 1 week and still can`t calculate.
For one call I am just interested in calculating duration when a calling number calls a called number until the close of connection.
I have some CDR files wich I am trying to analyse. For wxample a TWC call is always reorded in two rows of CDR but if there is any CFNA or CFA or any other feature the call is recorded in a lot of fields
 
 
In atachement is a sample CDR file that I am trying to analyse and could you please tell me how to calculate duration of a call, Calling number, Called number etc.
Attachments:

Hi Drilon,

Please refer to the following document

http://www.cisco.com/en/US/docs/ios/voice/cdr/developer/guide/cdrcsv.html

If you have further queries you could consult Cisco TAC for this as we don't have CDR experts.in this forum.

Thanks,
Anusha

well I have read all the documentation offerd by CISCO but all I need is a little help in that file to calculate duration because I don`t know wich row of CDR to read as a start time and wich as end time of a call.There is a chancing for some microseconds.

Well anyway if you could give me any contact from your experts to help me I will appriciate it because I really need this help.
 
I can`t contact Cisco TAC because I don`t have a user with this privilege on CISCO.
 
 
Than you!

I used Java script to to this before it's been a while I don't know the index of attribute is still the same but attribute should be the same.
Use "ft" from Table 8 Attributes in Feature VSA (page 22) and "h323-disconnect-time" (page 10)

var ft_time = 113;

var h323_disconnect_time_idx = 10;

//return the duration of call
function duration(str1,str2)
{

var diff = (str2- str1)/1000;
var min = diff / 60;
var sec = diff % 60;
var call_time = Math.floor(min)+' Min and '+sec+' Sec';

return (call_time);
}



duration(data[ft_time],data[h323_disconnect_time_idx]);

Thank You for this reply Yaw-Ming Chen.Are you sure because as I could see ft(113) is feature invocation time and this is equal to h323-setup-time(7) and I have tried calling a number and after talkign for a while I generated a CDR and for this talking it the talkig time was: Dosconnect time - connectTime(I can be wrong and I`m not sure yet about this).


If you are sure about your answer then I will use : ft - h323_disconnect_time = talking time between two numbers.

I still can`t understand why there is a h323-connect-time and a h323_disconnect_time ??!


Thank you for your interes in this post.I need your help.

...in fact : h323_disconnect_time - ft = talking time between two numbers

Sorry for this mistake emoticon

...also one another problem is that for one call CDR generates two rows (one row is originate and one row i answer) and in two rows there is a different ft_time (113) ...so wich should I chose as exact time?

I have attached Java script you can take a look if you are interested. It's done long time ago might not perfect but every field of calculation was instructed by Cisco dev team.
Attachments:

...well I analyzed your fjava Script and as I can see you used   h323-disconnect-time  -  ft_time to calculate the time of talking between two numbers.
 
I am making a application with C# and SQL.I am, parsgin my csv files to a sql table and then in that table I am filtering with a store procedure and filktered data I am saving in another table in wich I save:
 
Call_ID,CallingNumber,CalledNumber,SetupTime(same as ft_time),ConnectTime.DisconnectTime...and from this table I will make something else(report or whatever).
 
All I need to know in wich row should I calculate h323-disconnect-time  -  ft_time (and are you sure that I shouldn`t use  h323-disconnect-time  - h323-connect-time ) , because as I mentioned in other replys, for onw TWC call there are two records(one answer record and one originate record, this is in CallOrigin field).
 
So...ft_time it` different (for some seconds) in answer record and in originate record.
 
Watch my CDR file atached if you have time, please.
Attachments:

Like I said, it's been a while. I might have asked the same question before, why not "h323-disconnect-time - h323-connect-time" ? But I don't remember what answer I got. All I can tell you is that I didn't make up "h323-disconnect-time - ft" this value. I'm instructed by the Cisco team who developed CDR file. You may notice that we use a lot of attributes in feature VSA that might support that "ft" is a important time stamp

By the way I remembered to CDR "answer" means "incoming" "originate" means "outgoing"

Calling party -------------------> GW ----------------------? Called party
answer originate

Thank You and forgive me for all these questions but I really am stacked and I don`k know what to do anymore.
OK you are sure that "h323-disconnect-time - ft" is talking time ? my problem now is wich row to get this"h323-disconnect-time - ft" value (answer or originate).If you have answer please help me and if not than THANK YOU VERY MUCH.I Approciate your help.

I do understand your frustration. I know it's hard to interpret CDR file. For a TWC I think there are 4 lines. You may see the same value of attribute in multiple lines. The logic should be in the file I attached but I don't quite remember. I do remember sometime we need to follow "fcid" to navigate around all lines. Sorry that couldn't help you further.

No for a TWC there are two lines...and yes these lines have the same fcid.This is for a TWC (not CXFER, BXFER,CFNA,CFBY etc).But there is only one problem: as I mentioned ...one leg is "answer" and one another "originate" ...so I don`t know wich leg (row) to get for calculating"h323-disconnect-time - ft".

Anyway Thank You Indeed,

I think we should have same value in both line if not, I will get ft from answer (incoming leg) as it happens earlier and disconnect-time from originate (outgoing leg)

Ok thank you.That was exactly what I needed...because disconnect time is same in both but the ft time it`s different for some seconds.So answer leg is leg I need.

Thank you again

Hello,
Drilon Jahiri.

I'm developing a tool to analyze CDR compact log.

Maybe could you help me to understand how calculate call duration, etc?

Please let me know.