Interviewer - Server > Architecture > Interview Service tier > Dialer Interface component > How autodialing works > Group dialing > How respondents are connected
 
How respondents are connected
Group dialing threads
The following diagram shows how a respondent is connected for group dialing:
The diagram shows that there are three separate threads involved in group dialing.
Thread A. This is the request thread from the Phone Participants activity; that is, the thread that handles the Web Service method call to GetNewSampleRecord.
See GetNewSampleRecord.
Thread B. This is the dialing worker thread created by the QSamp Group dialing provider. Each project has its own dialing thread.
Thread C. The QSamp thread. This thread is created by the QSamp component to dispatch events based on QSamp messages.
The steps involved in group dialing are:
A: Request thread
1 The Interviewer Session Engine makes a call to Get on the sample management provider.
2 The QSamp group dialing provider adds the interviewer to the table of waiting interviewers and creates an event synchronization object for the request thread to wait on once the dial request has been queued. (Each project–dialer–group combination has its own table of waiting interviewers, for example, a table for project A, dialer D1 , group 1, and another table for project A, dialer D1, group 2. These tables are held in memory only.)
3 The interviewer is made a member of the group. There is one group per project–interviewer qualification combination.
4 The group dial request is queued for the project-dialer-group combination. Since there is a dialing worker thread per project, there may be several concurrent dialing requests for different dialers and groups.
B: Dialing worker thread
1 If the dialer worker thread is not already running, it is started when a dial request is queued. The next request in the queue is then removed from the queue.
2 The project's predictive dialing algorithm is called. Predictive dialing algorithms are described in the "Predictive algorithms" subsection later in this topic.
3 Based on the number of calls being dialed for the group and the number that were predicted to be dialed based on the current dialing statistics, the worker thread gets additional records from the sample management provider.
4 DialCall is called for each sample record. For each record that is successfully dialed, a call event handler is created and hooked to the call object.
See also DialCall.
C: QSamp thread
1 The OnStateChanged event is fired in response to a call event.
See also OnStateChanged.
2 If the call has been connected, the sample record is added to the table of waiting interviewers for the connected extension and the waiting interviewer event is signaled. This, in turn, causes thread A to remove the waiting interviewer entry from the table and return the sample record.
If the OnStateChanged event is fired due to a Terminate event, the sample record is returned and a new dial request is queued.
Notes
The dialing worker thread is signaled by requests to the dial request queue. For predictive algorithms that look at the ring time of the in-dial calls, the dialing worker thread calls the predictive algorithm automatically after an n millisecond time-out.
The sample management providers for each project are single threaded. Calls are queued when multiple threads attempt to call GetSampleRec or ReturnSampleRec for the same project at the same time. User interface delays can occur when the GetSampleRec or ReturnSampleRec calls take longer than a few hundred milliseconds. For example, the user interface will be slow to update when a call is connected, or when the interviewer dispositions a call by selecting a call outcome.
To avoid contention on the sample management provider, separate sample management provider collections can be created for each thread. In the skeleton code, separate sample management provider collections are created:
For retrieving new sample records
For returning manually dispositioned calls
For returning dialer dispositioned calls
If the same thread is used to handle requests, to retrieve new sample records, and to handle dialer dispositioned call outcomes (including call connects), consider separating the requests in order to retrieve new numbers in a separate thread.
See also
Group dialing