Page 1 of 1

Automated call reports..

PostPosted: Wed Aug 05, 2020 8:58 pm
by Machten
Hi guys,

I can't wrap my head around this particular http string I was hoping someone could give me a hand...

Code: Select all
https://xxx.xxx.xxx.xxx/vicidial/call_report_export.php?DB=&run_export=1&ivr_export=&query_date=$now_date&end_date=$now_date&date_field=call_date&header_row=YES&rec_fields=NONE&custom_fields=NO&call_notes=NO&export_fields=EXTENDED&campaign%5B%5D=---ALL---&group%5B%5D=---ALL---&list_id%5B%5D=---ALL---&status%5B%5D=---ALL---&user_group%5B%5D=---ALL---&SUBMIT=SUBMIT


and the result rather then the file being generated I get this

Code: Select all
There are no inbound calls during this time period for these parameters


all I'm trying to do is generate this on a nightly basis for that day.....


any assistance is much appreciated.

Thanks!

Re: Automated call reports..

PostPosted: Wed Aug 05, 2020 10:11 pm
by Machten
I forgot to add that I've been working on this for 3 days now, and have tried to search everywhere for the answer that I'm looking for to no avail.

Re: Automated call reports..

PostPosted: Thu Aug 06, 2020 11:21 am
by c20xh2
Are you pasting this directly in a browser ? If so you might want to change the variable names for the correct dates:

ivr_export=&query_date=$now_date&end_date=$now_date&
ivr_export=&query_date=2020-08-06&end_date=2020-08-06&

Re: Automated call reports..

PostPosted: Thu Aug 06, 2020 7:18 pm
by Machten
c20xh2 wrote:Are you pasting this directly in a browser ? If so you might want to change the variable names for the correct dates:

ivr_export=&query_date=$now_date&end_date=$now_date&
ivr_export=&query_date=2020-08-06&end_date=2020-08-06&



I am,

the issue is I want it to pick up the date that the report is run so I wouldn't have to keep changing it daily the only thing I can think of to use as an example would be mysql CURDATE()

Re: Automated call reports..

PostPosted: Thu Aug 06, 2020 10:38 pm
by williamconley
--A--today--B--

?

Re: Automated call reports..

PostPosted: Fri Aug 07, 2020 8:45 am
by c20xh2
There is a lot of different ways to achieve what you are trying to do.

Personally I use a Python3 script to pull out automated report and send them by email daily.

Re: Automated call reports..

PostPosted: Fri Aug 07, 2020 12:01 pm
by Machten
williamconley wrote:--A--today--B--

?



so just an update I've got it down to this http link

Code: Select all
https://xxx.xxx.xxx.xxx/vicidial/call_report_export.php?DB=&run_export=1&ivr_export=&query_date=--A--today--B--&end_date=2022-08-06&date_field=call_date&header_row=YES&rec_fields=NONE&custom_fields=NO&call_notes=NO&export_fields=EXTENDED&campaign%5B%5D=---ALL---&group%5B%5D=---NONE---&list_id%5B%5D=---ALL---&status%5B%5D=---ALL---&user_group%5B%5D=---ALL---&SUBMIT=SUBMIT


now the interesting part is when I click on it or put it into a browser for that matter, it works fine.

however

as an automated report/custom i get

"There are no inbound calls during this time period for these parameters" ....


very puzzling

when I try to add it in as an automated report even as a custom report it comes up with the error

Re: Automated call reports..

PostPosted: Fri Aug 07, 2020 12:32 pm
by Machten
Machten wrote:
williamconley wrote:--A--today--B--

?



so just an update I've got it down to this http link

Code: Select all
https://xxx.xxx.xxx.xxx/vicidial/call_report_export.php?DB=&run_export=1&ivr_export=&query_date=--A--today--B--&end_date=2022-08-06&date_field=call_date&header_row=YES&rec_fields=NONE&custom_fields=NO&call_notes=NO&export_fields=EXTENDED&campaign%5B%5D=---ALL---&group%5B%5D=---NONE---&list_id%5B%5D=---ALL---&status%5B%5D=---ALL---&user_group%5B%5D=---ALL---&SUBMIT=SUBMIT


now the interesting part is when I click on it or put it into a browser for that matter, it works fine.

however

as an automated report/custom i get

"There are no inbound calls during this time period for these parameters" ....


very puzzling

when I try to add it in as an automated report even as a custom report it comes up with the error



well I was able to get the custom report to work now but the automated one still doesnt....

Code: Select all
https://xxx.xxx.xxx.xxx/vicidial/call_report_export.php?&DB=&run_export=1&ivr_export=&query_date=2020-08-07&end_date=2022-08-06&date_field=call_date&header_row=YES&rec_fields=NONE&custom_fields=NO&call_notes=NO&export_fields=EXTENDED&campaign[]=---ALL---&group[]=---NONE---&list_id[]=---ALL---&status[]=---ALL---&user_group[]=---ALL---&SUBMIT=SUBMIT

Re: Automated call reports..

PostPosted: Fri Aug 07, 2020 2:10 pm
by williamconley
Check the apache log and see if the request is somehow being malformed. Compare your manual request with the automated one.

Re: Automated call reports..

PostPosted: Fri Aug 07, 2020 9:03 pm
by Machten
williamconley wrote:Check the apache log and see if the request is somehow being malformed. Compare your manual request with the automated one.



Thank you for the advice,

I just ended up writing a bash script to do what I needed to do lol


I'll revisit this at some point with my findings at least to log what was going on and a fix