Page 1 of 1

Lead filter check if valid

PostPosted: Tue Oct 25, 2022 8:17 am
by dhijrwn
Hi guys.

I have this lead filter where it select new status or status in 'A', 'AA', 'B' 'AB', 'NI', 'N', 'NA', 'NL', 'B', 'DROP' as long they are less than or equal to 3 call count and then it will try it again after 3 hours of attempt.


(status = 'NEW') OR
(
status IN ('A', 'AA', 'B' 'AB', 'NI', 'N', 'NA', 'NL', 'B', 'DROP') AND
called_count <= 3 AND
last_local_call_time < CONCAT(DATE_ADD(CURDATE(), INTERVAL -3 HOUR),' ',CURTIME())
)

or it must be like this?
(
((status IN ('A', 'AA', 'B' 'AB', 'NI', 'N', 'NA', 'NL', 'B', 'DROP')) and
(last_local_call_time < CONCAT(DATE_ADD(CURDATE(), INTERVAL -3 HOUR),' ',CURTIME())) and called_count <= 3) or
(status NOT IN ('A', 'AA', 'B' 'AB', 'NI', 'N', 'NA', 'NL', 'B', 'DROP'))
)

What I want is this.
If a number was dispo as Answering machine or any of that status inside of an IN statement then if the manager manually reset the leads I want the answering machine number to be loaded after 3 hours from the last attempt(example 12:00pm last called it must be loaded at 3:00pm even the manager reset the list).
I copied the last condition from the DROP72HOUR entry.

Re: Lead filter check if valid

PostPosted: Wed Oct 26, 2022 7:20 am
by jamiemurray
I tend to do mine like this so it's easier to read and amend without having to spend too much time thinking about it and gives a bit more control over the time different statuses are retried or even the call count at which they have to be under to dial.

Be careful though if making it too complicated on systems with large lead counts within the active lists, it can cause the hopper script to take time to complete during which time the vicidial_list table is locked. This prevents answered calls from being delivered to agents that are ready and the agent screens freeze up if the action they are trying to perform involves updating a lead. It's worth after putting the filter live (without dialing in progress, running the hopper script manually to see how long it takes, if it takes more than a few seconds, you will start seeing issues during production dialing time.

Code: Select all
(
   (
      (status IN ('A','AA','AB','B','DAIR','PDROP','RING','PU','N','NA','AL','AM') AND last_local_call_time < DATE_SUB(NOW(), INTERVAL '3' HOUR) AND called_count <= 10)
      OR
      (status IN ('FASRB','FASNA','FASIA','FASVM') AND last_local_call_time < DATE_SUB(NOW(), INTERVAL '15' MINUTE) AND called_count <= 10)
      OR
      (status IN ('NOTAVA') AND last_local_call_time < DATE_SUB(NOW(), INTERVAL '1' DAY) AND called_count <= 5)
      OR
      (status IN ('NIBEG','HANGUP','DCMX') AND last_local_call_time < DATE_SUB(NOW(), INTERVAL '7' DAY) AND called_count <= 5)
      OR
      (status IN ('NI','CALLBK') AND last_local_call_time < DATE_SUB(NOW(), INTERVAL '30' DAY) AND called_count <= 5)
      OR
      (status IN ('DROP') AND last_local_call_time < DATE_SUB(NOW(),INTERVAL '3' DAY) AND called_count <= 5)
   )
      OR status IN ('NEW','AFTHRS')
)