Shift by Callback Script
With the callback script rules in Askia, you can set as many different rules as you want, from a single script.
The rules
The rules are perhaps best explained by using an example scenario. In this scenario let's say you have to attempt calls to your numbers twice during the week, before calling back at the weekend and have 2.5 days between each attempt. It means if you call on Monday morning (shift 1), the next call must occur on Wednesday afternoon (shift 6).
Morning (08:00-13:00) | Afternoon(13:00-19:00) | |
Monday | Shift 1 | Shift 2 |
Tuesday | Shift 3 | Shift 4 |
Wednesday | Shift 5 | Shift 6 |
Thursday | Shift 7 | Shift 8 |
Friday | Shift 9 | Shift 10 |
Saturday | Shift 11 | Shift 12 |
If you want to iterate:
Call | Next call |
Shift 1 | Shift 6 |
Shift 2 | Shift 7 |
Shift 3 | Shift 8 |
Shift 4 | Shift 9 |
Shift 5 | Shift 10 |
Shift 6 | If 2 calls, Shift 11 else shift 1 |
Shift 7 | If 2 calls, Shift 12 else shift 2 |
Shift 8 | Shift 1 |
Shift 9 | Shift 2 |
Shift 10 | Shift 3 |
Shift 11 | Shift 4 |
Shift 12 | Shift 5 |
Create shifts
Firstly you will need to set your shifts. Select the task , properties, Callback . . .
Insert as many shifts as you need . . .
Create script
And then create your script . . .
Select the cases where you want a callback by shift
Dim arrCalltoshift 'cases
Select Case [CallHistory.LastCallResult]
Case 1, 2, 3, 5, 9, 8, 11, 14, 15, 6, 15, 12, 14, 22, 23, 24, 25, 26, 27, 28
arrCalltoshift = 1
case else
arrCalltoShift = 0
end select
Select the next shift
Create a variable 'weekshift' where:
- 'weekshift'=0 when there is less than 2 calls during the week , else
- 'weekshift'=1 when there is 2 consecutive calls during the week . . .
if arrCalltoshift = 1 then
Dim weekshift
Dim CallShiftValid(2) 'where (2) is the mmaximum consecutive attempts number during the week
If ([Contact.CallCount] > 1) and ([CallHistory.LastCallShift]< 11) Then
CallShiftValid(1) = [CallHistory.arrCallShift]([Contact.CallCount] - 1)
CallShiftValid(2) = [CallHistory.arrCallShift]([Contact.CallCount] - 2)
End if
if (CallShiftValid(1) <> "") and (CallShiftValid(2) <> "") then
weekshift=1
else
weekshift=0
End if
If weekshift <> 1 then 'less than 2 calls during the week
If ([CallHistory.LastCallShift]<6) then
[Result.CallBackShift] = [CallHistory.LastCallShift]+ 5
Else
[Result.CallBackShift] = ([CallHistory.LastCallShift]+ 5) - 10
End if
If ([CallHistory.LastCallShift] = 11) then
[Result.CallBackShift] = 4
End If
If ([CallHistory.LastCallShift] = 12) then
[Result.CallBackShift] = 5
End if
End if
if weekshift = 1 then
If ([CallHistory.LastCallShift] = 6) or ([CallHistory.LastCallShift] = 8) then
[Result.CallBackShift] = 11
End If
If ([CallHistory.LastCallShift] = 7) or ([CallHistory.LastCallShift] = 9)then
[Result.CallBackShift] = 12
End If
End if
End if
If you want to run this example, we have enclosed a package (📥 All_KB_Callback_shift_byscript.tsk) that you can import on your platform .