+"%0D%0AOther Leg Call ID: "+(cdr.other_leg_call_id||"")
+"%0D%0AOther Leg Call ID: "+(cdr.other_leg_call_id||"")
+"%0D%0AHandling Server: "+(cdr.media_server||"")
+"%0D%0AHandling Server: "+(cdr.media_server||"")
};
};
if(cdr.hasOwnProperty('channel_created_time')){
call.channelCreatedTime=cdr.channel_created_time;
}
returncall;
};
};
_.each(cdrs,function(v){
_.each(cdrs,function(v){
result.push(formatCdr(v));
result.push(formatCdr(v));
});
});
// In this automagic function... if field doesn't have channelCreateTime, it's because it's a "Main Leg" (legs listed on the first listing, not details)
// if it's a "main leg" we sort by descending timestamp.
// if it's a "detail leg", then it has a channelCreatedTime attribute set, and we sort on this as it's more precise. We sort it ascendingly so the details of the calls go from top to bottom in the UI