Script on Cati call

From Catglobe Wiki
Revision as of 12:22, 18 November 2021 by Administrator (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Script on Cati call

Add the ability to call a script after each time a number has been dialed, also set via the cati settings. This will allow us better control of when to do various stuff, and also allow custom logic for some cases... e.g. in the rerecruitment we can say that when it reach the maxdial status, then we opt people out of panel. Or we can send SMS to people with answering machines that we will call them back. It should be noticed that the calling of this script is on the critical path, and must therefore be severely restricted in the amount of work done, ie in the case of sending SMS, the only thing the script should do is add respondent to a group and another script scheduled to run e,g. every 30 min takes care of the actual sending of SMS.

The script gets the following parameters:

1. The current cati contact in same format as returned from CATI_getCATIContacts

2. Times called

The current user context is set to the user of the qas, and the qas context is the dialed qas.

Setup

Define "Script to execute after call" at CATI setting on Fieldwork management:

2018-05-23 15-25-57.png


Script on Workflow:

array a = Workflow_getParameters();
array currentCatiContact = a[0];//same format as returned from CATI_getCATIContacts
number timesCalled = a[1];
....

2018-05-23 15-39-30.png