[Freeswitch-users] How to get the answered call live duration?

ankitdoshi ankit_doshi2011 at yahoo.com
Wed Jan 6 18:40:24 MSK 2016


Hello,

How can I get the answered call live duration ?

Let me give an example what i want to ask,
let's say user A dialed a call to B and B receives it after 10 seconds, they
talked for 20 seconds so now i am getting 30 seconds in cdr, i want it exact
20 seconds

Now let me explain what I did so far that I am getting this o/p
I am doing current time - created_epoch but its giving total duration of
ringing + answered duration (as per exp, 30 secs)

Let me provide you the 'show calls' info while call ringing,

uuid,direction,created,created_epoch,name,state,cid_name,cid_num,ip_addr,dest,presence_id,presence_data,callstate,callee_name,callee_num,callee_direction,call_uuid,hostname,sent_callee_name,sent_callee_num,b_uuid,b_direction,b_created,b_created_epoch,b_name,b_state,b_cid_name,b_cid_num,b_ip_addr,b_dest,b_presence_id,b_presence_data,b_callstate,b_callee_name,b_callee_num,b_callee_direction,b_sent_callee_name,b_sent_callee_num,call_created_epoch
bce09d00-6**1-4**7-baa1-803f633b57cd,inbound,2016-01-06
19:30:26,14520***26,sofia/default/48******81@*.*.*.*,CS_EXECUTE,48******81,48******81,*.*.*.*,12345678,48******81@*.*.*.*,,RINGING,,,,,server,,,,,,,,,,,,,,,,,,,,,
97e47575-5**4-4**6-91cb-b6e75fea713e,outbound,2016-01-06
19:30:26,14520***26,sofia/default/12345678,CS_CONSUME_MEDIA,48******81,48******81,*.*.*.*,12345678,,,RINGING,Outbound
Call,12345678,,bce09d00-6**1-4**7-baa1-803f633b57cd,server,,,,,,,,,,,,,,,,,,,,,

And also 'show detailed_bridged_calls' info while call is on going

uuid,direction,created,created_epoch,name,state,cid_name,cid_num,ip_addr,dest,application,application_data,dialplan,context,read_codec,read_rate,read_bit_rate,write_codec,write_rate,write_bit_rate,secure,hostname,presence_id,presence_data,callstate,callee_name,callee_num,callee_direction,call_uuid,sent_callee_name,sent_callee_num,b_uuid,b_direction,b_created,b_created_epoch,b_name,b_state,b_cid_name,b_cid_num,b_ip_addr,b_dest,b_application,b_application_data,b_dialplan,b_context,b_read_codec,b_read_rate,b_read_bit_rate,b_write_codec,b_write_rate,b_write_bit_rate,b_secure,b_hostname,b_presence_id,b_presence_data,b_callstate,b_callee_name,b_callee_num,b_callee_direction,b_call_uuid,b_sent_callee_name,b_sent_callee_num,call_created_epoch
bce09d00-6**1-4**7-baa1-803f633b57cd,inbound,2016-01-06
19:30:26,14520***26,sofia/default/48******81@*.*.*.*,CS_EXECUTE,48******81,48******81,*.*.*.*,12345678,,,XML,default,PCMA,8000,64000,PCMA,8000,64000,,servertwo,48******81@*.*.*.*,,HELD,,,,bce09d00-6**1-4**7-baa1-803f633b57cd,,,97e47575-5**4-4**6-91cb-b6e75fea713e,outbound,2016-01-06
19:30:26,14520***26,sofia/default/12345678,CS_EXCHANGE_MEDIA,48******81,48******81,*.*.*.*,12345678,playback,local_stream://moh,XML,default,PCMA,8000,64000,PCMA,8000,64000,,servertwo,,,ACTIVE,Outbound
Call,12345678,,bce09d00-6**1-4**7-baa1-803f633b57cd,,,1452088836

Here, everywhere i am getting same time '2016-01-06 19:30:26' as
created_epoch
so is there any variable like 'answered_epoch' or 'bridged_epoch' which
provide the exact time of answered call duration (as per exp, 20 secs) ? and
not provide the ringing + answered duration (as per exp, 30 secs)?

Any insights would be helpful.
Thanks.



-----
Thanks
Ankit Doshi
--
View this message in context: http://freeswitch-users.2379917.n2.nabble.com/How-to-get-the-answered-call-live-duration-tp7596197.html
Sent from the freeswitch-users mailing list archive at Nabble.com.



Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list