Custom Code

Any and all non-support discussions

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

Custom Code

Postby jatomusic » Fri Feb 02, 2018 1:58 pm

Where should I post solutions and code snippets I use for our instances?

We have sometimes spikes in call volume. So to handle the drops from customers hanging up. We are setting up some list that represent time buckets. So let's say, morning shift, mid-day shift, evening shift. All the calls that drop will schedule in to a list.

I am making it an extension of the API.

DB Query
dump all calls from a range of ingroups that are status drops, only one instance of each phone number to a list 1001
Code: Select all
INSERT INTO vicidial_list (entry_date,modify_date, status, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, date_of_birth, called_count, last_local_call_time, rank, entry_list_id, comments)
SELECT call_date as entry_date, '0000-00-00 00:00:00' as modify_date,'NEW' as status,
'1002' as list_id, vl.gmt_offset_now as gmt_offset_now, 'N' as called_since_last_reset,
'1' as phone_code, vcl.phone_number as phone_number, '0000-00-00' as date_of_birth,
'0' as called_count, CONCAT(CURDATE(),' ','00:00:00') as last_local_call_time, '0' as rank, '1002' as entry_list_id, CONCAT('CALLED: ',COUNT(vcl.phone_number),' Times') as comments
FROM vicidial_closer_log vcl
LEFT JOIN vicidial_list vl ON vcl.lead_id = vl.lead_id
LEFT JOIN vicidial_list vlcheck ON vcl.phone_number = vlcheck.phone_number AND vlcheck.list_id = '1002'
WHERE vcl.call_date
BETWEEN CONCAT(CURDATE(),' ','09:00:00') AND CONCAT(CURDATE(),' ','11:59:59')
AND vcl.status = 'DROP'
AND campaign_id LIKE '90%'
AND campaign_id != '9008'
AND vlcheck.phone_number is NULL
GROUP BY vcl.phone_number
ORDER BY entry_date ASC
Vicibox 8.0.1 from .iso | Vicidial 2.14-647a Build 171229-2309 | Asterisk 11.25.3-vici | Cluster | No Digium/Sangoma | No Extra Software |
Dedicated Servers | ~50 Agents | DB 500+ Agents, Web+ 2voice standard | backup to AWS S3
jatomusic
 
Posts: 18
Joined: Fri Mar 06, 2015 5:58 pm

Re: Custom Code

Postby mflorell » Fri Feb 02, 2018 6:52 pm

We usually recommend posting snippits of code like this in the Issue Tracker(liked above)

This does look pretty similar to Drop Lists though, have you looked at that feature?
mflorell
Site Admin
 
Posts: 18335
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: Custom Code

Postby jatomusic » Mon Feb 05, 2018 9:09 am

You know I thought there was something like that and I just couldn't find it. I'll check the manual and post back.
Vicibox 8.0.1 from .iso | Vicidial 2.14-647a Build 171229-2309 | Asterisk 11.25.3-vici | Cluster | No Digium/Sangoma | No Extra Software |
Dedicated Servers | ~50 Agents | DB 500+ Agents, Web+ 2voice standard | backup to AWS S3
jatomusic
 
Posts: 18
Joined: Fri Mar 06, 2015 5:58 pm

Re: Custom Code

Postby jatomusic » Mon Feb 05, 2018 9:29 am

I have to laugh, I found another post describing all the features. I'm pretty sure it covers what I needed. I was making my code to work with the API. I have a basic working function. I'll submit it to the issue tracker. Might be useful if anyone wants the functionality via api.

T0 anyone searching, go to Admin>System Settings> Enable Drop Lists = 1
Vicibox 8.0.1 from .iso | Vicidial 2.14-647a Build 171229-2309 | Asterisk 11.25.3-vici | Cluster | No Digium/Sangoma | No Extra Software |
Dedicated Servers | ~50 Agents | DB 500+ Agents, Web+ 2voice standard | backup to AWS S3
jatomusic
 
Posts: 18
Joined: Fri Mar 06, 2015 5:58 pm

Re: Custom Code

Postby mflorell » Mon Feb 05, 2018 9:36 am

Thanks for the followup post :)
mflorell
Site Admin
 
Posts: 18335
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 62 guests