[SR-Users] Get duration in cnxcc:call-shutdown event

Jayesh Nambiar jayesh1017 at gmail.com
Sat Jul 20 08:07:02 CEST 2013


Hello,
Is there a straight forward way of getting the duration of the call in
cnxcc-call-shutdown event. The $DLG_lifetime returns NULL as the dialog
does not exist. I dont get the value of $DLG_lifetime even in dialog:end
event when the call ends through cnxcc module. Even the cdr flag of acc
module doesn't get the duration and it logs, invalid values !!
Currently, I am storing the timestamp in htable when the call is answered
and then subtract it from the current timestamp in the cnxcc:shutdown event
route to get the duration. Something like this:

onreply_route[MANAGE_REPLY] {
    xdbg("incoming reply\n");

    if(status=="200") {
        $sht(ts=>$ci) = $Ts;
    }
}

event_route[cnxcc:call-shutdown] {

    $var(duration) = $TS-$sht(ts=>$ci);
    sht_rm_name_re("ts=>$ci");

    xlog("L_INFO", "Duration of call was $var(duration)");
}


Any more correct way of doing this would be very helpful.

Thanks,

--- Jayesh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20130720/387ae69d/attachment.html>


More information about the sr-users mailing list