Call history plugin loses database connection
Plugin Call History loses connection to database from time to time. I installed call history plugin and it seems to work erratically. It works for a few hours and then it says: No records found. After I logout and login again, the data is there again. Is this a known bug? I use Version 2.30.02
Comments
if($allowed <> "yes") {
echo "<div class='container-fluid text-center'><br/><h3 class='animated tada'>You do not have permissions to access this resource</h3></div>";
die();
}
Now when I commented this back in, I get "You do not have permissions to access this resource"
I also noticed, that when I had seemingly working plugin (calls where there etc) when I reloaded the frame, I ended up with no data.
My history is not updating either. I've restarted my computer, which should initiate a new PHP session anyway, but it still does not update. FOP2 2.30.04, FreePBX 13.0.70
I just checked in freepbx under Reports>phpinfo and see:
session.gc_maxlifetime: local value: 2592000 master value: 1440
Should I set the master longer, to equal the local value?
Best regards,
It shows my last Incoming call was 11 days ago, when it should be today, and it shows my last Outgoing call as 6 days ago, when it should be today. Other users on my installation are seeing similar information.
Thanks for the help!
grep cdr_mysql /var/log/asterisk/full
To check for errors... if you have problems with cdr, it is*not* related with FOP2 at all.
Best regards,
When I check CDR Reports in freepbx, I am able to see two outbound calls that I made today, but these aren't present in the FOP2 History.
(src='$extension' OR channel LIKE 'SIP/$extension-________' OR dst='$extension' OR dstchannel LIKE 'SIP/$extension-________' )
where $extension is your extension number, like '100'.
That would be something like
SELECT * FROM cdr WHERE (src='100' OR channel LIKE 'SIP/100-________' OR dst='100' OR dstchannel LIKE 'SIP/100-________' )
You can run that query directly via mysql and see if it retrieves anything. If you have CDR constructed in a different way, then you will need to customize that query/code in the calldetailrecords.php file.
Best regards,
After changing it in both places in the the $mifilt IF statement within calldetailrecords.php, I'm now seeing what might be all the calls. Is there anywhere else in the file this should be updated?
Maybe we could add a wildcard in front of the SIP to account for either voip setting?
Kevin
Hope you can help!
TECH/EXTENSION-12345678
Where 12345678 is the random session string. So the LIKE sql query is SIP/$extension-________ by default, and changing it to PJSIP/xxx should be enough. Check to see in the CDR entries if the session part is 8 chars long. They query will also use the $extension variable/number in the channel name, that should exclude any entry for a trunk that will generally have a name or an ip address instead.
Try to catch me on the live help, if you can give me access to your server I can inspect the CDR and mysql queries and see if we can come up with the correct one.
Best regards,
/var/www/html/fop2/admin/plugins/callhistory/callhistorybsgrid.php
&
/var/www/html/fop2/calldetailrecords.php
Find all instances of SIP/ and change them to PJSIP, I think there are 5 in each file. This seems to be wokring for me just fine. I believe a future FOP2 update may account for both types.
Thanks Nicolas.
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;
http://forum.fop2.com/1331-pickup-call-function-cause-dummy-entry-in-database/0
that's where I found it.
It's in /etc/asterisk/extensions_override_fop2.conf
[fop2-dummy]
exten => dummy,1,Answer
exten => dummy,n,Wait(1)
exten => dummy,n,NoCDR()
exten => dummy,n,Hangup
I also commented out #push @allreturn, $return; in FOP2Callbacks.pm in the LEAVE section. Will see if that resolves it. Sorry to make so many posts! This helps me keep track of what I tried and when haha
If you run the query you see on the calldetails php file and see any particular result, the same results you should see in the results from the .php itself. Hard to tell what is going on without looking at the actual queries performed by calldetailrecords.php and results from your cdr tables.