docs: public long run(int agent_id, String phone_no, long call_id, TimestampType start_ts) {
          voltQueueSQL(findOpenCall, EXPECT_ZERO_OR_ONE_ROW, call_id, agent_id, phone_no);
          voltQueueSQL(findCompletedCall, EXPECT_ZERO_OR_ONE_ROW, call_id, agent_id, phone_no);
          VoltTable[] results = voltExecuteSQL();
  
          boolean completedCall = results[1].getRowCount() > 0;
          if (completedCall) {
              return -1;
          }
  
          VoltTable openRowTable = results[0];
          if (openRowTable.getRowCount() > 0) {
              VoltTableRow existingCall = openRowTable.fetchRow(0);
  
              // check if this is the second begin we've seen for this open call
              existingCall.getTimestampAsTimestamp("start_ts");
              if (existingCall.wasNull() == false) {
                  return -1;
              }
  
              // check if this completes the call
              TimestampType end_ts = existingCall.getTimestampAsTimestamp("end_ts");
              if (existingCall.wasNull() == false) {
  
                  int durationms = (int) ((end_ts.getTime() - start_ts.getTime()) / 1000);
  
                  // update per-day running stddev calculation
                  computeRunningStdDev(agent_id, end_ts, durationms);
  
                  // completes the call
                  voltQueueSQL(deleteOpenCall, EXPECT_SCALAR_MATCH(1),
                          call_id, agent_id, phone_no);
                  voltQueueSQL(insertCompletedCall, EXPECT_SCALAR_MATCH(1),
                          call_id, agent_id, phone_no, start_ts, end_ts, durationms);
  
                  voltExecuteSQL(true);
                  return 0;
              }
          }
  
          voltQueueSQL(upsertOpenCall, EXPECT_SCALAR_MATCH(1), call_id, agent_id, phone_no, start_ts);
          voltExecuteSQL(true);
          return 0;
      }