[Freeswitch-users] How to get hangup_time, billsec variables inside script

Neo Cheema neo.cheema at gmail.com
Fri Jul 6 13:15:42 MSD 2012


Hi All,

I'm using Lua script to handle calls. For logging purposes, I would
want to get hangup_time, billsec info in the script. However, the code
doesn't work as expected.

local new_session = freeswitch.Session(call_to_create_new_session, session)
if new_session:ready() then
       new_session:streamFile("/home/ubuntu/sounds/ward5_1.wav")
       new_session:hangup();
       local created_time = new_session:getVariable('created_time')
//Correct value received
       local answered_time = new_session:getVariable('answered_time')
// Correct value receive
       local hangup_time = new_session:getVariable('hangup_time') //
NULL received. Problem!!

Is there anyway to get this info from Inside the script? I understand
that I can get this info from xml_cdr etc, but is it possible to get
these values inside the script itself?

Regards



Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list