Change Historic Disposition Statuses

All installation and configuration problems and questions

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

Change Historic Disposition Statuses

Postby Rudolfmdlt » Thu Nov 14, 2013 10:23 am

Hi All,

I need to change the dispositions on a campaign (easy) and then I need to update all historic occurrences of that status for reporting purposes.
1) Is this a good idea!? :lol:
2) Which tables do I need to update. So far I have found
i) vicidial_list
ii) vicidial_log

There are other logs and tables, but those are the two that I have found that contain current and historic disposition data.

Thanks for any help,

Rudolf
Rudolfmdlt
 
Posts: 92
Joined: Thu Jul 25, 2013 2:07 am

Re: Change Historic Disposition Statuses

Postby DomeDan » Fri Nov 15, 2013 5:04 am

1: No its not a good idea :P but its possible

2: I wrote a command to check what tables that contains a status field:
domedan@Host:/usr/local/src/vicidial/trunk$ cat extras/MySQL_AST_CREATE_tables.sql | tr -d '\n' | sed 's/;/;\n/g' |grep 'CREATE'| grep 'status VARCHAR' | cut -d' ' -f 3
phones
park_log
vicidial_list
vicidial_live_agents
vicidial_log
vicidial_closer_log
vicidial_campaigns
vicidial_statuses
vicidial_campaign_statuses
vicidial_campaign_hotkeys
vicidial_agent_log
vicidial_callbacks
vicidial_lead_recycle
vicidial_timeclock_status
vicidial_carrier_log
vicidial_list_update_log
twoday_vicidial_log
twoday_vicidial_closer_log
twoday_vicidial_agent_log
vicidial_agent_skip_log
vicidial_log_noanswer
vicidial_qc_agent_log
vicidial_email_list
vicidial_nanpa_filter_log

But not all of those is what you need to update,
so you can change the command a little and get a list of querys you can run to find out if the status you are looking for is in the tables:
domedan@Host:/usr/local/src/vicidial/trunk$ for table in $(cat extras/MySQL_AST_CREATE_tables.sql | tr -d '\n' | sed 's/;/;\n/g' |grep 'CREATE'| grep 'status VARCHAR' | cut -d' ' -f 3); do echo "SELECT count(*) FROM $table WHERE status='ChangeMe';"; done
SELECT count(*) FROM phones WHERE status='ChangeMe';
SELECT count(*) FROM park_log WHERE status='ChangeMe';
SELECT count(*) FROM vicidial_list WHERE status='ChangeMe';
SELECT count(*) FROM vicidial_live_agents WHERE status='ChangeMe';
SELECT count(*) FROM vicidial_log WHERE status='ChangeMe';
SELECT count(*) FROM vicidial_closer_log WHERE status='ChangeMe';
SELECT count(*) FROM vicidial_campaigns WHERE status='ChangeMe';
SELECT count(*) FROM vicidial_statuses WHERE status='ChangeMe';
SELECT count(*) FROM vicidial_campaign_statuses WHERE status='ChangeMe';
SELECT count(*) FROM vicidial_campaign_hotkeys WHERE status='ChangeMe';
SELECT count(*) FROM vicidial_agent_log WHERE status='ChangeMe';
SELECT count(*) FROM vicidial_callbacks WHERE status='ChangeMe';
SELECT count(*) FROM vicidial_lead_recycle WHERE status='ChangeMe';
SELECT count(*) FROM vicidial_timeclock_status WHERE status='ChangeMe';
SELECT count(*) FROM vicidial_carrier_log WHERE status='ChangeMe';
SELECT count(*) FROM vicidial_list_update_log WHERE status='ChangeMe';
SELECT count(*) FROM twoday_vicidial_log WHERE status='ChangeMe';
SELECT count(*) FROM twoday_vicidial_closer_log WHERE status='ChangeMe';
SELECT count(*) FROM twoday_vicidial_agent_log WHERE status='ChangeMe';
SELECT count(*) FROM vicidial_agent_skip_log WHERE status='ChangeMe';
SELECT count(*) FROM vicidial_log_noanswer WHERE status='ChangeMe';
SELECT count(*) FROM vicidial_qc_agent_log WHERE status='ChangeMe';
SELECT count(*) FROM vicidial_email_list WHERE status='ChangeMe';
SELECT count(*) FROM vicidial_nanpa_filter_log WHERE status='ChangeMe';

Aint the linux CLI fantastic? 8)
Vicidial Partner. Region: Sweden/Norway.
Does Vicidial installation, configuration, customization, add-ons, CRM implementation, support, upgrading, network-related, pentesting etc. Remote and onsite assistance.
Email: domedan (at) gmail.com
DomeDan
 
Posts: 1226
Joined: Tue Jan 04, 2011 9:17 am
Location: Sweden

Re: Change Historic Disposition Statuses

Postby Rudolfmdlt » Mon Nov 18, 2013 9:07 am

That's amazing! :) Thanks! :)

Going to try and turn this into a script for future use!

Thanks a lot DomeDan!
Rudolfmdlt
 
Posts: 92
Joined: Thu Jul 25, 2013 2:07 am


Return to Support

Who is online

Users browsing this forum: No registered users and 116 guests