We needed to custom edit the call detail records for PJSIP. Since a recent upgrade, the call history has not been working right (in both the plugin button and the popup). Sometimes it correctly shows call history, other times, it seems to show only calls that happened before the upgrade happened (14 days ago in this case). I can't get to the bottom of it. I recreated the query from plugings/callhistory/callhistorybsgrid.php for this particular extension, and all of the recent calls pull up fine from the query. But currently, the plugin button is not showing the same data.
SELECT calldate,concat(IF(dst='".6603."' OR dstchannel LIKE 'PJSIP/6603-________' ,src,dst),'!',clid) as number,duration,disposition,uniqueid FROM cdr WHERE (src='6603' OR channel LIKE 'PJSIP/6603-________') order by calldate desc limit 50;