Page 1 of 1

Reseting all a users callbacks

PostPosted: Wed Jun 20, 2012 8:27 am
by Cj4life24
So i guess i need some help or some clarfication. the company i work for decides to just reuse user numbers. so they always use #301-330 and as the numbers are used when someone leaves they are just replaced, Some of the agents i notice have some 300 callbacks set and i need to find a way to just clear all of a users callbacks to statrt fresh. I have tried inside the useser call back holds to release some but it will not release all because most of them are still active. cal anyone help me or do i have to do it lead by lead to reset it or can i do it with some sql code?

Re: Reseting all a users callbacks

PostPosted: Sat Jul 07, 2012 10:00 am
by williamconley
1) Welcome to the party! 8-)

2) when you post, please post your entire configuration including (but not limited to) your installation method and vicidial version with build.

this IS a requirement for posting along with reading the stickies (at the top of each forum) and the manager's manual (available on EFLO.net, both free and paid versions)

You should also post: Asterisk version, telephony hardware (model number is helpful here), cluster information if you have one, and whether any other software is installed in the box. If your installation method is "from scratch" you must post your operating system and should also post the .iso version from which you installed your original operating system. If your installation is "Hosted" list the site name of the host.

If this is a "Cloud" or "Virtual" server, please note the technology involved along with the version of that techology (ie: VMware Server Version 2.0.2). If it is not, merely stating the Motherboard model # and CPU would be helpful.

Similar to This:

Vicibox X.X from .iso | Vicidial X.X.X-XXX Build XXXXXX-XXXX | Asterisk X.X.X | Single Server | No Digium/Sangoma Hardware | No Extra Software After Installation | Intel DG35EC | Core2Quad Q6600

3) If you are too lazy to go through the leads one at a time, or deal with the fact that the live ones will not release ... I'd say your best bet would be MySQL, absolutely. LOL. But you are sure that the link "Remove LIVE Callbacks older than one week for this user" is not sufficient for your task? (This link is on the User Callback Hold page for each user)

Re: Reseting all a users callbacks

PostPosted: Fri Jul 20, 2012 11:58 am
by Cj4life24
Thanks for the reply and help...I updated my signature with the specs you asked for.

Now Yes i am lazy....My compay uses the same user id's so when someone quits their id is just used by a new hire....So some of the users have 300+ callbacks each due to poor maganment and lack of direction by the last system admin. I know i can do it through MYSQL but i am really not comfortable doing it with out some help and direction. And i am aware of the link to dump callback on the user page but not all allbacks are LIVE so i can't dump them all. So i am looking for some possiable direction on hw to remove all callbacks through a MYSQl query....

Re: Reseting all a users callbacks

PostPosted: Mon Jul 30, 2012 7:28 am
by DomeDan
I normally don't want to remove callbacks, I rather set them to recipient=ANYONE
something like this:
Code: Select all
UPDATE vicidial_callbacks c
INNER JOIN vicidial_list i ON i.lead_id=c.lead_id
SET c.recipient='ANYONE', i.status='CALLBK', c.status = 'ACTIVE'
WHERE c.user = '6666'
AND i.status IN ('CBHOLD','CALLBK')
AND c.status IN ('ACTIVE','LIVE');

then they will be called at the scheduled date and sent to any user,
warning: experimenting like I do can have consequences!

Well if you just want them to not appear in the callback-list for the user then just this would probably do the trick:
Code: Select all
UPDATE vicidial_callbacks SET status = 'INACTIVE' WHERE user = '6666';

but those leads the callback are for wont be called in that list

Re: Reseting all a users callbacks

PostPosted: Sat Aug 04, 2012 9:38 am
by Cj4life24
I used that script thank you it work for the most part but allowed me to atleast minimuze the leads tied up in call backs. question i modified the script and before i run it i want to make sure it will work, I just changed the set line to change the statuse on these to NEW will this do what i think it will and change all user only callbacks for user 301 to NEW?

UPDATE vicidial_callbacks c
INNER JOIN vicidial_list i ON i.lead_id=c.lead_id
SET i.status='NEW'
WHERE c.user = '301'
AND i.status IN ('CBHOLD','CALLBK')
AND c.status IN ('ACTIVE','LIVE');

Re: Reseting all a users callbacks

PostPosted: Mon Aug 06, 2012 4:29 am
by DomeDan
If you want to do like that then you need to change it a bit to make sure that the callback is inactive
otherwise the lead might be called once because its NEW and a second time when the callback date is reached.
We can also add a statement to check that the user in vicidial_list is the same as in vicidial_callbacks to make sure that we are not removing someone else callback
and maybe you want to reset called_since_last_reset and called_count too
If your using more custom callback statuses, then they should be added to the list ('CBHOLD','CALLBK')
Code: Select all
UPDATE vicidial_callbacks c
INNER JOIN vicidial_list i ON i.lead_id=c.lead_id
SET i.status='NEW', i.called_since_last_reset='N', i.called_count='0', c.status='INACTIVE'
WHERE c.user = '301'
AND i.user = c.user
AND i.status IN ('CBHOLD','CALLBK')
AND c.status IN ('ACTIVE','LIVE');