LDC II Application Logic

Caller Verification

Each participant who initiates a call to the platform will be asked to enter their PIN. Five criteria will be tested before the call is allowed to proceed:

  • The caller's pin must have been activated. In the case of Switchboard Cellular, this is controlled by the recruitment staff. Participants are asked to call the recruitment staff after they receive their information packet; once they call in, their PIN is activated.
  • The caller must not have made a successful call within the last 24 hour period. This is tested using the following SQL query:
    select to_char(sysdate,'YYYYMMDD:HH24:MI:SS'),
         greatest(to_char(sysdate,'YYYYMMDD:HH24:MI:SS'),
         NVL(max(to_char(swb_calls.call_date + 1,'YYYYMMDD:HH24:MI:SS')),
         to_char(sysdate,'YYYYMMDD:HH24:MI:SS')))
         from swb_calls,dual
         where (swb_calls.caller_pin =  'SOMEPIN' or
         swb_calls.callee_pin = 'SOMEPIN')
         and call_stat = 'SUCC' 
    
  • The database includes a field for the number of calls initiated and the allowable number of calls initiated (which result in a successful call). The PIN will be rejected unless the allowable number of calls initiated is less than the number of calls initiated.
  • The number of calls initiated and received which result in a successful call must be less than the total allowable successful calls.
  • The call in progress flag nust be set to 'NO'
If any of these tests fails, the PIN will be rejected. The caller will be notified of the reason that their PIN was rejected; for example, if their pin is not active, they will be asked to call the recruitment hotline for assistance.
switch(pinokYN)
    case PIN_QUERY_TOOSOON:
       ...
       sc_play(VOXchan, PROMPT_DIR & "\" & TOO_SOON & lang_offset, 768);
       display("FAI",VOXchan,2);
       voslog(date8() & "-" & time() & " " & ani & " :: PIN used, 24 hours :: " & pin);
       cpfailYN = 1;
       break;
    case PIN_QUERY_CIPYES:
       sc_play(VOXchan, PROMPT_DIR & "\" & CIPYES & lang_offset, 768);
       display("FAI",VOXchan,2);
       voslog(date8() & "-" & time() & " " & ani & " :: PIN used, CIP YES :: " & pin);
       cpfailYN = 1;
       break;
    case PIN_QUERY_ACTVNO:
       sc_play(VOXchan, PROMPT_DIR & "\" & ACTVNO & lang_offset, 768);
       sc_play(VOXchan, PROMPT_DIR & "\" & CALL_LDC & lang_offset, 768);
       ldcnum = "18003807366";
       for (Chr = 1; Chr <= length(ldcnum); Chr++)
           sc_play(VOXchan, PROMPT_DIR & "\" & substr(ldcnum, Chr, 1) & lang_offset, 768);
	   if(Chr eq 1 or Chr eq 4 or Chr eq 7)
		sc_play(VOXchan,PROMPT_DIR & "\" & SILENCE, 768);
	   endif
       endfor
       display("FAI",VOXchan,2);
       voslog(date8() & "-" & time() & " " & ani & " :: PIN use attempted w/o activation :: " & pin);
       cpfailYN = 1;
       break;
    case PIN_QUERY_REFUSAL:
       sc_play(VOXchan, PROMPT_DIR & "\" & NO_CALLS_ALLOWED & lang_offset, 768);
       display("FAI",VOXchan,2);
       voslog(date8() & "-" & time() & " " & ani & " :: expired pin :: " & pin);
       voslog("@L" & timestamp & "," & ani & " bad pin|");
       cpfailYN = 1;
       break;
    case PIN_QUERY_SUCCESS:
       sc_play(VOXchan, PROMPT_DIR & "\" & THANK_YOU & lang_offset, 768);
       display("OK",VOXchan,2);
       cpfailYN = 0;
       break;
    default:
       sc_play(VOXchan, PROMPT_DIR & "\" & INVALID_ENTRY & lang_offset, 768);
       display("ERR",VOXchan,2);
       voslog(date8() & "-" & time() & " " & ani & " :: bad pin :: " & pin);
endswitch

CALLEE Selection
Due to the fact that all Caller/Callee pairs in the Switchboard
collections must be unique, callee selection cannot take place until
the caller's pin has been verified. Once this takes place, The
platform will select a callee who meets the criteria defined below:
  • They must not be the caller.
  • Their PIN must not be locked by another 'select for update...'
  • The (caller pin,callee pin) pair must be unique
  • Their 'ACTIVE' field must be set to 'YES'
  • They must not be participating in another call simultaneously (CIP = 'NO')
  • Their end date value must be in the future.
  • They must not have participated in more successful calls as a callee than their allowable number of calls received
  • They must not have participated in more successful calls than the total allowed
  • They must be available on this day.
  • They must be available at this timeslot.
This module returns a valid callee PIN, the LDC Phone Code and
phone number from the Availability table, and a previously unused
topic (The topic has not been heard by either the callee or the caller).

Topics:

Topics are stored as a distinct 70 character long string associated with each participant. Each space in the string can hold either a Y (yes), a N (no), or a T (talked). Once the caller and callee have been selected, their respective topic strings are compared; the algorithm selects one index marked "Y" in both strings at random.