Difference between revisions of "Script on Cati call"
Nguyenduyan (talk | contribs) (Created page with "Category:Questionnaire_Functions") |
|||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | [[Category: | + | [[Category:CATI_module]] |
+ | = 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: | ||
+ | |||
+ | [[File:2018-05-23_15-25-57.png]] | ||
+ | |||
+ | |||
+ | Script on Workflow: | ||
+ | |||
+ | <source lang="javascript"> | ||
+ | array a = Workflow_getParameters(); | ||
+ | array currentCatiContact = a[0];//same format as returned from CATI_getCATIContacts | ||
+ | number timesCalled = a[1]; | ||
+ | .... | ||
+ | </source> | ||
+ | |||
+ | [[File:2018-05-23_15-39-30.png]] |
Latest revision as of 11:22, 18 November 2021
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:
Script on Workflow:
array a = Workflow_getParameters();
array currentCatiContact = a[0];//same format as returned from CATI_getCATIContacts
number timesCalled = a[1];
....