Reports: Pre-filling form with URL variables, possible?


I have several specific report requirements, basically various Report searches I’d like for us to be able to access with a single click to an URL.

For example, I would like to quickly see all inbound calls on our company, which would be the ring groups in the 600s. To do a normal report, you’d simply type 6 under destination, and select Starts With. Then you get a perfect report. There are other reports that are just as interesting.

But how do I make a CDR link that I can put in every person’s browser that takes them directly to this screen? I can see that in this case, the POST variable ‘dst’ is set to 6, and ‘dsttype’ is set to 2. But since they’re POST variables, it doesn’t work to make a link that says – because the reports.php doesn’t appear to parse GET variables in the absence of POST variables.

Is there a way to go directly to a specific report, or a specific search, essentially pre-filling the search form with URL variables? It’s all the clicking we’re trying to avoid, because if you have to fill out a (darn) questionnaire every time you want to see recent calls, people just don’t use it because it’s too much work. It has to be a single click.

I would love any input.



At least now I figured out how to make some default settings for the reports. I programmed the following in to var/www/html/admin/cdr/cdr.php (at the top after session_start():wink:

if (!isset($_POST[‘dst’])) {$_POST[‘dst’]=6;}
if (!isset($_POST[‘dsttype’])) {$_POST[‘dsttype’]=2;}

That resets the valuables of ‘dst’ and ‘dsttype’ if they have no other value.

I don’t know if this FreePBX Reports screen is on its way out, but if it’s here to stay, it ought to at a bare minimum allow you to pre-fill the form, or to save search presets that can recalled with a drop-down menu (and with an URL variable like ?savedreport=5).

The above is OK for me for now, because at least we have live access to the most common report, of seeing all calls that have rung on ring groups 600-699. That’s where all our inbound calls end up.